2 Copyright 2010 Serge Ziryukin <ftrvxmtrx@gmail.com>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; version 2 of the License.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
14 #include <QPushButton>
15 #include <QVBoxLayout>
16 #include <QHBoxLayout>
19 #include "colorbuttons.hpp"
21 //#include "fullscreenexitbutton.hpp"
26 setWindowTitle("Color Flood");
28 setWindowState(windowState() | Qt::WindowFullScreen);
30 //new FullScreenExitButton(this);
33 field = new Field(this, &turns);
34 colorButtons = new ColorButtons(this);
36 QObject::connect(colorButtons,
41 turnsLabel = new QLabel(this);
43 QObject::connect(field,
44 SIGNAL(turnsChanged(int)),
46 SLOT(updateTurns(int)));
50 QVBoxLayout *vl = new QVBoxLayout;
51 vl->addWidget(turnsLabel);
52 vl->setAlignment(turnsLabel, Qt::AlignTop);
54 QHBoxLayout *hl = new QHBoxLayout;
55 hl->addWidget(colorButtons);
56 hl->setAlignment(colorButtons, Qt::AlignLeft);
58 hl->setAlignment(field, Qt::AlignRight);
64 void Window::updateTurns (int turns)
66 /*: number of turns */
67 turnsLabel->setText(tr("Turns: %1/%2")
69 .arg(field->getNumTurnsOfSize(field->getSize())));