Diffstat (limited to 'noncore/styles/liquid/liquidset.cpp') (more/less context) (ignore 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 | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | #include <qslider.h> | 29 | #include <qslider.h> |
30 | #include <qtoolbutton.h> | 30 | #include <qtoolbutton.h> |
31 | #include <qbuttongroup.h> | 31 | #include <qcombobox.h> |
32 | #include <qradiobutton.h> | 32 | #include <qradiobutton.h> |
33 | #include <qcheckbox.h> | 33 | #include <qcheckbox.h> |
34 | #include <qlabel.h> | 34 | #include <qlabel.h> |
@@ -72,42 +72,23 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) | |||
72 | m_shadow = config. readBoolEntry ( "ShadowText", true ); | 72 | m_shadow = config. readBoolEntry ( "ShadowText", true ); |
73 | m_deco = config. readBoolEntry ( "WinDecoration", true ); | 73 | m_deco = config. readBoolEntry ( "WinDecoration", true ); |
74 | int contrast = config. readNumEntry ( "StippleContrast", 5 ); | 74 | int contrast = config. readNumEntry ( "StippleContrast", 5 ); |
75 | m_flat = config. readBoolEntry ( "FlatToolButtons", false ); | ||
75 | 76 | ||
76 | QVBoxLayout *vbox = new QVBoxLayout ( this ); | 77 | QVBoxLayout *vbox = new QVBoxLayout ( this ); |
77 | vbox-> setSpacing ( 3 ); | 78 | vbox-> setSpacing ( 3 ); |
78 | vbox-> setMargin ( 6 ); | 79 | vbox-> setMargin ( 4 ); |
79 | 80 | ||
80 | QButtonGroup *btngrp = new QButtonGroup ( this ); | 81 | QComboBox *cb = new QComboBox ( this ); |
81 | btngrp-> hide ( ); | 82 | cb-> insertItem ( tr( "No translucency" ), None ); |
82 | 83 | cb-> insertItem ( tr( "Stippled, background color" ), StippledBg ); | |
83 | QRadioButton *rad; | 84 | cb-> insertItem ( tr( "Stippled, button color" ), StippledBtn ); |
84 | 85 | cb-> insertItem ( tr( "Translucent stippled, background color" ), TransStippleBg ); | |
85 | rad = new QRadioButton ( tr( "No translucency" ), this ); | 86 | cb-> insertItem ( tr( "Translucent stippled, button color" ), TransStippleBtn ); |
86 | btngrp-> insert ( rad, None ); | 87 | cb-> insertItem ( tr( "Custom translucency" ), Custom ); |
87 | vbox-> addWidget ( rad ); | ||
88 | |||
89 | rad = new QRadioButton ( tr( "Stippled, background color" ), this ); | ||
90 | btngrp-> insert ( rad, StippledBg ); | ||
91 | vbox-> addWidget ( rad ); | ||
92 | |||
93 | rad = new QRadioButton ( tr( "Stippled, button color" ), this ); | ||
94 | btngrp-> insert ( rad, StippledBtn ); | ||
95 | vbox-> addWidget ( rad ); | ||
96 | |||
97 | rad = new QRadioButton ( tr( "Translucent stippled, background color" ), this ); | ||
98 | btngrp-> insert ( rad, TransStippleBg ); | ||
99 | vbox-> addWidget ( rad ); | ||
100 | |||
101 | rad = new QRadioButton ( tr( "Translucent stippled, button color" ), this ); | ||
102 | btngrp-> insert ( rad, TransStippleBtn ); | ||
103 | vbox-> addWidget ( rad ); | ||
104 | 88 | ||
105 | rad = new QRadioButton ( tr( "Custom translucency" ), this ); | 89 | cb-> setCurrentItem ( m_type ); |
106 | btngrp-> insert ( rad, Custom ); | 90 | vbox-> addWidget ( cb ); |
107 | vbox-> addWidget ( rad ); | ||
108 | 91 | ||
109 | btngrp-> setExclusive ( true ); | ||
110 | btngrp-> setButton ( m_type ); | ||
111 | 92 | ||
112 | QGridLayout *grid = new QGridLayout ( vbox ); | 93 | QGridLayout *grid = new QGridLayout ( vbox ); |
113 | grid-> addColSpacing ( 0, 16 ); | 94 | grid-> addColSpacing ( 0, 16 ); |
@@ -157,6 +138,12 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) | |||
157 | 138 | ||
158 | vbox-> addSpacing ( 4 ); | 139 | vbox-> addSpacing ( 4 ); |
159 | 140 | ||
141 | QCheckBox *flattb = new QCheckBox ( tr( "Make toolbar buttons appear flat" ), this ); | ||
142 | flattb-> setChecked ( m_flat ); | ||
143 | vbox-> addWidget ( flattb ); | ||
144 | |||
145 | vbox-> addSpacing ( 4 ); | ||
146 | |||
160 | QHBoxLayout *hbox = new QHBoxLayout ( vbox ); | 147 | QHBoxLayout *hbox = new QHBoxLayout ( vbox ); |
161 | 148 | ||
162 | hbox-> addWidget ( new QLabel ( tr( "Stipple contrast" ), this )); | 149 | hbox-> addWidget ( new QLabel ( tr( "Stipple contrast" ), this )); |
@@ -171,9 +158,10 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) | |||
171 | 158 | ||
172 | changeType ( m_type ); | 159 | changeType ( m_type ); |
173 | 160 | ||
174 | connect ( btngrp, SIGNAL( clicked ( int ) ), this, SLOT( changeType ( int ) ) ); | 161 | connect ( cb, SIGNAL( highlighted ( int ) ), this, SLOT( changeType ( int ) ) ); |
175 | connect ( shadow, SIGNAL( toggled ( bool ) ), this, SLOT( changeShadow ( bool ) ) ); | 162 | connect ( shadow, SIGNAL( toggled ( bool ) ), this, SLOT( changeShadow ( bool ) ) ); |
176 | connect ( windeco, SIGNAL( toggled ( bool ) ), this, SLOT( changeDeco ( bool ) ) ); | 163 | connect ( windeco, SIGNAL( toggled ( bool ) ), this, SLOT( changeDeco ( bool ) ) ); |
164 | connect ( flattb, SIGNAL( toggled ( bool ) ), this, SLOT( changeFlat ( bool ) ) ); | ||
177 | } | 165 | } |
178 | 166 | ||
179 | void LiquidSettings::changeType ( int t ) | 167 | void LiquidSettings::changeType ( int t ) |
@@ -212,6 +200,11 @@ void LiquidSettings::changeDeco ( bool b ) | |||
212 | m_deco = b; | 200 | m_deco = b; |
213 | } | 201 | } |
214 | 202 | ||
203 | void LiquidSettings::changeFlat ( bool b ) | ||
204 | { | ||
205 | m_flat = b; | ||
206 | } | ||
207 | |||
215 | 208 | ||
216 | bool LiquidSettings::writeConfig ( ) | 209 | bool LiquidSettings::writeConfig ( ) |
217 | { | 210 | { |
@@ -225,6 +218,7 @@ bool LiquidSettings::writeConfig ( ) | |||
225 | config. writeEntry ( "ShadowText", m_shadow ); | 218 | config. writeEntry ( "ShadowText", m_shadow ); |
226 | config. writeEntry ( "WinDecoration", m_deco ); | 219 | config. writeEntry ( "WinDecoration", m_deco ); |
227 | config. writeEntry ( "StippleContrast", m_contsld-> value ( )); | 220 | config. writeEntry ( "StippleContrast", m_contsld-> value ( )); |
221 | config. writeEntry ( "FlatToolButtons", m_flat ); | ||
228 | config. write ( ); | 222 | config. write ( ); |
229 | 223 | ||
230 | return true; | 224 | return true; |