diff --git a/YACReader/goto_flow_gl.cpp b/YACReader/goto_flow_gl.cpp index 082ecb57..db4eb986 100644 --- a/YACReader/goto_flow_gl.cpp +++ b/YACReader/goto_flow_gl.cpp @@ -23,10 +23,54 @@ GoToFlowGL::GoToFlowGL(QWidget* parent, FlowType flowType) connect(flow,SIGNAL(centerIndexChanged(int)),this,SLOT(setPageNumber(int))); connect(flow,SIGNAL(selected(unsigned int)),this,SLOT(goTo())); - QHBoxLayout * bottom = new QHBoxLayout(this); + QHBoxLayout * topBar = new QHBoxLayout(); + + QLabel * imgTopLeft = new QLabel(); + QLabel * imgTopRight = new QLabel(); + QLabel * imgTopMiddle = new QLabel(); + QPixmap pL(":/images/imgTopLeft.png"); + QPixmap pM(":/images/imgTopMiddle.png"); + QPixmap pR(":/images/imgTopRight.png"); + imgTopLeft->setPixmap(pL); + imgTopRight->setPixmap(pR); + imgTopMiddle->setPixmap(pM); + imgTopMiddle->setScaledContents(true); + //imgTop->setStyleSheet("background-image: url(:/images/numPagesLabel.png); width: 100%; height:100%; background-repeat: none; border: none"); + + topBar->addWidget(imgTopLeft); + topBar->addWidget(imgTopMiddle); + topBar->addWidget(imgTopRight); + topBar->setStretchFactor(imgTopLeft,0); + topBar->setStretchFactor(imgTopMiddle,1); + topBar->setStretchFactor(imgTopRight,0); + + QHBoxLayout * bottomBar = new QHBoxLayout(this); + + QLabel * imgBottomLeft = new QLabel(this); + QLabel * imgBottomRight = new QLabel(this); + QLabel * imgBottomMiddle = new QLabel(this); + QPixmap pBL(":/images/imgBottomLeft.png"); + QPixmap pBM(":/images/imgBottomMiddle.png"); + QPixmap pBR(":/images/imgBottomRight.png"); + imgBottomLeft->setPixmap(pBL); + imgBottomRight->setPixmap(pBR); + imgBottomMiddle->setPixmap(pBM); + imgBottomMiddle->setScaledContents(true); + //imgTop->setStyleSheet("background-image: url(:/images/numPagesLabel.png); width: 100%; height:100%; background-repeat: none; border: none"); + + bottomBar->addWidget(imgBottomLeft); + bottomBar->addWidget(imgBottomMiddle); + bottomBar->addWidget(imgBottomRight); + bottomBar->setStretchFactor(imgBottomLeft,0); + bottomBar->setStretchFactor(imgBottomMiddle,1); + bottomBar->setStretchFactor(imgBottomRight,0); + + bottomToolBar = new QWidget(this); + + QHBoxLayout * bottom = new QHBoxLayout(bottomToolBar); bottom->addStretch(); - bottom->addWidget(new QLabel(tr("Page : "),this)); - bottom->addWidget(edit = new QLineEdit(this)); + bottom->addWidget(new QLabel(tr("Page : "),bottomToolBar)); + bottom->addWidget(edit = new QLineEdit(bottomToolBar)); v = new QIntValidator(this); v->setBottom(1); edit->setValidator(v); @@ -34,28 +78,42 @@ GoToFlowGL::GoToFlowGL(QWidget* parent, FlowType flowType) edit->setFixedWidth(40); edit->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Minimum)); - centerButton = new QPushButton(this); + centerButton = new QPushButton(bottomToolBar); centerButton->setIcon(QIcon(":/images/center.png")); connect(centerButton,SIGNAL(clicked()),this,SLOT(centerSlide())); bottom->addWidget(centerButton); - goToButton = new QPushButton(this); + goToButton = new QPushButton(bottomToolBar); goToButton->setIcon(QIcon(":/images/goto.png")); connect(goToButton,SIGNAL(clicked()),this,SLOT(goTo())); bottom->addWidget(goToButton); bottom->addStretch(); + + /* QGraphicsDropShadowEffect* effect = new QGraphicsDropShadowEffect( this ); + effect->setBlurRadius(100); + effect->setOffset(0,3); + effect->setColor(Qt::black); + setGraphicsEffect( effect );*/ + + + layout->addLayout(topBar); layout->addWidget(flow); - layout->addLayout(bottom); + //layout->addLayout(bottom); + layout->addLayout(bottomBar); layout->setStretchFactor(flow,1); - layout->setStretchFactor(bottom,0); + layout->setStretchFactor(bottomBar,0); layout->setMargin(0); layout->setSpacing(0); setLayout(layout); - this->setAutoFillBackground(true); + //this->setAutoFillBackground(true); resize(static_cast(5*imageSize.width()),static_cast(imageSize.height()*1.7)); + //bottomToolBar->setAutoFillBackground(true); + bottomToolBar->setLayout(bottom); + bottomToolBar->setGeometry(QRect(0,0,400,40)); + //install eventFilter flow->installEventFilter(this); edit->installEventFilter(this); @@ -229,4 +287,12 @@ void GoToFlowGL::updateConfig(QSettings * settings) /* flow->setVisibility(settings->value("visibilityDistance").toInt()); flow->setLightStrenght(settings->value("lightStrength").toInt())*/; +} + +void GoToFlowGL::resizeEvent(QResizeEvent * event) +{ + + bottomToolBar->setGeometry(QRect(0,(event->size().height()-50)+((50-bottomToolBar->height())/2),event->size().width(),40)); + + GoToFlowWidget::resizeEvent(event); } \ No newline at end of file diff --git a/YACReader/goto_flow_gl.h b/YACReader/goto_flow_gl.h index 087544fd..c8c4ad99 100644 --- a/YACReader/goto_flow_gl.h +++ b/YACReader/goto_flow_gl.h @@ -40,6 +40,8 @@ private: QPushButton * goToButton; //Comic * comic; QSize imageSize; + QWidget * bottomToolBar; + void resizeEvent(QResizeEvent * event); }; diff --git a/YACReader/images.qrc b/YACReader/images.qrc index 317f771a..6eeef964 100644 --- a/YACReader/images.qrc +++ b/YACReader/images.qrc @@ -36,6 +36,13 @@ ../images/alwaysOnTop.png ../images/adjustToFullSize.png ../images/numPagesLabel.png + ../images/imgTopLeft.png + ../images/imgTopMiddle.png + ../images/imgTopRight.png + ../images/imgBottomLeft.png + ../images/imgBottomMiddle.png + ../images/imgBottomRight.png + ../images/helpImages/open.png ../images/helpImages/openFolder.png ../images/helpImages/next.png diff --git a/YACReader/page_label_widget.cpp b/YACReader/page_label_widget.cpp index d3d6c780..bbcd20c4 100644 --- a/YACReader/page_label_widget.cpp +++ b/YACReader/page_label_widget.cpp @@ -14,7 +14,7 @@ PageLabelWidget::PageLabelWidget(QWidget * parent) imgLabel = new QLabel(this); QPixmap p(":/images/numPagesLabel.png"); imgLabel->resize(p.size()); - imgLabel->setPixmap(QPixmap(":/images/numPagesLabel.png")); + imgLabel->setPixmap(p); textLabel = new QLabel(this); textLabel->setAlignment(Qt::AlignVCenter|Qt::AlignHCenter); diff --git a/images/imgBottomLeft.png b/images/imgBottomLeft.png new file mode 100644 index 00000000..27fa1709 Binary files /dev/null and b/images/imgBottomLeft.png differ diff --git a/images/imgBottomMiddle.png b/images/imgBottomMiddle.png new file mode 100644 index 00000000..142bf3ac Binary files /dev/null and b/images/imgBottomMiddle.png differ diff --git a/images/imgBottomRight.png b/images/imgBottomRight.png new file mode 100644 index 00000000..e9417476 Binary files /dev/null and b/images/imgBottomRight.png differ diff --git a/images/imgTopLeft.png b/images/imgTopLeft.png new file mode 100644 index 00000000..57c0ee49 Binary files /dev/null and b/images/imgTopLeft.png differ diff --git a/images/imgTopMiddle.png b/images/imgTopMiddle.png new file mode 100644 index 00000000..9d23bef8 Binary files /dev/null and b/images/imgTopMiddle.png differ diff --git a/images/imgTopRight.png b/images/imgTopRight.png new file mode 100644 index 00000000..d20ae2a9 Binary files /dev/null and b/images/imgTopRight.png differ diff --git a/images/numPagesLabel.png b/images/numPagesLabel.png index 54ca6241..d18a10c4 100644 Binary files a/images/numPagesLabel.png and b/images/numPagesLabel.png differ