mirror of
https://github.com/YACReader/yacreader
synced 2025-06-03 17:18:23 -04:00
nuevo dise?o para el di?logo de propiedades
This commit is contained in:
parent
871d10af90
commit
1c9089dca3
@ -103,5 +103,8 @@
|
|||||||
<file>../images/branch-closed.png</file>
|
<file>../images/branch-closed.png</file>
|
||||||
<file>../images/expanded_branch_selected.png</file>
|
<file>../images/expanded_branch_selected.png</file>
|
||||||
<file>../images/collapsed_branch_selected.png</file>
|
<file>../images/collapsed_branch_selected.png</file>
|
||||||
|
<file>../images/previousCoverPage.png</file>
|
||||||
|
<file>../images/nextCoverPage.png</file>
|
||||||
|
<file>../images/busy_background.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include "yacreader_field_edit.h"
|
#include "yacreader_field_edit.h"
|
||||||
#include "yacreader_field_plain_text_edit.h"
|
#include "yacreader_field_plain_text_edit.h"
|
||||||
#include "db_helper.h"
|
#include "db_helper.h"
|
||||||
|
#include "yacreader_busy_widget.h"
|
||||||
|
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
@ -29,14 +30,17 @@ PropertiesDialog::PropertiesDialog(QWidget * parent)
|
|||||||
createTabBar();
|
createTabBar();
|
||||||
|
|
||||||
mainLayout = new QGridLayout;
|
mainLayout = new QGridLayout;
|
||||||
mainLayout->addWidget(coverBox,0,0);
|
//mainLayout->addWidget(coverBox,0,0);
|
||||||
mainLayout->addWidget(tabBar,0,1);
|
mainLayout->addWidget(tabBar,0,1);
|
||||||
mainLayout->setColumnStretch(1,1);
|
mainLayout->setColumnStretch(1,1);
|
||||||
/*mainLayout->addWidget(authorsBox,1,1);
|
/*mainLayout->addWidget(authorsBox,1,1);
|
||||||
mainLayout->addWidget(publishingBox,2,1);*/
|
mainLayout->addWidget(publishingBox,2,1);*/
|
||||||
mainLayout->addWidget(buttonBox,1,1,Qt::AlignBottom);
|
mainLayout->addWidget(buttonBox,1,1,Qt::AlignBottom);
|
||||||
|
|
||||||
this->setLayout(mainLayout);
|
mainWidget = new QWidget(this);
|
||||||
|
mainWidget->setAutoFillBackground(true);
|
||||||
|
mainWidget->setFixedSize(470,444);
|
||||||
|
mainWidget->setLayout(mainLayout);
|
||||||
mainLayout->setSizeConstraint(QLayout::SetMinimumSize);
|
mainLayout->setSizeConstraint(QLayout::SetMinimumSize);
|
||||||
|
|
||||||
int heightDesktopResolution = QApplication::desktop()->screenGeometry().height();
|
int heightDesktopResolution = QApplication::desktop()->screenGeometry().height();
|
||||||
@ -45,11 +49,17 @@ PropertiesDialog::PropertiesDialog(QWidget * parent)
|
|||||||
sHeight = static_cast<int>(heightDesktopResolution*0.65);
|
sHeight = static_cast<int>(heightDesktopResolution*0.65);
|
||||||
sWidth = static_cast<int>(sHeight*1.4);
|
sWidth = static_cast<int>(sHeight*1.4);
|
||||||
setCover(QPixmap(":/images/notCover.png"));
|
setCover(QPixmap(":/images/notCover.png"));
|
||||||
this->resize(sWidth,this->height());
|
|
||||||
this->move(QPoint((widthDesktopResolution-sWidth)/2,((heightDesktopResolution-sHeight)-40)/2));
|
this->move(QPoint((widthDesktopResolution-sWidth)/2,((heightDesktopResolution-sHeight)-40)/2));
|
||||||
setModal(true);
|
setModal(true);
|
||||||
repaint();
|
|
||||||
|
|
||||||
|
setFixedSize( sizeHint() );
|
||||||
|
mainWidget->move(280,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize PropertiesDialog::sizeHint()
|
||||||
|
{
|
||||||
|
return QSize(750,444);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PropertiesDialog::createTabBar()
|
void PropertiesDialog::createTabBar()
|
||||||
@ -63,33 +73,46 @@ void PropertiesDialog::createTabBar()
|
|||||||
|
|
||||||
void PropertiesDialog::createCoverBox()
|
void PropertiesDialog::createCoverBox()
|
||||||
{
|
{
|
||||||
coverBox = new QGroupBox(tr("Cover"));
|
coverBox = new QWidget(this);
|
||||||
|
|
||||||
sa = new QScrollArea();
|
QHBoxLayout * layout = new QHBoxLayout;
|
||||||
cover = new QLabel();
|
|
||||||
cover->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
|
QLabel * label = new QLabel(tr("Cover page"));
|
||||||
cover->setScaledContents(false);
|
label->setStyleSheet("QLabel {color: white; font-weight:bold; font-size:14px;}");
|
||||||
cover->setAlignment(Qt::AlignTop|Qt::AlignHCenter);
|
layout->addWidget(label);
|
||||||
|
layout->addStretch();
|
||||||
|
|
||||||
|
coverPageEdit = new YACReaderFieldEdit();
|
||||||
|
|
||||||
|
QToolButton * previous = new QToolButton();
|
||||||
|
previous->setIcon(QIcon(":/images/previousCoverPage.png"));
|
||||||
|
previous->setStyleSheet("QToolButton {border:none;}");
|
||||||
|
QToolButton * next = new QToolButton();
|
||||||
|
next->setIcon(QIcon(":/images/nextCoverPage.png"));
|
||||||
|
next->setStyleSheet("QToolButton {border:none;}");
|
||||||
|
|
||||||
/*sa->setWidget(cover);
|
QLabel * coverPageNumberLabel = new QLabel("1");
|
||||||
sa->setBackgroundRole(QPalette::Dark);
|
|
||||||
sa->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
|
||||||
sa->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
|
||||||
sa->setFrameStyle(QFrame::NoFrame);
|
|
||||||
sa->setAlignment(Qt::AlignCenter);*/
|
|
||||||
|
|
||||||
QVBoxLayout * coverLayout = new QVBoxLayout();
|
coverPageNumberLabel->setStyleSheet("QLabel {color: white; font-weight:bold; font-size:14px;}");
|
||||||
coverLayout->addWidget(cover);
|
|
||||||
|
layout->addWidget(previous);
|
||||||
|
layout->addSpacing(5);
|
||||||
|
layout->addWidget(coverPageNumberLabel);
|
||||||
|
layout->addSpacing(5);
|
||||||
|
layout->addWidget(next);
|
||||||
|
|
||||||
|
coverPageEdit->setStyleSheet("QLineEdit {border:none;}");
|
||||||
|
layout->setSpacing(0);
|
||||||
|
|
||||||
|
coverBox->setLayout(layout);
|
||||||
|
|
||||||
|
coverBox->setFixedWidth(280);
|
||||||
|
coverBox->move(0,444-28);
|
||||||
|
layout->setContentsMargins(5,4,5,0);
|
||||||
|
|
||||||
|
busyIndicator = new YACReaderBusyWidget(this);
|
||||||
|
busyIndicator->move((280-busyIndicator->width())/2,(444-busyIndicator->height()-28)/2);
|
||||||
|
|
||||||
QHBoxLayout * coverPageLayout = new QHBoxLayout;
|
|
||||||
coverPageLayout->addWidget(new QLabel(tr("Cover page : ")));
|
|
||||||
coverPageLayout->addWidget(coverPageEdit = new YACReaderFieldEdit());
|
|
||||||
coverPageLayout->setStretch(1,0);
|
|
||||||
|
|
||||||
coverLayout->addLayout(coverPageLayout);
|
|
||||||
|
|
||||||
coverBox->setLayout(coverLayout);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QFrame * createLine()
|
QFrame * createLine()
|
||||||
@ -440,9 +463,10 @@ void PropertiesDialog::updateComics()
|
|||||||
QSqlDatabase::removeDatabase(databasePath);
|
QSqlDatabase::removeDatabase(databasePath);
|
||||||
}
|
}
|
||||||
//Deprecated
|
//Deprecated
|
||||||
void PropertiesDialog::setCover(const QPixmap & coverImage)
|
void PropertiesDialog::setCover(const QPixmap & coverI)
|
||||||
{
|
{
|
||||||
cover->setPixmap(coverImage.scaledToWidth(125,Qt::SmoothTransformation));
|
coverImage = coverI.scaledToHeight(444,Qt::SmoothTransformation);
|
||||||
|
//cover->setPixmap(coverImage.scaledToWidth(125,Qt::SmoothTransformation));
|
||||||
//cover->repaint();
|
//cover->repaint();
|
||||||
|
|
||||||
//float aspectRatio = (float)coverImage.width()/coverImage.height();
|
//float aspectRatio = (float)coverImage.width()/coverImage.height();
|
||||||
@ -695,3 +719,17 @@ void PropertiesDialog::closeEvent ( QCloseEvent * e )
|
|||||||
|
|
||||||
QDialog::closeEvent(e);
|
QDialog::closeEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PropertiesDialog::paintEvent(QPaintEvent * event)
|
||||||
|
{
|
||||||
|
QDialog::paintEvent(event);
|
||||||
|
|
||||||
|
QPainter p(this);
|
||||||
|
|
||||||
|
p.drawPixmap(0,0,coverImage);
|
||||||
|
|
||||||
|
QPixmap shadow(":/images/social_dialog/shadow.png");
|
||||||
|
p.drawPixmap(280-shadow.width(),0,shadow.width(),444,shadow);
|
||||||
|
|
||||||
|
p.fillRect(0,444-28,280,28,QColor(0,0,0,153));
|
||||||
|
}
|
@ -15,17 +15,22 @@ class YACReaderFieldEdit;
|
|||||||
class YACReaderFieldPlainTextEdit;
|
class YACReaderFieldPlainTextEdit;
|
||||||
class QDialogButtonBox;
|
class QDialogButtonBox;
|
||||||
class QCheckBox;
|
class QCheckBox;
|
||||||
|
class YACReaderBusyWidget;
|
||||||
|
|
||||||
#include "comic_db.h"
|
#include "comic_db.h"
|
||||||
|
|
||||||
class PropertiesDialog : public QDialog
|
class PropertiesDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private:
|
private:
|
||||||
|
QWidget * mainWidget;
|
||||||
|
YACReaderBusyWidget * busyIndicator;
|
||||||
|
|
||||||
QGridLayout * mainLayout;
|
QGridLayout * mainLayout;
|
||||||
|
|
||||||
QTabWidget * tabBar;
|
QTabWidget * tabBar;
|
||||||
|
|
||||||
QGroupBox * coverBox;
|
QWidget * coverBox;
|
||||||
QLabel * cover;
|
QLabel * cover;
|
||||||
QScrollArea * sa;
|
QScrollArea * sa;
|
||||||
|
|
||||||
@ -84,6 +89,8 @@ class QCheckBox;
|
|||||||
QPushButton *closeButton;
|
QPushButton *closeButton;
|
||||||
QPushButton *saveButton;
|
QPushButton *saveButton;
|
||||||
QPushButton *restoreButton; //??
|
QPushButton *restoreButton; //??
|
||||||
|
|
||||||
|
QPixmap coverImage;
|
||||||
|
|
||||||
void createTabBar();
|
void createTabBar();
|
||||||
void createCoverBox();
|
void createCoverBox();
|
||||||
@ -102,6 +109,8 @@ class QCheckBox;
|
|||||||
PropertiesDialog(QWidget * parent = 0);
|
PropertiesDialog(QWidget * parent = 0);
|
||||||
QString databasePath;
|
QString databasePath;
|
||||||
QString basePath;
|
QString basePath;
|
||||||
|
QSize sizeHint();
|
||||||
|
void paintEvent(QPaintEvent * event);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setComics(QList<ComicDB> comics);
|
void setComics(QList<ComicDB> comics);
|
||||||
|
@ -20,6 +20,7 @@ HEADERS += $$PWD/help_about_dialog.h \
|
|||||||
$$PWD/yacreader_library_list_widget.h \
|
$$PWD/yacreader_library_list_widget.h \
|
||||||
$$PWD/yacreader_library_item_widget.h \
|
$$PWD/yacreader_library_item_widget.h \
|
||||||
$$PWD/yacreader_treeview.h \
|
$$PWD/yacreader_treeview.h \
|
||||||
|
$$PWD/yacreader_busy_widget.h
|
||||||
|
|
||||||
|
|
||||||
SOURCES += $$PWD/help_about_dialog.cpp \
|
SOURCES += $$PWD/help_about_dialog.cpp \
|
||||||
@ -40,4 +41,5 @@ SOURCES += $$PWD/help_about_dialog.cpp \
|
|||||||
$$PWD/yacreader_sidebar.cpp \
|
$$PWD/yacreader_sidebar.cpp \
|
||||||
$$PWD/yacreader_library_list_widget.cpp \
|
$$PWD/yacreader_library_list_widget.cpp \
|
||||||
$$PWD/yacreader_library_item_widget.cpp \
|
$$PWD/yacreader_library_item_widget.cpp \
|
||||||
$$PWD/yacreader_treeview.cpp \
|
$$PWD/yacreader_treeview.cpp \
|
||||||
|
$$PWD/yacreader_busy_widget.cpp
|
BIN
images/busy_background.png
Normal file
BIN
images/busy_background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 327 B |
BIN
images/nextCoverPage.png
Normal file
BIN
images/nextCoverPage.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 153 B |
BIN
images/previousCoverPage.png
Normal file
BIN
images/previousCoverPage.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 152 B |
Loading…
x
Reference in New Issue
Block a user