From c90c389a8a8d9d8661e9772ec4144c5cf2039f23 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- libksirtet/base/settings.cpp | 84 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 libksirtet/base/settings.cpp (limited to 'libksirtet/base/settings.cpp') diff --git a/libksirtet/base/settings.cpp b/libksirtet/base/settings.cpp new file mode 100644 index 00000000..1ea3b16a --- /dev/null +++ b/libksirtet/base/settings.cpp @@ -0,0 +1,84 @@ +#include "settings.h" +#include "settings.moc" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "piece.h" +#include "factory.h" + + +//----------------------------------------------------------------------------- +BaseAppearanceConfig::BaseAppearanceConfig() + : QWidget(0, "appearance_config") +{ + QVBoxLayout *top = new QVBoxLayout(this); + + // upper part + _main = new QWidget(this); + top->addWidget(_main); + _grid = new QGridLayout(_main, 3, 2, 0, KDialog::spacingHint()); + _grid->setColStretch(1, 1); + + QCheckBox *chb = + new QCheckBox(i18n("Enable animations"), _main, "kcfg_AnimationsEnabled"); + _grid->addMultiCellWidget(chb, 2, 2, 0, 1); + + top->addSpacing(KDialog::spacingHint()); + + // lower part + QHGroupBox *gbox = new QHGroupBox(i18n("Background"), this); + top->addWidget(gbox); + QWidget *widget = new QWidget(gbox); + QGridLayout *grid = + new QGridLayout(widget, 2, 3, 0, KDialog::spacingHint()); + grid->setColStretch(2, 1); + QLabel *label = new QLabel(i18n("Color:"), widget); + grid->addWidget(label, 0, 0); + KColorButton *cob = new KColorButton(widget, "kcfg_FadeColor"); + cob->setFixedWidth(100); + grid->addWidget(cob, 0, 1); + label = new QLabel(i18n("Opacity:"), widget); + grid->addWidget(label, 1, 0); + KDoubleNumInput *dn = new KDoubleNumInput(widget, "kcfg_FadeIntensity"); + dn->setRange(0.0, 1.0, 0.01); + grid->addMultiCellWidget(dn, 1, 1, 1, 2); + + top->addStretch(1); +} + +//----------------------------------------------------------------------------- +ColorConfig::ColorConfig() + : QWidget(0, "color_config") +{ + const GPieceInfo &info = Piece::info(); + QVBoxLayout *top = new QVBoxLayout(this); + uint nb = info.nbColors(); + QGridLayout *grid = new QGridLayout(top, nb+1, 3, KDialog::spacingHint()); + grid->setColStretch(2, 1); + for (uint i=0; iaddWidget(label, i, 0); + KColorButton *cob = new KColorButton(this, colorKey(i)); + cob->setFixedWidth(100); + grid->addWidget(cob, i, 1); + } + grid->setRowStretch(nb, 1); +} + +QCString ColorConfig::colorKey(uint i) +{ + QCString s; + s.setNum(i); + return "kcfg_Color" + s; +} + -- cgit v1.2.1