mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
simplificado el di?logo de bookmarks
This commit is contained in:
parent
5e1e7c3393
commit
e10ba003e4
@ -10,12 +10,12 @@
|
|||||||
#include "bookmarks.h"
|
#include "bookmarks.h"
|
||||||
|
|
||||||
BookmarksDialog::BookmarksDialog(QWidget * parent)
|
BookmarksDialog::BookmarksDialog(QWidget * parent)
|
||||||
:QDialog(parent,Qt::FramelessWindowHint)
|
:QDialog(parent)
|
||||||
{
|
{
|
||||||
setModal(true);
|
setModal(true);
|
||||||
|
|
||||||
animation = new QPropertyAnimation(this,"windowOpacity");
|
//animation = new QPropertyAnimation(this,"windowOpacity");
|
||||||
animation->setDuration(150);
|
//animation->setDuration(150);
|
||||||
|
|
||||||
QHBoxLayout * layout = new QHBoxLayout();
|
QHBoxLayout * layout = new QHBoxLayout();
|
||||||
|
|
||||||
@ -26,6 +26,13 @@ BookmarksDialog::BookmarksDialog(QWidget * parent)
|
|||||||
for(int i=0;i<3;i++)
|
for(int i=0;i<3;i++)
|
||||||
pages.push_back(new QLabel("-"));
|
pages.push_back(new QLabel("-"));
|
||||||
|
|
||||||
|
QString labelsStyle = "QLabel {color:white;}";
|
||||||
|
|
||||||
|
foreach(QLabel * label,pages)
|
||||||
|
{
|
||||||
|
label->setStyleSheet(labelsStyle);
|
||||||
|
}
|
||||||
|
|
||||||
int heightDesktopResolution = QApplication::desktop()->screenGeometry().height();
|
int heightDesktopResolution = QApplication::desktop()->screenGeometry().height();
|
||||||
int height,width;
|
int height,width;
|
||||||
height = heightDesktopResolution*0.50;
|
height = heightDesktopResolution*0.50;
|
||||||
@ -64,19 +71,25 @@ BookmarksDialog::BookmarksDialog(QWidget * parent)
|
|||||||
QHBoxLayout * buttons = new QHBoxLayout();
|
QHBoxLayout * buttons = new QHBoxLayout();
|
||||||
|
|
||||||
cancel = new QPushButton(tr("Close"));
|
cancel = new QPushButton(tr("Close"));
|
||||||
cancel->setFlat(true);
|
//cancel->setFlat(true);
|
||||||
connect(cancel,SIGNAL(clicked()),this,SLOT(hide()));
|
connect(cancel,SIGNAL(clicked()),this,SLOT(hide()));
|
||||||
buttons->addStretch();
|
buttons->addStretch();
|
||||||
buttons->addWidget(cancel);
|
buttons->addWidget(cancel);
|
||||||
|
|
||||||
|
cancel->setStyleSheet("QPushButton {color:white; border:1px solid #BBBBBB; padding:3px 5px 3px 5px;}");
|
||||||
|
|
||||||
QVBoxLayout * l = new QVBoxLayout();
|
QVBoxLayout * l = new QVBoxLayout();
|
||||||
|
|
||||||
l->addWidget(new QLabel(tr("Click on any image to go to the bookmark")),0,Qt::AlignCenter);
|
l->addWidget(new QLabel("<font color=\"#FFFFFF\">"+tr("Click on any image to go to the bookmark")+"</font>"),0,Qt::AlignCenter);
|
||||||
l->addLayout(layout);
|
l->addLayout(layout);
|
||||||
l->addLayout(buttons);
|
//l->addLayout(buttons);
|
||||||
|
|
||||||
|
QPalette Pal(palette());
|
||||||
|
// set black background
|
||||||
|
Pal.setColor(QPalette::Background, QColor("#454545"));
|
||||||
|
this->setAutoFillBackground(true);
|
||||||
|
this->setPalette(Pal);
|
||||||
|
|
||||||
this->setPalette(QPalette(QColor(25,25,25)));
|
|
||||||
//this->setAutoFillBackground(true);
|
|
||||||
setLayout(l);
|
setLayout(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,7 +176,7 @@ void BookmarksDialog::keyPressEvent(QKeyEvent * event)
|
|||||||
if(event->key() == Qt::Key_M)
|
if(event->key() == Qt::Key_M)
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
void BookmarksDialog::show()
|
void BookmarksDialog::show()
|
||||||
{
|
{
|
||||||
QDialog::show();
|
QDialog::show();
|
||||||
@ -179,4 +192,4 @@ void BookmarksDialog::hide()
|
|||||||
animation->setStartValue(1);
|
animation->setStartValue(1);
|
||||||
animation->setEndValue(0);
|
animation->setEndValue(0);
|
||||||
animation->start();
|
animation->start();
|
||||||
}
|
}*/
|
||||||
|
@ -28,15 +28,15 @@
|
|||||||
|
|
||||||
bool eventFilter(QObject *obj, QEvent *event);
|
bool eventFilter(QObject *obj, QEvent *event);
|
||||||
void keyPressEvent(QKeyEvent * event);
|
void keyPressEvent(QKeyEvent * event);
|
||||||
QPropertyAnimation * animation;
|
//QPropertyAnimation * animation;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BookmarksDialog(QWidget * parent = 0);
|
BookmarksDialog(QWidget * parent = 0);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setBookmarks(const Bookmarks & bookmarks);
|
void setBookmarks(const Bookmarks & bookmarks);
|
||||||
void show();
|
//void show();
|
||||||
void hide();
|
//void hide();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void goToPage(unsigned int page);
|
void goToPage(unsigned int page);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user