# HG changeset patch # User Wuzzy # Date 1462555406 -7200 # Node ID b421923c2577eaebed52e7c00b41972f29fa43f6 # Parent 5f21387edff1564b486016900a1cac847aa0f1ee Neatly align all the bottom buttons on the same height diff -r 5f21387edff1 -r b421923c2577 QTfrontend/ui/page/AbstractPage.cpp --- a/QTfrontend/ui/page/AbstractPage.cpp Fri May 06 18:49:41 2016 +0200 +++ b/QTfrontend/ui/page/AbstractPage.cpp Fri May 06 19:23:26 2016 +0200 @@ -127,24 +127,24 @@ return btn; } -QPushButtonWithSound * AbstractPage::addButton(const QString & name, QGridLayout * grid, int row, int column, int rowSpan, int columnSpan, bool hasIcon) +QPushButtonWithSound * AbstractPage::addButton(const QString & name, QGridLayout * grid, int row, int column, int rowSpan, int columnSpan, bool hasIcon, Qt::Alignment alignment) { QPushButtonWithSound * btn = formattedButton(name, hasIcon); - grid->addWidget(btn, row, column, rowSpan, columnSpan); + grid->addWidget(btn, row, column, rowSpan, columnSpan, alignment); return btn; } -QPushButtonWithSound * AbstractPage::addButton(const QString & name, QBoxLayout * box, int where, bool hasIcon) +QPushButtonWithSound * AbstractPage::addButton(const QString & name, QBoxLayout * box, int where, bool hasIcon, Qt::Alignment alignment) { QPushButtonWithSound * btn = formattedButton(name, hasIcon); - box->addWidget(btn, where); + box->addWidget(btn, where, alignment); return btn; } -QPushButton* AbstractPage::addSoundlessButton(const QString & name, QBoxLayout * box, int where, bool hasIcon) +QPushButton* AbstractPage::addSoundlessButton(const QString & name, QBoxLayout * box, int where, bool hasIcon, Qt::Alignment alignment) { QPushButton* btn = formattedSoundlessButton(name, hasIcon); - box->addWidget(btn, where); + box->addWidget(btn, where, alignment); return btn; } diff -r 5f21387edff1 -r b421923c2577 QTfrontend/ui/page/AbstractPage.h --- a/QTfrontend/ui/page/AbstractPage.h Fri May 06 18:49:41 2016 +0200 +++ b/QTfrontend/ui/page/AbstractPage.h Fri May 06 19:23:26 2016 +0200 @@ -185,10 +185,11 @@ * @param rowSpan how many layout rows the button will span. * @param columnSpan how many layout columns the button will span. * @param hasIcon set to true if this is a picture button. + * @param alignment alignment of the button in the layout. * * @return the button. */ - QPushButtonWithSound * addButton(const QString & name, QGridLayout * grid, int row, int column, int rowSpan = 1, int columnSpan = 1, bool hasIcon = false); + QPushButtonWithSound * addButton(const QString & name, QGridLayout * grid, int row, int column, int rowSpan = 1, int columnSpan = 1, bool hasIcon = false, Qt::Alignment alignment = 0); /** * @brief Creates a default formatted button and adds it to a @@ -198,11 +199,12 @@ * @param box pointer of the box layout in which to insert the button. * @param where layout ndex in which to insert the button. * @param hasIcon set to true if this is a picture button. + * @param alignment alignment of the button in the layout. * * @return the button. */ - QPushButtonWithSound * addButton(const QString & name, QBoxLayout * box, int where, bool hasIcon = false); - QPushButton* addSoundlessButton(const QString & name, QBoxLayout * box, int where, bool hasIcon = false); + QPushButtonWithSound * addButton(const QString & name, QBoxLayout * box, int where, bool hasIcon = false, Qt::Alignment alignment = 0); + QPushButton* addSoundlessButton(const QString & name, QBoxLayout * box, int where, bool hasIcon = false, Qt::Alignment alignment = 0); /** * @brief Changes visibility of the back-button. diff -r 5f21387edff1 -r b421923c2577 QTfrontend/ui/page/pagemain.cpp --- a/QTfrontend/ui/page/pagemain.cpp Fri May 06 18:49:41 2016 +0200 +++ b/QTfrontend/ui/page/pagemain.cpp Fri May 06 19:23:26 2016 +0200 @@ -109,11 +109,11 @@ btnBack->setWhatsThis(tr("Exit game")); #ifdef VIDEOREC - BtnVideos = addButton(":/res/Videos.png", bottomLayout, 1, true); + BtnVideos = addButton(":/res/Videos.png", bottomLayout, 1, true, Qt::AlignBottom); BtnVideos->setWhatsThis(tr("Manage videos recorded from game")); #endif - BtnSetup = addButton(":/res/Settings.png", bottomLayout, 2, true); + BtnSetup = addButton(":/res/Settings.png", bottomLayout, 2, true, Qt::AlignBottom); BtnSetup->setWhatsThis(tr("Edit game preferences")); return bottomLayout; diff -r 5f21387edff1 -r b421923c2577 QTfrontend/ui/page/pagemultiplayer.cpp --- a/QTfrontend/ui/page/pagemultiplayer.cpp Fri May 06 18:49:41 2016 +0200 +++ b/QTfrontend/ui/page/pagemultiplayer.cpp Fri May 06 19:23:26 2016 +0200 @@ -46,7 +46,7 @@ { QHBoxLayout * bottomLeftLayout = new QHBoxLayout(); - btnSetup = addButton(":/res/Settings.png", bottomLeftLayout, 0, true); + btnSetup = addButton(":/res/Settings.png", bottomLeftLayout, 0, true, Qt::AlignBottom); btnSetup->setWhatsThis(tr("Edit game preferences")); return bottomLeftLayout; diff -r 5f21387edff1 -r b421923c2577 QTfrontend/ui/page/pagenetgame.cpp --- a/QTfrontend/ui/page/pagenetgame.cpp Fri May 06 18:49:41 2016 +0200 +++ b/QTfrontend/ui/page/pagenetgame.cpp Fri May 06 19:23:26 2016 +0200 @@ -114,7 +114,7 @@ { QHBoxLayout * bottomLeftLayout = new QHBoxLayout(); - btnSetup = addButton(":/res/Settings.png", bottomLeftLayout, 0, true); + btnSetup = addButton(":/res/Settings.png", bottomLeftLayout, 0, true, Qt::AlignBottom); btnSetup->setWhatsThis(tr("Edit game preferences")); return bottomLeftLayout;