summaryrefslogtreecommitdiff
path: root/noncore/styles/liquid/liquidset.cpp
Unidiff
Diffstat (limited to 'noncore/styles/liquid/liquidset.cpp') (more/less context) (ignore 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 @@
25 25
26#include <qpe/qpeapplication.h> 26#include <qpe/qpeapplication.h>
27#include <qpe/global.h> 27#include <qpe/global.h>
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>
35#include <qlayout.h> 35#include <qlayout.h>
36#include <qpalette.h> 36#include <qpalette.h>
37 37
@@ -69,48 +69,29 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl )
69 m_menucol = QColor ( config. readEntry ( "Color", QApplication::palette ( ). active ( ). button ( ). name ( ))); 69 m_menucol = QColor ( config. readEntry ( "Color", QApplication::palette ( ). active ( ). button ( ). name ( )));
70 m_textcol = QColor ( config. readEntry ( "TextColor", QApplication::palette ( ). active ( ). text ( ). name ( ))); 70 m_textcol = QColor ( config. readEntry ( "TextColor", QApplication::palette ( ). active ( ). text ( ). name ( )));
71 int opacity = config. readNumEntry ( "Opacity", 10 ); 71 int opacity = config. readNumEntry ( "Opacity", 10 );
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 );
114 grid-> addColSpacing ( 3, 8 ); 95 grid-> addColSpacing ( 3, 8 );
115 96
116 grid-> addWidget ( m_menulbl = new QLabel ( tr( "Menu color" ), this ), 0, 1 ); 97 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 )
154 QCheckBox *windeco = new QCheckBox ( tr( "Draw liquid window title bars" ), this ); 135 QCheckBox *windeco = new QCheckBox ( tr( "Draw liquid window title bars" ), this );
155 windeco-> setChecked ( m_deco ); 136 windeco-> setChecked ( m_deco );
156 vbox-> addWidget ( windeco ); 137 vbox-> addWidget ( windeco );
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 ));
163 150
164 m_contsld = new QSlider ( Horizontal, this ); 151 m_contsld = new QSlider ( Horizontal, this );
165 m_contsld-> setRange ( 0, 10 ); 152 m_contsld-> setRange ( 0, 10 );
@@ -168,15 +155,16 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl )
168 hbox-> addWidget ( m_contsld, 10 ); 155 hbox-> addWidget ( m_contsld, 10 );
169 156
170 vbox-> addStretch ( 10 ); 157 vbox-> addStretch ( 10 );
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
179void LiquidSettings::changeType ( int t ) 167void LiquidSettings::changeType ( int t )
180{ 168{
181 bool custom = ( t == Custom ); 169 bool custom = ( t == Custom );
182 170
@@ -209,12 +197,17 @@ void LiquidSettings::changeShadow ( bool b )
209 197
210void LiquidSettings::changeDeco ( bool b ) 198void LiquidSettings::changeDeco ( bool b )
211{ 199{
212 m_deco = b; 200 m_deco = b;
213} 201}
214 202
203void LiquidSettings::changeFlat ( bool b )
204{
205 m_flat = b;
206}
207
215 208
216bool LiquidSettings::writeConfig ( ) 209bool LiquidSettings::writeConfig ( )
217{ 210{
218 Config config ( "qpe" ); 211 Config config ( "qpe" );
219 config. setGroup ( "Liquid-Style" ); 212 config. setGroup ( "Liquid-Style" );
220 213
@@ -222,11 +215,12 @@ bool LiquidSettings::writeConfig ( )
222 config. writeEntry ( "Color", m_menucol. name ( )); 215 config. writeEntry ( "Color", m_menucol. name ( ));
223 config. writeEntry ( "TextColor", m_textcol. name ( )); 216 config. writeEntry ( "TextColor", m_textcol. name ( ));
224 config. writeEntry ( "Opacity", m_opacsld-> value ( )); 217 config. writeEntry ( "Opacity", m_opacsld-> value ( ));
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;
231} 225}
232 226