Diffstat (limited to 'noncore/styles/liquid/settings/liquidset.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/styles/liquid/settings/liquidset.cpp | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/noncore/styles/liquid/settings/liquidset.cpp b/noncore/styles/liquid/settings/liquidset.cpp index 0ef5dbe..1479ac0 100644 --- a/noncore/styles/liquid/settings/liquidset.cpp +++ b/noncore/styles/liquid/settings/liquidset.cpp | |||
@@ -44,9 +44,14 @@ static void changeButtonColor ( QWidget *btn, const QColor &col ) | |||
44 | { | 44 | { |
45 | QPalette pal = btn-> palette ( ); | 45 | QPalette pal = btn-> palette ( ); |
46 | 46 | ||
47 | pal. setColor ( QPalette::Normal, QColorGroup::Button, col ); | ||
47 | pal. setColor ( QPalette::Active, QColorGroup::Button, col ); | 48 | pal. setColor ( QPalette::Active, QColorGroup::Button, col ); |
48 | pal. setColor ( QPalette::Disabled, QColorGroup::Button, col ); | 49 | pal. setColor ( QPalette::Disabled, QColorGroup::Button, col ); |
49 | pal. setColor ( QPalette::Inactive, QColorGroup::Button, col ); | 50 | pal. setColor ( QPalette::Inactive, QColorGroup::Button, col ); |
51 | pal. setColor ( QPalette::Normal, QColorGroup::Background, col ); | ||
52 | pal. setColor ( QPalette::Active, QColorGroup::Background, col ); | ||
53 | pal. setColor ( QPalette::Disabled, QColorGroup::Background, col ); | ||
54 | pal. setColor ( QPalette::Inactive, QColorGroup::Background, col ); | ||
50 | 55 | ||
51 | btn-> setPalette ( pal ); | 56 | btn-> setPalette ( pal ); |
52 | } | 57 | } |
@@ -58,13 +63,15 @@ LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl ) | |||
58 | setCaption ( tr( "Liquid Style" ) ); | 63 | setCaption ( tr( "Liquid Style" ) ); |
59 | 64 | ||
60 | Config config ( "qpe" ); | 65 | Config config ( "qpe" ); |
61 | config. setGroup ( "MosfetMenus" ); | 66 | config. setGroup ( "Liquid-Style" ); |
62 | 67 | ||
63 | m_type = config. readNumEntry ( "Type", TransStippleBg ); | 68 | m_type = config. readNumEntry ( "Type", TransStippleBg ); |
64 | m_menucol = QColor ( config. readEntry ( "Color", QApplication::palette ( ). active ( ). button ( ). name ( ))); | 69 | m_menucol = QColor ( config. readEntry ( "Color", QApplication::palette ( ). active ( ). button ( ). name ( ))); |
65 | m_textcol = QColor ( config. readEntry ( "TextColor", QApplication::palette ( ). active ( ). text ( ). name ( ))); | 70 | m_textcol = QColor ( config. readEntry ( "TextColor", QApplication::palette ( ). active ( ). text ( ). name ( ))); |
66 | int opacity = config. readNumEntry ( "Opacity", 10 ); | 71 | int opacity = config. readNumEntry ( "Opacity", 10 ); |
67 | m_shadow = config. readBoolEntry ( "ShadowText", true ); | 72 | m_shadow = config. readBoolEntry ( "ShadowText", true ); |
73 | m_deco = config. readBoolEntry ( "WinDecoration", true ); | ||
74 | int contrast = config. readNumEntry ( "StippleContrast", 5 ); | ||
68 | 75 | ||
69 | QVBoxLayout *vbox = new QVBoxLayout ( this ); | 76 | QVBoxLayout *vbox = new QVBoxLayout ( this ); |
70 | vbox-> setSpacing ( 3 ); | 77 | vbox-> setSpacing ( 3 ); |
@@ -138,14 +145,35 @@ LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl ) | |||
138 | 145 | ||
139 | vbox-> addSpacing ( 4 ); | 146 | vbox-> addSpacing ( 4 ); |
140 | 147 | ||
141 | QCheckBox *shadow = new QCheckBox ( tr( "Use shadowed text" ), this ); | 148 | QCheckBox *shadow = new QCheckBox ( tr( "Use shadowed menu text" ), this ); |
142 | shadow-> setChecked ( m_shadow ); | 149 | shadow-> setChecked ( m_shadow ); |
143 | vbox-> addWidget ( shadow ); | 150 | vbox-> addWidget ( shadow ); |
144 | 151 | ||
152 | vbox-> addSpacing ( 4 ); | ||
153 | |||
154 | QCheckBox *windeco = new QCheckBox ( tr( "Draw liquid window title bars" ), this ); | ||
155 | windeco-> setChecked ( m_deco ); | ||
156 | vbox-> addWidget ( windeco ); | ||
157 | |||
158 | vbox-> addSpacing ( 4 ); | ||
159 | |||
160 | QHBoxLayout *hbox = new QHBoxLayout ( vbox ); | ||
161 | |||
162 | hbox-> addWidget ( new QLabel ( tr( "Stipple contrast" ), this )); | ||
163 | |||
164 | m_contsld = new QSlider ( Horizontal, this ); | ||
165 | m_contsld-> setRange ( 0, 10 ); | ||
166 | m_contsld-> setValue ( contrast ); | ||
167 | m_contsld-> setTickmarks ( QSlider::Below ); | ||
168 | hbox-> addWidget ( m_contsld, 10 ); | ||
169 | |||
145 | vbox-> addStretch ( 10 ); | 170 | vbox-> addStretch ( 10 ); |
146 | 171 | ||
172 | changeType ( m_type ); | ||
173 | |||
147 | connect ( btngrp, SIGNAL( clicked ( int ) ), this, SLOT( changeType ( int ) ) ); | 174 | connect ( btngrp, SIGNAL( clicked ( int ) ), this, SLOT( changeType ( int ) ) ); |
148 | connect ( shadow, SIGNAL( toggled ( bool ) ), this, SLOT( changeShadow ( bool ) ) ); | 175 | connect ( shadow, SIGNAL( toggled ( bool ) ), this, SLOT( changeShadow ( bool ) ) ); |
176 | connect ( windeco, SIGNAL( toggled ( bool ) ), this, SLOT( changeDeco ( bool ) ) ); | ||
149 | } | 177 | } |
150 | 178 | ||
151 | void LiquidSet::changeType ( int t ) | 179 | void LiquidSet::changeType ( int t ) |
@@ -164,13 +192,13 @@ void LiquidSet::changeType ( int t ) | |||
164 | 192 | ||
165 | void LiquidSet::changeMenuColor ( const QColor &col ) | 193 | void LiquidSet::changeMenuColor ( const QColor &col ) |
166 | { | 194 | { |
167 | m_menubtn-> setPalette ( col ); | 195 | changeButtonColor ( m_menubtn, col ); |
168 | m_menucol = col; | 196 | m_menucol = col; |
169 | } | 197 | } |
170 | 198 | ||
171 | void LiquidSet::changeTextColor ( const QColor &col ) | 199 | void LiquidSet::changeTextColor ( const QColor &col ) |
172 | { | 200 | { |
173 | m_textbtn-> setPalette ( col ); | 201 | changeButtonColor ( m_textbtn, col ); |
174 | m_textcol = col; | 202 | m_textcol = col; |
175 | } | 203 | } |
176 | 204 | ||
@@ -179,17 +207,24 @@ void LiquidSet::changeShadow ( bool b ) | |||
179 | m_shadow = b; | 207 | m_shadow = b; |
180 | } | 208 | } |
181 | 209 | ||
210 | void LiquidSet::changeDeco ( bool b ) | ||
211 | { | ||
212 | m_deco = b; | ||
213 | } | ||
214 | |||
182 | 215 | ||
183 | void LiquidSet::accept ( ) | 216 | void LiquidSet::accept ( ) |
184 | { | 217 | { |
185 | Config config ( "qpe" ); | 218 | Config config ( "qpe" ); |
186 | config. setGroup ( "MosfetMenus" ); | 219 | config. setGroup ( "Liquid-Style" ); |
187 | 220 | ||
188 | config. writeEntry ( "Type", m_type ); | 221 | config. writeEntry ( "Type", m_type ); |
189 | config. writeEntry ( "Color", m_menucol. name ( )); | 222 | config. writeEntry ( "Color", m_menucol. name ( )); |
190 | config. writeEntry ( "TextColor", m_textcol. name ( )); | 223 | config. writeEntry ( "TextColor", m_textcol. name ( )); |
191 | config. writeEntry ( "Opacity", m_opacsld-> value ( )); | 224 | config. writeEntry ( "Opacity", m_opacsld-> value ( )); |
192 | config. writeEntry ( "ShadowText", m_shadow ); | 225 | config. writeEntry ( "ShadowText", m_shadow ); |
226 | config. writeEntry ( "WinDecoration", m_deco ); | ||
227 | config. writeEntry ( "StippleContrast", m_contsld-> value ( )); | ||
193 | config. write ( ); | 228 | config. write ( ); |
194 | 229 | ||
195 | Global::applyStyle ( ); | 230 | Global::applyStyle ( ); |