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.
17 #include <QPushButton>
18 #include <QGridLayout>
19 #include "colorbuttons.hpp"
20 #include "colorscheme.hpp"
21 #include "colorbutton.hpp"
23 ColorButtons::ColorButtons (QWidget *parent)
28 const QVector<QBrush> &scheme = ColorScheme::instance().getScheme();
29 QGridLayout *layout = new QGridLayout;
31 for (int i = 0; i < scheme.size(); i++)
33 ColorButton *button = new ColorButton(this, i);
34 layout->addWidget(button, (i - (i % 3)) / 3, i % 3);
35 group.addButton(button, i);
38 QObject::connect(&group,
39 SIGNAL(buttonClicked(int)),
43 layout->setSpacing(24);