svn path=/trunk/kdebase/kwin/; revision=155140
This commit is contained in:
Ryan Cumming 2002-05-12 18:05:56 +00:00
parent cd52271a10
commit 3e89b66d03
2 changed files with 13 additions and 25 deletions

View file

@ -12,9 +12,7 @@
#include <kglobal.h>
#include <qwhatsthis.h>
#include <klocale.h>
#include <qlayout.h>
#include <qpixmap.h>
#include <kdialog.h>
extern "C"
{
@ -35,55 +33,43 @@ KDEDefaultConfig::KDEDefaultConfig( KConfig* conf, QWidget* parent )
{
KGlobal::locale()->insertCatalogue("kwin_default_config");
highcolor = QPixmap::defaultDepth() > 8;
gb = new QGroupBox( 1, Qt::Horizontal,
i18n("Decoration Settings"), parent );
dummyWidget = new QWidget( parent );
QVBoxLayout *layout = new QVBoxLayout( dummyWidget );
layout->setSpacing(KDialog::spacingHint());
cbShowStipple = new QCheckBox( i18n("Draw titlebar &stipple effect"), dummyWidget );
cbShowStipple = new QCheckBox( i18n("Draw titlebar &stipple effect"), gb );
QWhatsThis::add( cbShowStipple,
i18n("When selected, active titlebars are drawn "
"with a stipple (dotted) effect. Otherwise, they are "
"drawn without the stipple."));
layout->addWidget( cbShowStipple );
cbShowGrabBar = new QCheckBox( i18n("Draw g&rab bar below windows"), dummyWidget );
cbShowGrabBar = new QCheckBox( i18n("Draw g&rab bar below windows"), gb );
QWhatsThis::add( cbShowGrabBar,
i18n("When selected, decorations are drawn with a \"grab bar\" "
"below windows. Otherwise, no grab bar is drawn."));
layout->addWidget( cbShowGrabBar );
// Only show the gradient checkbox for highcolor displays
if (highcolor)
{
cbUseGradients = new QCheckBox( i18n("Draw gr&adients"), dummyWidget );
cbUseGradients = new QCheckBox( i18n("Draw gr&adients"), gb );
QWhatsThis::add( cbUseGradients,
i18n("When selected, decorations are drawn with gradients "
"for highcolor displays, otherwise no gradients are drawn.") );
layout->addWidget(cbUseGradients);
}
else
{
cbUseGradients = 0L;
}
// Allow titlebar height customization
gbSlider = new QGroupBox( 1, Qt::Horizontal, i18n("TitleBar Height"), dummyWidget );
gbSlider = new QGroupBox( 1, Qt::Horizontal, i18n("TitleBar Height"), gb );
titleBarSizeSlider = new QSlider(0, 2, 1, 0, QSlider::Horizontal, gbSlider);
QWhatsThis::add( titleBarSizeSlider,
i18n("By adjusting this slider, you can modify "
"the height of the titlebar to make room for larger fonts."));
hbox = new QHBox(gbSlider);
hbox->setSpacing(KDialog::spacingHint());
hbox->setSpacing(6);
label1 = new QLabel( i18n("Normal"), hbox );
label2 = new QLabel( i18n("Large"), hbox );
label2->setAlignment( AlignHCenter );
label3 = new QLabel( i18n("Huge"), hbox );
label3->setAlignment( AlignRight );
layout->addWidget(gbSlider);
layout->addStretch();
// Load configuration options
load( conf );
@ -98,12 +84,15 @@ KDEDefaultConfig::KDEDefaultConfig( KConfig* conf, QWidget* parent )
if (highcolor)
connect( cbUseGradients, SIGNAL(clicked()),
this, SLOT(slotSelectionChanged()) );
// Make the widgets visible in kwindecoration
gb->show();
}
KDEDefaultConfig::~KDEDefaultConfig()
{
delete dummyWidget;
delete gb;
}

View file

@ -40,12 +40,11 @@ class KDEDefaultConfig: public QObject
void slotSelectionChanged(int); // Internal use
private:
QWidget *dummyWidget;
QCheckBox* cbShowStipple;
QCheckBox* cbShowGrabBar;
QCheckBox* cbUseGradients;
QSlider* titleBarSizeSlider;
QGroupBox* gb;
bool highcolor;
QLabel* label1;
QLabel* label2;