mirror of
https://github.com/YACReader/yacreader
synced 2025-07-21 06:24:39 -04:00
a?adido widget de presentaci?n cuando el usuario no tiene ninguna biblioteca
This commit is contained in:
57
YACReaderLibrary/no_libraries_widget.cpp
Normal file
57
YACReaderLibrary/no_libraries_widget.cpp
Normal file
@ -0,0 +1,57 @@
|
||||
#include "no_libraries_widget.h"
|
||||
#include <QLabel>
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QPushButton>
|
||||
|
||||
NoLibrariesWidget::NoLibrariesWidget(QWidget *parent) :
|
||||
QWidget(parent)
|
||||
{
|
||||
setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
|
||||
|
||||
setStyleSheet("{color:FFFFFF;}");
|
||||
|
||||
QPixmap icon(":/images/noLibrariesIcon.png");
|
||||
QLabel * iconLabel = new QLabel();
|
||||
iconLabel->setPixmap(icon);
|
||||
|
||||
QPixmap line(":/images/noLibrariesLine.png");
|
||||
QLabel * lineLabel = new QLabel();
|
||||
lineLabel->setPixmap(line);
|
||||
|
||||
QLabel * text = new QLabel(tr("<font color=\"#565959\">You don't have any library yet</font>"));
|
||||
text->setStyleSheet("QLabel {font-size:25px;font-weight:bold;}");
|
||||
|
||||
QPushButton * createButton = new QPushButton(tr("create your first library"));
|
||||
createButton->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
QPushButton * addButton = new QPushButton(tr("add an existing one"));
|
||||
addButton->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
|
||||
QVBoxLayout * layout = new QVBoxLayout(this);
|
||||
QHBoxLayout * buttonLayout = new QHBoxLayout();
|
||||
|
||||
layout->setAlignment(Qt::AlignHCenter);
|
||||
|
||||
buttonLayout->addSpacing(100);
|
||||
buttonLayout->addWidget(createButton);
|
||||
layout->addSpacing(25);
|
||||
buttonLayout->addWidget(addButton);
|
||||
buttonLayout->addSpacing(100);
|
||||
|
||||
layout->addStretch();
|
||||
layout->addWidget(iconLabel,0,Qt::AlignHCenter);
|
||||
layout->addSpacing(10);
|
||||
layout->addWidget(text,0,Qt::AlignHCenter);
|
||||
layout->addSpacing(8);
|
||||
layout->addWidget(lineLabel,0,Qt::AlignHCenter);
|
||||
layout->addSpacing(12);
|
||||
layout->addLayout(buttonLayout,0);
|
||||
layout->addSpacing(150);
|
||||
layout->addStretch();
|
||||
|
||||
connect(createButton,SIGNAL(clicked()),this,SIGNAL(createNewLibrary()));
|
||||
connect(addButton,SIGNAL(clicked()),this,SIGNAL(addExistingLibrary()));
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user