Changeset View
Changeset View
Standalone View
Standalone View
kcmkgamma/kgamma.cpp
Show All 28 Lines | |||||
29 | //Added by qt3to4: | 29 | //Added by qt3to4: | ||
30 | #include <QTextStream> | 30 | #include <QTextStream> | ||
31 | #include <QGridLayout> | 31 | #include <QGridLayout> | ||
32 | #include <QFrame> | 32 | #include <QFrame> | ||
33 | #include <QHBoxLayout> | 33 | #include <QHBoxLayout> | ||
34 | #include <QBoxLayout> | 34 | #include <QBoxLayout> | ||
35 | #include <QList> | 35 | #include <QList> | ||
36 | #include <QVBoxLayout> | 36 | #include <QVBoxLayout> | ||
37 | #include <QFormLayout> | ||||
37 | #include <QProcess> | 38 | #include <QProcess> | ||
38 | 39 | | |||
39 | #include <kconfig.h> | 40 | #include <kconfig.h> | ||
40 | #include <KConfigGroup> | 41 | #include <KConfigGroup> | ||
41 | #include <KLocalizedString> | 42 | #include <KLocalizedString> | ||
42 | #include <KPluginFactory> | 43 | #include <KPluginFactory> | ||
43 | #include <QHBoxLayout> | 44 | #include <QHBoxLayout> | ||
44 | #include <QStandardPaths> | 45 | #include <QStandardPaths> | ||
▲ Show 20 Lines • Show All 148 Lines • ▼ Show 20 Line(s) | 176 | pic2->setAlignment(Qt::AlignCenter); | |||
193 | QLabel *pic6 = new QLabel(stack); | 194 | QLabel *pic6 = new QLabel(stack); | ||
194 | pic6->setPixmap(QPixmap(QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kgamma/pics/lightgrey.png"))); | 195 | pic6->setPixmap(QPixmap(QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kgamma/pics/lightgrey.png"))); | ||
195 | pic6->setAlignment(Qt::AlignCenter); | 196 | pic6->setAlignment(Qt::AlignCenter); | ||
196 | stack->insertWidget( 5,pic6 ); | 197 | stack->insertWidget( 5,pic6 ); | ||
197 | 198 | | |||
198 | topLayout->addWidget(stack, 10); | 199 | topLayout->addWidget(stack, 10); | ||
199 | 200 | | |||
200 | //Sliders for gamma correction | 201 | //Sliders for gamma correction | ||
201 | QFrame *frame1 = new QFrame(this); | | |||
202 | frame1->setFrameStyle( /*QFrame::GroupBoxPanel |*/ QFrame::Plain ); | | |||
203 | | ||||
204 | QFrame *frame2 = new QFrame(this); | | |||
205 | frame2->setFrameStyle( /*QFrame::GroupBoxPanel |*/ QFrame::Plain ); | | |||
206 | 202 | | |||
207 | QLabel *gammalabel = new QLabel(this); | 203 | QLabel *gammalabel = new QLabel(this); | ||
208 | gammalabel->setText(i18n("Gamma:")); | 204 | gammalabel->setText(i18n("Gamma:")); | ||
209 | 205 | | |||
210 | QLabel *redlabel = new QLabel(this); | 206 | QLabel *redlabel = new QLabel(this); | ||
211 | redlabel->setText(i18n("Red:")); | 207 | redlabel->setText(i18n("Red:")); | ||
212 | 208 | | |||
213 | QLabel *greenlabel = new QLabel(this); | 209 | QLabel *greenlabel = new QLabel(this); | ||
Show All 23 Lines | |||||
237 | 233 | | |||
238 | bgctrl = new GammaCtrl(this, xv, XVidExtWrap::Blue); | 234 | bgctrl = new GammaCtrl(this, xv, XVidExtWrap::Blue); | ||
239 | connect(bgctrl, SIGNAL(gammaChanged(int)), SLOT(Changed())); | 235 | connect(bgctrl, SIGNAL(gammaChanged(int)), SLOT(Changed())); | ||
240 | connect(bgctrl, SIGNAL(gammaChanged(int)), SLOT(SyncScreens())); | 236 | connect(bgctrl, SIGNAL(gammaChanged(int)), SLOT(SyncScreens())); | ||
241 | connect(gctrl, SIGNAL(gammaChanged(int)), bgctrl, SLOT(setCtrl(int))); | 237 | connect(gctrl, SIGNAL(gammaChanged(int)), bgctrl, SLOT(setCtrl(int))); | ||
242 | connect(bgctrl, SIGNAL(gammaChanged(int)), gctrl, SLOT(suspend())); | 238 | connect(bgctrl, SIGNAL(gammaChanged(int)), gctrl, SLOT(suspend())); | ||
243 | bluelabel->setBuddy( bgctrl ); | 239 | bluelabel->setBuddy( bgctrl ); | ||
244 | 240 | | |||
245 | QGridLayout *grid = new QGridLayout(); | 241 | QFormLayout *form = new QFormLayout; | ||
246 | grid->setSpacing(8); | 242 | form->addRow(gammalabel, gctrl); | ||
247 | grid->addWidget(frame1, 0, 0, 2, 3); | 243 | form->addItem(new QSpacerItem(0, gammalabel->sizeHint().height() / 3)); | ||
davidedmundson: look at addItem()
you can add a proper spacer that way. | |||||
248 | grid->addWidget(frame2, 4, 0, 8, 3); | 244 | form->addRow(redlabel, rgctrl); | ||
249 | grid->addWidget(gammalabel, 1, 1, Qt::AlignRight); | 245 | form->addRow(greenlabel, ggctrl); | ||
250 | grid->addWidget(redlabel, 5, 1, Qt::AlignRight); | 246 | form->addRow(bluelabel, bgctrl); | ||
251 | grid->addWidget(greenlabel, 6, 1, Qt::AlignRight); | | |||
252 | grid->addWidget(bluelabel, 7, 1, Qt::AlignRight); | | |||
253 | grid->addWidget(gctrl, 1, 2); | | |||
254 | grid->addWidget(rgctrl, 5, 2); | | |||
255 | grid->addWidget(ggctrl, 6, 2); | | |||
256 | grid->addWidget(bgctrl, 7, 2); | | |||
257 | 247 | | |||
258 | topLayout->addLayout(grid); | 248 | topLayout->addLayout(form); | ||
259 | 249 | | |||
260 | //Options | 250 | //Options | ||
261 | QWidget *options = new QWidget(this); | 251 | QWidget *options = new QWidget(this); | ||
262 | QHBoxLayout *optionsHBoxLayout = new QHBoxLayout(options); | 252 | QHBoxLayout *optionsHBoxLayout = new QHBoxLayout(options); | ||
263 | optionsHBoxLayout->setMargin(0); | 253 | optionsHBoxLayout->setMargin(0); | ||
264 | 254 | | |||
265 | xf86cfgbox = new QCheckBox( i18n("Save settings system wide"), options ); | 255 | xf86cfgbox = new QCheckBox( i18n("Save settings system wide"), options ); | ||
266 | optionsHBoxLayout->addWidget(xf86cfgbox); | 256 | optionsHBoxLayout->addWidget(xf86cfgbox); | ||
▲ Show 20 Lines • Show All 379 Lines • Show Last 20 Lines |
look at addItem()
you can add a proper spacer that way.