Diffstat (limited to 'noncore/styles/liquid/liquidset.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/styles/liquid/liquidset.cpp | 58 |
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 @@ -27,9 +27,9 @@ #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> @@ -71,44 +71,25 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) 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 ); @@ -156,8 +137,14 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) 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 )); @@ -170,11 +157,12 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) 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 ) { @@ -211,8 +199,13 @@ void LiquidSettings::changeDeco ( bool b ) { m_deco = b; } +void LiquidSettings::changeFlat ( bool b ) +{ + m_flat = b; +} + bool LiquidSettings::writeConfig ( ) { Config config ( "qpe" ); @@ -224,8 +217,9 @@ bool LiquidSettings::writeConfig ( ) 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; } |