# HG changeset patch # User Wuzzy # Date 1462558347 -7200 # Node ID 7642955690bccd79ae3da5b6b2b706cc79a5256e # Parent b421923c2577eaebed52e7c00b41972f29fa43f6 Tweak sizes and icons of most footer buttons of frontend diff -r b421923c2577 -r 7642955690bc QTfrontend/ui/page/pagedata.cpp --- a/QTfrontend/ui/page/pagedata.cpp Fri May 06 19:23:26 2016 +0200 +++ b/QTfrontend/ui/page/pagedata.cpp Fri May 06 20:12:27 2016 +0200 @@ -54,7 +54,8 @@ QHBoxLayout * bottomLayout = new QHBoxLayout(); bottomLayout->setStretch(0, 1); - pbOpenDir = addButton(tr("Open packages directory"), bottomLayout, 1, false); + pbOpenDir = addButton(tr("Open packages directory"), bottomLayout, 1, false, Qt::AlignBottom); + pbOpenDir->setMinimumHeight(50); bottomLayout->setStretch(2, 1); diff -r b421923c2577 -r 7642955690bc QTfrontend/ui/page/pageinfo.cpp --- a/QTfrontend/ui/page/pageinfo.cpp Fri May 06 19:23:26 2016 +0200 +++ b/QTfrontend/ui/page/pageinfo.cpp Fri May 06 20:12:27 2016 +0200 @@ -40,9 +40,10 @@ QLayout * PageInfo::footerLayoutDefinition() { QHBoxLayout * bottomLayout = new QHBoxLayout(); - BtnSnapshots = addButton(":/res/Star.png", bottomLayout, 0, true); + bottomLayout->setContentsMargins(0,0,0,0); + BtnSnapshots = addButton(":/res/Star.png", bottomLayout, 0, true, Qt::AlignBottom); BtnSnapshots->setWhatsThis(tr("Open the snapshot folder")); - bottomLayout->setAlignment(BtnSnapshots, Qt::AlignRight | Qt::AlignVCenter); + BtnSnapshots->setMinimumSize(50,50); return bottomLayout; } diff -r b421923c2577 -r 7642955690bc QTfrontend/ui/page/pagemultiplayer.cpp --- a/QTfrontend/ui/page/pagemultiplayer.cpp Fri May 06 19:23:26 2016 +0200 +++ b/QTfrontend/ui/page/pagemultiplayer.cpp Fri May 06 20:12:27 2016 +0200 @@ -69,7 +69,7 @@ BtnStartMPGame->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); footerLayout->addStretch(); - footerLayout->addWidget(BtnStartMPGame); + footerLayout->addWidget(BtnStartMPGame, 0, Qt::AlignBottom); return footerLayout; } diff -r b421923c2577 -r 7642955690bc QTfrontend/ui/page/pagenet.cpp --- a/QTfrontend/ui/page/pagenet.cpp Fri May 06 19:23:26 2016 +0200 +++ b/QTfrontend/ui/page/pagenet.cpp Fri May 06 20:12:27 2016 +0200 @@ -71,7 +71,7 @@ QHBoxLayout * footerLayout = new QHBoxLayout(); BtnNetSvrStart = formattedButton(QPushButton::tr("Start server")); - BtnNetSvrStart->setMinimumWidth(180); + BtnNetSvrStart->setMinimumSize(180, 50); QString serverPath = bindir->absolutePath() + "/hedgewars-server"; #ifdef Q_OS_WIN serverPath += + ".exe"; @@ -80,7 +80,7 @@ BtnNetSvrStart->setVisible(server.exists()); footerLayout->addStretch(); - footerLayout->addWidget(BtnNetSvrStart); + footerLayout->addWidget(BtnNetSvrStart, 0, Qt::AlignBottom); return footerLayout; } diff -r b421923c2577 -r 7642955690bc QTfrontend/ui/page/pagenetgame.cpp --- a/QTfrontend/ui/page/pagenetgame.cpp Fri May 06 19:23:26 2016 +0200 +++ b/QTfrontend/ui/page/pagenetgame.cpp Fri May 06 20:12:27 2016 +0200 @@ -113,6 +113,7 @@ QLayout * PageNetGame::footerLayoutLeftDefinition() { QHBoxLayout * bottomLeftLayout = new QHBoxLayout(); + bottomLeftLayout->setContentsMargins(0,0,0,0); btnSetup = addButton(":/res/Settings.png", bottomLeftLayout, 0, true, Qt::AlignBottom); btnSetup->setWhatsThis(tr("Edit game preferences")); @@ -134,7 +135,7 @@ BtnGo->setMinimumHeight(50); bottomLayout->addStretch(); - bottomLayout->addWidget(BtnGo); + bottomLayout->addWidget(BtnGo, 0, Qt::AlignBottom); // Start button @@ -149,7 +150,7 @@ BtnStart->setIconSize(sz); BtnStart->setFlat(true); BtnStart->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - bottomLayout->addWidget(BtnStart); + bottomLayout->addWidget(BtnStart, 0, Qt::AlignBottom); return bottomLayout; } diff -r b421923c2577 -r 7642955690bc QTfrontend/ui/page/pagenetserver.cpp --- a/QTfrontend/ui/page/pagenetserver.cpp Fri May 06 19:23:26 2016 +0200 +++ b/QTfrontend/ui/page/pagenetserver.cpp Fri May 06 20:12:27 2016 +0200 @@ -98,10 +98,10 @@ BtnStart = formattedButton(QPushButton::tr("Start")); BtnStart->setWhatsThis(QPushButton::tr("Start private server")); - BtnStart->setMinimumWidth(180); + BtnStart->setMinimumSize(180, 50); bottomLayout->addStretch(); - bottomLayout->addWidget(BtnStart); + bottomLayout->addWidget(BtnStart, 0, Qt::AlignBottom); return bottomLayout; } diff -r b421923c2577 -r 7642955690bc QTfrontend/ui/page/pageplayrecord.cpp --- a/QTfrontend/ui/page/pageplayrecord.cpp Fri May 06 19:23:26 2016 +0200 +++ b/QTfrontend/ui/page/pageplayrecord.cpp Fri May 06 20:12:27 2016 +0200 @@ -40,11 +40,6 @@ pageLayout->setColumnStretch(2, 1); pageLayout->setRowStretch(2, 100); - BtnPlayDemo = new QPushButton(this); - BtnPlayDemo->setFont(*font14); - BtnPlayDemo->setText(QPushButton::tr("Play demo")); - pageLayout->addWidget(BtnPlayDemo, 3, 2); - BtnRenameRecord = new QPushButton(this); BtnRenameRecord->setText(QPushButton::tr("Rename")); pageLayout->addWidget(BtnRenameRecord, 0, 2); @@ -60,6 +55,23 @@ return pageLayout; } +QLayout * PagePlayDemo::footerLayoutDefinition() +{ + QHBoxLayout * bottomLayout = new QHBoxLayout(); + + BtnPlayDemo = addButton(tr("Play demo"), bottomLayout, 0, false, Qt::AlignBottom); + const QIcon& lp = QIcon(":/res/Start.png"); + QSize sz = lp.actualSize(QSize(65535, 65535)); + BtnPlayDemo->setMinimumWidth(sz.width()); + BtnPlayDemo->setIcon(lp); + BtnPlayDemo->setFixedHeight(50); + BtnPlayDemo->setIconSize(sz); + BtnPlayDemo->setFlat(true); + BtnPlayDemo->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + + return bottomLayout; +} + void PagePlayDemo::connectSignals() { connect(BtnRenameRecord, SIGNAL(clicked()), this, SLOT(renameRecord())); @@ -85,12 +97,14 @@ dir.cd("Demos"); extension = "hwd"; BtnPlayDemo->setText(QPushButton::tr("Play demo")); + BtnPlayDemo->setWhatsThis(tr("Play the selected demo")); } else { dir.cd("Saves"); extension = "hws"; BtnPlayDemo->setText(QPushButton::tr("Load")); + BtnPlayDemo->setWhatsThis(tr("Load the selected game")); } dir.setFilter(QDir::Files); diff -r b421923c2577 -r 7642955690bc QTfrontend/ui/page/pageplayrecord.h --- a/QTfrontend/ui/page/pageplayrecord.h Fri May 06 19:23:26 2016 +0200 +++ b/QTfrontend/ui/page/pageplayrecord.h Fri May 06 20:12:27 2016 +0200 @@ -52,6 +52,7 @@ private: QLayout * bodyLayoutDefinition(); + QLayout * footerLayoutDefinition(); void connectSignals(); RecordType recType; diff -r b421923c2577 -r 7642955690bc QTfrontend/ui/page/pageroomslist.cpp --- a/QTfrontend/ui/page/pageroomslist.cpp Fri May 06 19:23:26 2016 +0200 +++ b/QTfrontend/ui/page/pageroomslist.cpp Fri May 06 20:12:27 2016 +0200 @@ -174,8 +174,8 @@ { QHBoxLayout * bottomLayout = new QHBoxLayout(); - BtnAdmin = addButton(tr("Admin features"), bottomLayout, 0); - BtnAdmin->setStyleSheet("padding: 4px auto;"); + BtnAdmin = addButton(tr("Admin features"), bottomLayout, 0, false, Qt::AlignBottom); + BtnAdmin->setMinimumSize(180, 50); BtnAdmin->setWhatsThis(tr("Open server administration page")); return bottomLayout;