summaryrefslogtreecommitdiff
path: root/noncore/styles/liquid/liquidset.cpp
Side-by-side diff
Diffstat (limited to 'noncore/styles/liquid/liquidset.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/styles/liquid/liquidset.cpp58
1 files changed, 26 insertions, 32 deletions
diff --git a/noncore/styles/liquid/liquidset.cpp b/noncore/styles/liquid/liquidset.cpp
index 5ae19ba..1b9526f 100644
--- a/noncore/styles/liquid/liquidset.cpp
+++ b/noncore/styles/liquid/liquidset.cpp
@@ -25,13 +25,13 @@
#include <qpe/qpeapplication.h>
#include <qpe/global.h>
#include <qslider.h>
#include <qtoolbutton.h>
-#include <qbuttongroup.h>
+#include <qcombobox.h>
#include <qradiobutton.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qpalette.h>
@@ -69,48 +69,29 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl )
m_menucol = QColor ( config. readEntry ( "Color", QApplication::palette ( ). active ( ). button ( ). name ( )));
m_textcol = QColor ( config. readEntry ( "TextColor", QApplication::palette ( ). active ( ). text ( ). name ( )));
int opacity = config. readNumEntry ( "Opacity", 10 );
m_shadow = config. readBoolEntry ( "ShadowText", true );
m_deco = config. readBoolEntry ( "WinDecoration", true );
int contrast = config. readNumEntry ( "StippleContrast", 5 );
+ m_flat = config. readBoolEntry ( "FlatToolButtons", false );
QVBoxLayout *vbox = new QVBoxLayout ( this );
vbox-> setSpacing ( 3 );
- vbox-> setMargin ( 6 );
+ vbox-> setMargin ( 4 );
- QButtonGroup *btngrp = new QButtonGroup ( this );
- btngrp-> hide ( );
+ QComboBox *cb = new QComboBox ( this );
+ cb-> insertItem ( tr( "No translucency" ), None );
+ cb-> insertItem ( tr( "Stippled, background color" ), StippledBg );
+ cb-> insertItem ( tr( "Stippled, button color" ), StippledBtn );
+ cb-> insertItem ( tr( "Translucent stippled, background color" ), TransStippleBg );
+ cb-> insertItem ( tr( "Translucent stippled, button color" ), TransStippleBtn );
+ cb-> insertItem ( tr( "Custom translucency" ), Custom );
- QRadioButton *rad;
+ cb-> setCurrentItem ( m_type );
+ vbox-> addWidget ( cb );
- rad = new QRadioButton ( tr( "No translucency" ), this );
- btngrp-> insert ( rad, None );
- vbox-> addWidget ( rad );
-
- rad = new QRadioButton ( tr( "Stippled, background color" ), this );
- btngrp-> insert ( rad, StippledBg );
- vbox-> addWidget ( rad );
-
- rad = new QRadioButton ( tr( "Stippled, button color" ), this );
- btngrp-> insert ( rad, StippledBtn );
- vbox-> addWidget ( rad );
-
- rad = new QRadioButton ( tr( "Translucent stippled, background color" ), this );
- btngrp-> insert ( rad, TransStippleBg );
- vbox-> addWidget ( rad );
-
- rad = new QRadioButton ( tr( "Translucent stippled, button color" ), this );
- btngrp-> insert ( rad, TransStippleBtn );
- vbox-> addWidget ( rad );
-
- rad = new QRadioButton ( tr( "Custom translucency" ), this );
- btngrp-> insert ( rad, Custom );
- vbox-> addWidget ( rad );
-
- btngrp-> setExclusive ( true );
- btngrp-> setButton ( m_type );
QGridLayout *grid = new QGridLayout ( vbox );
grid-> addColSpacing ( 0, 16 );
grid-> addColSpacing ( 3, 8 );
grid-> addWidget ( m_menulbl = new QLabel ( tr( "Menu color" ), this ), 0, 1 );
@@ -154,12 +135,18 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl )
QCheckBox *windeco = new QCheckBox ( tr( "Draw liquid window title bars" ), this );
windeco-> setChecked ( m_deco );
vbox-> addWidget ( windeco );
vbox-> addSpacing ( 4 );
+ QCheckBox *flattb = new QCheckBox ( tr( "Make toolbar buttons appear flat" ), this );
+ flattb-> setChecked ( m_flat );
+ vbox-> addWidget ( flattb );
+
+ vbox-> addSpacing ( 4 );
+
QHBoxLayout *hbox = new QHBoxLayout ( vbox );
hbox-> addWidget ( new QLabel ( tr( "Stipple contrast" ), this ));
m_contsld = new QSlider ( Horizontal, this );
m_contsld-> setRange ( 0, 10 );
@@ -168,15 +155,16 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl )
hbox-> addWidget ( m_contsld, 10 );
vbox-> addStretch ( 10 );
changeType ( m_type );
- connect ( btngrp, SIGNAL( clicked ( int ) ), this, SLOT( changeType ( int ) ) );
+ connect ( cb, SIGNAL( highlighted ( int ) ), this, SLOT( changeType ( int ) ) );
connect ( shadow, SIGNAL( toggled ( bool ) ), this, SLOT( changeShadow ( bool ) ) );
connect ( windeco, SIGNAL( toggled ( bool ) ), this, SLOT( changeDeco ( bool ) ) );
+ connect ( flattb, SIGNAL( toggled ( bool ) ), this, SLOT( changeFlat ( bool ) ) );
}
void LiquidSettings::changeType ( int t )
{
bool custom = ( t == Custom );
@@ -209,12 +197,17 @@ void LiquidSettings::changeShadow ( bool b )
void LiquidSettings::changeDeco ( bool b )
{
m_deco = b;
}
+void LiquidSettings::changeFlat ( bool b )
+{
+ m_flat = b;
+}
+
bool LiquidSettings::writeConfig ( )
{
Config config ( "qpe" );
config. setGroup ( "Liquid-Style" );
@@ -222,11 +215,12 @@ bool LiquidSettings::writeConfig ( )
config. writeEntry ( "Color", m_menucol. name ( ));
config. writeEntry ( "TextColor", m_textcol. name ( ));
config. writeEntry ( "Opacity", m_opacsld-> value ( ));
config. writeEntry ( "ShadowText", m_shadow );
config. writeEntry ( "WinDecoration", m_deco );
config. writeEntry ( "StippleContrast", m_contsld-> value ( ));
+ config. writeEntry ( "FlatToolButtons", m_flat );
config. write ( );
return true;
}