Separaci?n en ficheros de las clases LibraryItem, Folder y Comic

A?adida la toolbar para la gesti?n de c?mics + im?genes para los iconos
Modificado el di?logo de informaci?n/propiedades de los c?mics
This commit is contained in:
Luis Ángel San Martín
2012-05-29 23:45:31 +02:00
parent 9dfa9c5f62
commit ed850ef374
23 changed files with 725 additions and 246 deletions

View File

@ -2,16 +2,16 @@
#include <QHBoxLayout>
#include <QApplication>
#include <QDesktopWidget>
#include <QSizePolicy>
PropertiesDialog::PropertiesDialog(QWidget * parent)
:QDialog(parent)
{
QVBoxLayout * l = new QVBoxLayout();
sa = new QScrollArea(this);
_cover = new QLabel(sa);
QHBoxLayout * l = new QHBoxLayout();
sa = new QScrollArea();
_cover = new QLabel();
_cover->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
_cover->setScaledContents(true);
_cover->setAlignment(Qt::AlignTop|Qt::AlignHCenter);
@ -24,18 +24,42 @@ PropertiesDialog::PropertiesDialog(QWidget * parent)
sa->setFrameStyle(QFrame::NoFrame);
sa->setAlignment(Qt::AlignCenter);
l->addWidget(sa);
QVBoxLayout * coverLayout = new QVBoxLayout();
coverLayout->addWidget(sa);
//coverLayout->addStretch();
l->addLayout(coverLayout);
QVBoxLayout * info = new QVBoxLayout();
info->addWidget(_name = new QLabel("name"));
info->addWidget(_pages = new QLabel("pages"));
info->addWidget(_size = new QLabel("size"));
info->setSizeConstraint(QLayout::SetMaximumSize);
info->addStretch();
//coverLayout->setSizeConstraint(QLayout::SetMaximumSize);
l->addLayout(info);
l->addStretch();
//l->setSizeConstraint(QLayout::SetNoConstraint);
this->setLayout(l);
this->setWindowTitle(tr("Comic properties"));
int heightDesktopResolution = QApplication::desktop()->screenGeometry().height();
int widthDesktopResolution = QApplication::desktop()->screenGeometry().width();
int sHeight,sWidth;
sHeight = static_cast<int>(heightDesktopResolution*0.5);
sWidth = static_cast<int>(sHeight*1.4);
this->resize(sWidth,sHeight);
}
void PropertiesDialog::setComics(QList<Comic> comics)
{
}
void PropertiesDialog::updateComics(QList<Comic> comics)
{
}
//Deprecated
void PropertiesDialog::setCover(const QPixmap & cover)
{
_cover->setPixmap(cover);
@ -43,20 +67,20 @@ void PropertiesDialog::setCover(const QPixmap & cover)
int heightDesktopResolution = QApplication::desktop()->screenGeometry().height();
int widthDesktopResolution = QApplication::desktop()->screenGeometry().width();
int sHeight,sWidth;
sHeight = static_cast<int>(heightDesktopResolution*0.84);
sHeight = static_cast<int>(heightDesktopResolution*0.5);
if(aspectRatio<1)
{
sWidth = static_cast<int>(sHeight*0.70);
this->resize(sWidth,sHeight);
sWidth = static_cast<int>(sHeight*1.4);
//this->resize(sWidth,sHeight);
this->move(QPoint((widthDesktopResolution-sWidth)/2,((heightDesktopResolution-sHeight)-40)/2));
_cover->resize(static_cast<int>((height()-90)*aspectRatio),
(height()-90));
_cover->resize(static_cast<int>((sa->height())*aspectRatio),
(sa->height()));
}
else
{
sWidth = static_cast<int>(sHeight*1.10);
this->resize(sWidth,sHeight);
sWidth = static_cast<int>(sHeight/1.16);
//this->resize(sWidth,sHeight);
this->move(QPoint((widthDesktopResolution-sWidth)/2,((heightDesktopResolution-sHeight)-40)/2));
_cover->resize((width()-25),
static_cast<int>((width()-25)/aspectRatio));