mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
campos en di?logos correctamente alineados (QGridLayout)
This commit is contained in:
parent
6cff6162d2
commit
960cadee41
@ -3,7 +3,7 @@
|
|||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QGridLayout>
|
||||||
|
|
||||||
|
|
||||||
AddLibraryDialog::AddLibraryDialog(QWidget * parent)
|
AddLibraryDialog::AddLibraryDialog(QWidget * parent)
|
||||||
@ -32,18 +32,15 @@ void AddLibraryDialog::setupUI()
|
|||||||
find = new QPushButton(QIcon(":/images/comicFolder.png"),"");
|
find = new QPushButton(QIcon(":/images/comicFolder.png"),"");
|
||||||
connect(find,SIGNAL(clicked()),this,SLOT(findPath()));
|
connect(find,SIGNAL(clicked()),this,SLOT(findPath()));
|
||||||
|
|
||||||
QHBoxLayout *nameLayout = new QHBoxLayout;
|
QGridLayout * content = new QGridLayout;
|
||||||
|
|
||||||
nameLayout->addWidget(nameLabel);
|
content->addWidget(nameLabel,0,0);
|
||||||
nameLayout->addWidget(nameEdit);
|
content->addWidget(nameEdit,0,1);
|
||||||
|
|
||||||
QHBoxLayout *libraryLayout = new QHBoxLayout;
|
|
||||||
|
|
||||||
libraryLayout->addWidget(textLabel);
|
|
||||||
libraryLayout->addWidget(path);
|
|
||||||
libraryLayout->addWidget(find);
|
|
||||||
libraryLayout->setStretchFactor(find,0); //TODO
|
|
||||||
|
|
||||||
|
content->addWidget(textLabel,1,0);
|
||||||
|
content->addWidget(path,1,1);
|
||||||
|
content->addWidget(find,1,2);
|
||||||
|
content->setColumnStretch(2,0);
|
||||||
|
|
||||||
QHBoxLayout *bottomLayout = new QHBoxLayout;
|
QHBoxLayout *bottomLayout = new QHBoxLayout;
|
||||||
bottomLayout->addStretch();
|
bottomLayout->addStretch();
|
||||||
@ -51,8 +48,7 @@ void AddLibraryDialog::setupUI()
|
|||||||
bottomLayout->addWidget(cancel);
|
bottomLayout->addWidget(cancel);
|
||||||
|
|
||||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||||
mainLayout->addLayout(nameLayout);
|
mainLayout->addLayout(content);
|
||||||
mainLayout->addLayout(libraryLayout);
|
|
||||||
mainLayout->addStretch();
|
mainLayout->addStretch();
|
||||||
mainLayout->addLayout(bottomLayout);
|
mainLayout->addLayout(bottomLayout);
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QSizePolicy>
|
||||||
|
|
||||||
|
|
||||||
CreateLibraryDialog::CreateLibraryDialog(QWidget * parent)
|
CreateLibraryDialog::CreateLibraryDialog(QWidget * parent)
|
||||||
@ -33,17 +33,19 @@ void CreateLibraryDialog::setupUI()
|
|||||||
find = new QPushButton(QIcon(":/images/comicFolder.png"),"");
|
find = new QPushButton(QIcon(":/images/comicFolder.png"),"");
|
||||||
connect(find,SIGNAL(clicked()),this,SLOT(findPath()));
|
connect(find,SIGNAL(clicked()),this,SLOT(findPath()));
|
||||||
|
|
||||||
QHBoxLayout *nameLayout = new QHBoxLayout;
|
QGridLayout * content = new QGridLayout;
|
||||||
|
|
||||||
nameLayout->addWidget(nameLabel);
|
//QHBoxLayout *nameLayout = new QHBoxLayout;
|
||||||
nameLayout->addWidget(nameEdit);
|
|
||||||
|
|
||||||
QHBoxLayout *libraryLayout = new QHBoxLayout;
|
content->addWidget(nameLabel,0,0);
|
||||||
|
content->addWidget(nameEdit,0,1);
|
||||||
|
|
||||||
libraryLayout->addWidget(textLabel);
|
//QHBoxLayout *libraryLayout = new QHBoxLayout;
|
||||||
libraryLayout->addWidget(path);
|
|
||||||
libraryLayout->addWidget(find);
|
content->addWidget(textLabel,1,0);
|
||||||
libraryLayout->setStretchFactor(find,0); //TODO
|
content->addWidget(path,1,1);
|
||||||
|
content->addWidget(find,1,2);
|
||||||
|
content->setColumnMinimumWidth(2,0); //TODO
|
||||||
|
|
||||||
QHBoxLayout *middleLayout = new QHBoxLayout;
|
QHBoxLayout *middleLayout = new QHBoxLayout;
|
||||||
|
|
||||||
@ -54,17 +56,23 @@ void CreateLibraryDialog::setupUI()
|
|||||||
progressBar->hide();
|
progressBar->hide();
|
||||||
|
|
||||||
currentFileLabel = new QLabel("");
|
currentFileLabel = new QLabel("");
|
||||||
|
currentFileLabel->setWordWrap(true);
|
||||||
middleLayout->addWidget(currentFileLabel);
|
middleLayout->addWidget(currentFileLabel);
|
||||||
middleLayout->addStretch();
|
middleLayout->addStretch();
|
||||||
|
middleLayout->setSizeConstraint(QLayout::SetMaximumSize);
|
||||||
|
|
||||||
|
|
||||||
QHBoxLayout *bottomLayout = new QHBoxLayout;
|
QHBoxLayout *bottomLayout = new QHBoxLayout;
|
||||||
|
bottomLayout->addWidget(message = new QLabel(tr("Create a library could take several minutes. You can stop the process and update the library later for completing the task.")));
|
||||||
|
message->setWordWrap(true);
|
||||||
|
//message->hide();
|
||||||
bottomLayout->addStretch();
|
bottomLayout->addStretch();
|
||||||
bottomLayout->addWidget(accept);
|
bottomLayout->addWidget(accept);
|
||||||
bottomLayout->addWidget(cancel);
|
bottomLayout->addWidget(cancel);
|
||||||
|
|
||||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||||
mainLayout->addLayout(nameLayout);
|
mainLayout->addLayout(content);
|
||||||
mainLayout->addLayout(libraryLayout);
|
|
||||||
mainLayout->addLayout(middleLayout);
|
mainLayout->addLayout(middleLayout);
|
||||||
mainLayout->addStretch();
|
mainLayout->addStretch();
|
||||||
mainLayout->addWidget(progressBar);
|
mainLayout->addWidget(progressBar);
|
||||||
@ -86,6 +94,9 @@ void CreateLibraryDialog::setupUI()
|
|||||||
void CreateLibraryDialog::create()
|
void CreateLibraryDialog::create()
|
||||||
{
|
{
|
||||||
progressBar->show();
|
progressBar->show();
|
||||||
|
message->show();
|
||||||
|
currentFileLabel->setText("Importing : \n\n\n\n\n");
|
||||||
|
this->adjustSize();
|
||||||
accept->setEnabled(false);
|
accept->setEnabled(false);
|
||||||
emit(createLibrary(QDir::cleanPath(path->text()),QDir::cleanPath(path->text())+"/.yacreaderlibrary",nameEdit->text()));
|
emit(createLibrary(QDir::cleanPath(path->text()),QDir::cleanPath(path->text())+"/.yacreaderlibrary",nameEdit->text()));
|
||||||
}
|
}
|
||||||
@ -102,9 +113,10 @@ void CreateLibraryDialog::findPath()
|
|||||||
|
|
||||||
void CreateLibraryDialog::showCurrentFile(QString file)
|
void CreateLibraryDialog::showCurrentFile(QString file)
|
||||||
{
|
{
|
||||||
currentFileLabel->setText(file);
|
currentFileLabel->setText(tr("Importing : \n") + file);
|
||||||
currentFileLabel->update();
|
currentFileLabel->update();
|
||||||
this->update();
|
//this->adjustSize();
|
||||||
|
//is->update();
|
||||||
}
|
}
|
||||||
void CreateLibraryDialog::close()
|
void CreateLibraryDialog::close()
|
||||||
{
|
{
|
||||||
@ -112,6 +124,7 @@ void CreateLibraryDialog::close()
|
|||||||
path->clear();
|
path->clear();
|
||||||
nameEdit->clear();
|
nameEdit->clear();
|
||||||
currentFileLabel->setText("");
|
currentFileLabel->setText("");
|
||||||
|
this->adjustSize();
|
||||||
accept->setEnabled(true);
|
accept->setEnabled(true);
|
||||||
QDialog::close();
|
QDialog::close();
|
||||||
}
|
}
|
||||||
@ -123,7 +136,8 @@ UpdateLibraryDialog::UpdateLibraryDialog(QWidget * parent)
|
|||||||
{
|
{
|
||||||
QVBoxLayout * mainLayout = new QVBoxLayout;
|
QVBoxLayout * mainLayout = new QVBoxLayout;
|
||||||
mainLayout->addWidget(message = new QLabel(tr("Updating....")));
|
mainLayout->addWidget(message = new QLabel(tr("Updating....")));
|
||||||
mainLayout->addWidget(currentFileLabel = new QLabel(""));
|
mainLayout->addWidget(currentFileLabel = new QLabel("\n\n\n\n"));
|
||||||
|
currentFileLabel->setWordWrap(true);
|
||||||
|
|
||||||
QHBoxLayout * bottom = new QHBoxLayout;
|
QHBoxLayout * bottom = new QHBoxLayout;
|
||||||
bottom->addStretch();
|
bottom->addStretch();
|
||||||
@ -164,5 +178,6 @@ void UpdateLibraryDialog::showCurrentFile(QString file)
|
|||||||
void UpdateLibraryDialog::close()
|
void UpdateLibraryDialog::close()
|
||||||
{
|
{
|
||||||
currentFileLabel->setText("");
|
currentFileLabel->setText("");
|
||||||
|
this->adjustSize();
|
||||||
QDialog::close();
|
QDialog::close();
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
private:
|
private:
|
||||||
QLabel * nameLabel;
|
QLabel * nameLabel;
|
||||||
QLabel * textLabel;
|
QLabel * textLabel;
|
||||||
|
QLabel * message;
|
||||||
QProgressBar *progressBar;
|
QProgressBar *progressBar;
|
||||||
QLabel * currentFileLabel;
|
QLabel * currentFileLabel;
|
||||||
QLineEdit * path;
|
QLineEdit * path;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QGridLayout>
|
||||||
|
|
||||||
|
|
||||||
ImportLibraryDialog::ImportLibraryDialog(QWidget * parent)
|
ImportLibraryDialog::ImportLibraryDialog(QWidget * parent)
|
||||||
@ -41,25 +41,20 @@ void ImportLibraryDialog::setupUI()
|
|||||||
findDest = new QPushButton(QIcon(":/images/open.png"),"");
|
findDest = new QPushButton(QIcon(":/images/open.png"),"");
|
||||||
connect(findDest,SIGNAL(clicked()),this,SLOT(findDestination()));
|
connect(findDest,SIGNAL(clicked()),this,SLOT(findDestination()));
|
||||||
|
|
||||||
QHBoxLayout *nameLayout = new QHBoxLayout;
|
QGridLayout * content = new QGridLayout;
|
||||||
|
|
||||||
nameLayout->addWidget(nameLabel);
|
content->addWidget(nameLabel,0,0);
|
||||||
nameLayout->addWidget(nameEdit);
|
content->addWidget(nameEdit,0,1);
|
||||||
|
|
||||||
QHBoxLayout *libraryLayout = new QHBoxLayout;
|
content->addWidget(textLabel,1,0);
|
||||||
|
content->addWidget(path,1,1);
|
||||||
libraryLayout->addWidget(textLabel);
|
content->addWidget(find,1,2);
|
||||||
libraryLayout->addWidget(path);
|
content->setColumnStretch(2,0); //TODO
|
||||||
libraryLayout->addWidget(find);
|
|
||||||
libraryLayout->setStretchFactor(find,0); //TODO
|
|
||||||
|
|
||||||
QHBoxLayout *destLayout = new QHBoxLayout;
|
|
||||||
|
|
||||||
destLayout->addWidget(destLabel);
|
|
||||||
destLayout->addWidget(destPath);
|
|
||||||
destLayout->addWidget(findDest);
|
|
||||||
destLayout->setStretchFactor(findDest,0); //TODO
|
|
||||||
|
|
||||||
|
content->addWidget(destLabel,2,0);
|
||||||
|
content->addWidget(destPath,2,1);
|
||||||
|
content->addWidget(findDest,2,2);
|
||||||
|
//destLayout->setStretchFactor(findDest,0); //TODO
|
||||||
|
|
||||||
QHBoxLayout *bottomLayout = new QHBoxLayout;
|
QHBoxLayout *bottomLayout = new QHBoxLayout;
|
||||||
bottomLayout->addStretch();
|
bottomLayout->addStretch();
|
||||||
@ -73,9 +68,7 @@ void ImportLibraryDialog::setupUI()
|
|||||||
progressBar->hide();
|
progressBar->hide();
|
||||||
|
|
||||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||||
mainLayout->addLayout(nameLayout);
|
mainLayout->addLayout(content);
|
||||||
mainLayout->addLayout(libraryLayout);
|
|
||||||
mainLayout->addLayout(destLayout);
|
|
||||||
//mainLayout->addWidget(progress = new QLabel());
|
//mainLayout->addWidget(progress = new QLabel());
|
||||||
mainLayout->addStretch();
|
mainLayout->addStretch();
|
||||||
mainLayout->addWidget(progressBar);
|
mainLayout->addWidget(progressBar);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user