author | sandman <sandman> | 2002-07-15 00:52:50 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-07-15 00:52:50 (UTC) |
commit | ecf2a873be3274bb30be0c659b7db6ef8a43be84 (patch) (side-by-side diff) | |
tree | 5c80fb0863966fffd245f6ed44c6bf524c11842b /noncore/styles/liquid/liquidset.cpp | |
parent | 4feeec8b5b41cfd3d13274411f515524f687da09 (diff) | |
download | opie-ecf2a873be3274bb30be0c659b7db6ef8a43be84.zip opie-ecf2a873be3274bb30be0c659b7db6ef8a43be84.tar.gz opie-ecf2a873be3274bb30be0c659b7db6ef8a43be84.tar.bz2 |
Added an option to make toolbar buttons flat
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 @@ -29,5 +29,5 @@ #include <qslider.h> #include <qtoolbutton.h> -#include <qbuttongroup.h> +#include <qcombobox.h> #include <qradiobutton.h> #include <qcheckbox.h> @@ -73,40 +73,21 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) 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 ); @@ -158,4 +139,10 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) 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 ); @@ -172,7 +159,8 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) 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 ) ) ); } @@ -213,4 +201,9 @@ void LiquidSettings::changeDeco ( bool b ) } +void LiquidSettings::changeFlat ( bool b ) +{ + m_flat = b; +} + bool LiquidSettings::writeConfig ( ) @@ -226,4 +219,5 @@ bool LiquidSettings::writeConfig ( ) config. writeEntry ( "WinDecoration", m_deco ); config. writeEntry ( "StippleContrast", m_contsld-> value ( )); + config. writeEntry ( "FlatToolButtons", m_flat ); config. write ( ); |