UI dialog tweaks: filter + create game(s) (#3351)
* vbox --> grid layout
This commit is contained in:
parent
69c103ede3
commit
451e1874a7
4 changed files with 22 additions and 15 deletions
|
@ -37,7 +37,8 @@ void DlgCreateGame::sharedCtor()
|
|||
generalGrid->addWidget(descriptionEdit, 0, 1);
|
||||
generalGrid->addWidget(maxPlayersLabel, 1, 0);
|
||||
generalGrid->addWidget(maxPlayersEdit, 1, 1);
|
||||
generalGrid->addWidget(rememberGameSettings, 2, 0);
|
||||
generalGroupBox = new QGroupBox(tr("General"));
|
||||
generalGroupBox->setLayout(generalGrid);
|
||||
|
||||
QVBoxLayout *gameTypeLayout = new QVBoxLayout;
|
||||
QMapIterator<int, QString> gameTypeIterator(gameTypes);
|
||||
|
@ -89,10 +90,11 @@ void DlgCreateGame::sharedCtor()
|
|||
spectatorsGroupBox->setLayout(spectatorsLayout);
|
||||
|
||||
QGridLayout *grid = new QGridLayout;
|
||||
grid->addLayout(generalGrid, 0, 0);
|
||||
grid->addWidget(spectatorsGroupBox, 1, 0);
|
||||
grid->addWidget(generalGroupBox, 0, 0);
|
||||
grid->addWidget(joinRestrictionsGroupBox, 0, 1);
|
||||
grid->addWidget(gameTypeGroupBox, 1, 1);
|
||||
grid->addWidget(gameTypeGroupBox, 1, 0);
|
||||
grid->addWidget(spectatorsGroupBox, 1, 1);
|
||||
grid->addWidget(rememberGameSettings, 2, 0);
|
||||
|
||||
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
|
||||
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
|
|
|
@ -4,18 +4,17 @@
|
|||
#include <QDialog>
|
||||
#include <QMap>
|
||||
|
||||
class QCheckBox;
|
||||
class QDialogButtonBox;
|
||||
class QGroupBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QCheckBox;
|
||||
class QRadioButton;
|
||||
class QGroupBox;
|
||||
class QSpinBox;
|
||||
class QDialogButtonBox;
|
||||
class TabRoom;
|
||||
|
||||
class Response;
|
||||
class ServerInfo_Game;
|
||||
class TabRoom;
|
||||
|
||||
class DlgCreateGame : public QDialog
|
||||
{
|
||||
|
@ -34,7 +33,7 @@ private:
|
|||
QMap<int, QString> gameTypes;
|
||||
QMap<int, QRadioButton *> gameTypeCheckBoxes;
|
||||
|
||||
QGroupBox *spectatorsGroupBox;
|
||||
QGroupBox *generalGroupBox, *spectatorsGroupBox;
|
||||
QLabel *descriptionLabel, *passwordLabel, *maxPlayersLabel;
|
||||
QLineEdit *descriptionEdit, *passwordEdit;
|
||||
QSpinBox *maxPlayersEdit;
|
||||
|
|
|
@ -29,12 +29,19 @@ DlgFilterGames::DlgFilterGames(const QMap<int, QString> &_allGameTypes,
|
|||
gameNameFilterEdit->setText(gamesProxyModel->getGameNameFilter());
|
||||
QLabel *gameNameFilterLabel = new QLabel(tr("Game &description:"));
|
||||
gameNameFilterLabel->setBuddy(gameNameFilterEdit);
|
||||
|
||||
creatorNameFilterEdit = new QLineEdit;
|
||||
creatorNameFilterEdit->setText(gamesProxyModel->getCreatorNameFilter());
|
||||
QLabel *creatorNameFilterLabel = new QLabel(tr("&Creator name:"));
|
||||
creatorNameFilterLabel->setBuddy(creatorNameFilterEdit);
|
||||
|
||||
QGridLayout *generalGrid = new QGridLayout;
|
||||
generalGrid->addWidget(gameNameFilterLabel, 0, 0);
|
||||
generalGrid->addWidget(gameNameFilterEdit, 0, 1);
|
||||
generalGrid->addWidget(creatorNameFilterLabel, 1, 0);
|
||||
generalGrid->addWidget(creatorNameFilterEdit, 1, 1);
|
||||
generalGroupBox = new QGroupBox(tr("General"));
|
||||
generalGroupBox->setLayout(generalGrid);
|
||||
|
||||
QVBoxLayout *gameTypeFilterLayout = new QVBoxLayout;
|
||||
QMapIterator<int, QString> gameTypesIterator(allGameTypes);
|
||||
while (gameTypesIterator.hasNext()) {
|
||||
|
@ -85,10 +92,7 @@ DlgFilterGames::DlgFilterGames(const QMap<int, QString> &_allGameTypes,
|
|||
restrictionsGroupBox->setLayout(restrictionsLayout);
|
||||
|
||||
QGridLayout *leftGrid = new QGridLayout;
|
||||
leftGrid->addWidget(gameNameFilterLabel, 0, 0);
|
||||
leftGrid->addWidget(gameNameFilterEdit, 0, 1);
|
||||
leftGrid->addWidget(creatorNameFilterLabel, 1, 0);
|
||||
leftGrid->addWidget(creatorNameFilterEdit, 1, 1);
|
||||
leftGrid->addWidget(generalGroupBox, 0, 0, 1, 2);
|
||||
leftGrid->addWidget(maxPlayersGroupBox, 2, 0, 1, 2);
|
||||
leftGrid->addWidget(restrictionsGroupBox, 3, 0, 1, 2);
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <QSet>
|
||||
|
||||
class QCheckBox;
|
||||
class QGroupBox;
|
||||
class QLineEdit;
|
||||
class QSpinBox;
|
||||
|
||||
|
@ -15,6 +16,7 @@ class DlgFilterGames : public QDialog
|
|||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
QGroupBox *generalGroupBox;
|
||||
QCheckBox *showBuddiesOnlyGames;
|
||||
QCheckBox *unavailableGamesVisibleCheckBox;
|
||||
QCheckBox *showPasswordProtectedGames;
|
||||
|
|
Loading…
Reference in a new issue