Diffstat (limited to 'noncore/styles/liquid/liquidset.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/styles/liquid/liquidset.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/noncore/styles/liquid/liquidset.cpp b/noncore/styles/liquid/liquidset.cpp index 4fffe12..ea0b3c9 100644 --- a/noncore/styles/liquid/liquidset.cpp +++ b/noncore/styles/liquid/liquidset.cpp | |||
@@ -35,29 +35,12 @@ | |||
35 | 35 | ||
36 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
37 | 37 | ||
38 | #include <opie/ocolorbutton.h> | 38 | #include <opie/ocolorbutton.h> |
39 | 39 | ||
40 | 40 | ||
41 | static void changeButtonColor ( QWidget *btn, const QColor &col ) | ||
42 | { | ||
43 | QPalette pal = btn-> palette ( ); | ||
44 | |||
45 | pal. setColor ( QPalette::Normal, QColorGroup::Button, col ); | ||
46 | pal. setColor ( QPalette::Active, QColorGroup::Button, col ); | ||
47 | pal. setColor ( QPalette::Disabled, QColorGroup::Button, col ); | ||
48 | pal. setColor ( QPalette::Inactive, QColorGroup::Button, col ); | ||
49 | pal. setColor ( QPalette::Normal, QColorGroup::Background, col ); | ||
50 | pal. setColor ( QPalette::Active, QColorGroup::Background, col ); | ||
51 | pal. setColor ( QPalette::Disabled, QColorGroup::Background, col ); | ||
52 | pal. setColor ( QPalette::Inactive, QColorGroup::Background, col ); | ||
53 | |||
54 | btn-> setPalette ( pal ); | ||
55 | } | ||
56 | |||
57 | |||
58 | LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) | 41 | LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) |
59 | : QWidget ( parent, name, fl ) | 42 | : QWidget ( parent, name, fl ) |
60 | { | 43 | { |
61 | setCaption ( tr( "Liquid Style" ) ); | 44 | setCaption ( tr( "Liquid Style" ) ); |
62 | 45 | ||
63 | Config config ( "qpe" ); | 46 | Config config ( "qpe" ); |
@@ -65,13 +48,12 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) | |||
65 | 48 | ||
66 | m_type = config. readNumEntry ( "Type", TransStippleBg ); | 49 | m_type = config. readNumEntry ( "Type", TransStippleBg ); |
67 | QColor mcol = QColor ( config. readEntry ( "Color", QApplication::palette ( ). active ( ). button ( ). name ( ))); | 50 | QColor mcol = QColor ( config. readEntry ( "Color", QApplication::palette ( ). active ( ). button ( ). name ( ))); |
68 | QColor tcol = QColor ( config. readEntry ( "TextColor", QApplication::palette ( ). active ( ). text ( ). name ( ))); | 51 | QColor tcol = QColor ( config. readEntry ( "TextColor", QApplication::palette ( ). active ( ). text ( ). name ( ))); |
69 | int opacity = config. readNumEntry ( "Opacity", 10 ); | 52 | int opacity = config. readNumEntry ( "Opacity", 10 ); |
70 | m_shadow = config. readBoolEntry ( "ShadowText", true ); | 53 | m_shadow = config. readBoolEntry ( "ShadowText", true ); |
71 | m_deco = config. readBoolEntry ( "WinDecoration", true ); | ||
72 | int contrast = config. readNumEntry ( "StippleContrast", 5 ); | 54 | int contrast = config. readNumEntry ( "StippleContrast", 5 ); |
73 | m_flat = config. readBoolEntry ( "FlatToolButtons", false ); | 55 | m_flat = config. readBoolEntry ( "FlatToolButtons", false ); |
74 | 56 | ||
75 | QVBoxLayout *vbox = new QVBoxLayout ( this ); | 57 | QVBoxLayout *vbox = new QVBoxLayout ( this ); |
76 | vbox-> setSpacing ( 3 ); | 58 | vbox-> setSpacing ( 3 ); |
77 | vbox-> setMargin ( 4 ); | 59 | vbox-> setMargin ( 4 ); |
@@ -115,18 +97,12 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) | |||
115 | QCheckBox *shadow = new QCheckBox ( tr( "Use shadowed menu text" ), this ); | 97 | QCheckBox *shadow = new QCheckBox ( tr( "Use shadowed menu text" ), this ); |
116 | shadow-> setChecked ( m_shadow ); | 98 | shadow-> setChecked ( m_shadow ); |
117 | vbox-> addWidget ( shadow ); | 99 | vbox-> addWidget ( shadow ); |
118 | 100 | ||
119 | vbox-> addSpacing ( 4 ); | 101 | vbox-> addSpacing ( 4 ); |
120 | 102 | ||
121 | QCheckBox *windeco = new QCheckBox ( tr( "Draw liquid window title bars" ), this ); | ||
122 | windeco-> setChecked ( m_deco ); | ||
123 | vbox-> addWidget ( windeco ); | ||
124 | |||
125 | vbox-> addSpacing ( 4 ); | ||
126 | |||
127 | QCheckBox *flattb = new QCheckBox ( tr( "Make toolbar buttons appear flat" ), this ); | 103 | QCheckBox *flattb = new QCheckBox ( tr( "Make toolbar buttons appear flat" ), this ); |
128 | flattb-> setChecked ( m_flat ); | 104 | flattb-> setChecked ( m_flat ); |
129 | vbox-> addWidget ( flattb ); | 105 | vbox-> addWidget ( flattb ); |
130 | 106 | ||
131 | vbox-> addSpacing ( 4 ); | 107 | vbox-> addSpacing ( 4 ); |
132 | 108 | ||
@@ -143,13 +119,12 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) | |||
143 | vbox-> addStretch ( 10 ); | 119 | vbox-> addStretch ( 10 ); |
144 | 120 | ||
145 | changeType ( m_type ); | 121 | changeType ( m_type ); |
146 | 122 | ||
147 | connect ( cb, SIGNAL( highlighted ( int ) ), this, SLOT( changeType ( int ) ) ); | 123 | connect ( cb, SIGNAL( highlighted ( int ) ), this, SLOT( changeType ( int ) ) ); |
148 | connect ( shadow, SIGNAL( toggled ( bool ) ), this, SLOT( changeShadow ( bool ) ) ); | 124 | connect ( shadow, SIGNAL( toggled ( bool ) ), this, SLOT( changeShadow ( bool ) ) ); |
149 | connect ( windeco, SIGNAL( toggled ( bool ) ), this, SLOT( changeDeco ( bool ) ) ); | ||
150 | connect ( flattb, SIGNAL( toggled ( bool ) ), this, SLOT( changeFlat ( bool ) ) ); | 125 | connect ( flattb, SIGNAL( toggled ( bool ) ), this, SLOT( changeFlat ( bool ) ) ); |
151 | } | 126 | } |
152 | 127 | ||
153 | void LiquidSettings::changeType ( int t ) | 128 | void LiquidSettings::changeType ( int t ) |
154 | { | 129 | { |
155 | bool custom = ( t == Custom ); | 130 | bool custom = ( t == Custom ); |
@@ -166,17 +141,12 @@ void LiquidSettings::changeType ( int t ) | |||
166 | 141 | ||
167 | void LiquidSettings::changeShadow ( bool b ) | 142 | void LiquidSettings::changeShadow ( bool b ) |
168 | { | 143 | { |
169 | m_shadow = b; | 144 | m_shadow = b; |
170 | } | 145 | } |
171 | 146 | ||
172 | void LiquidSettings::changeDeco ( bool b ) | ||
173 | { | ||
174 | m_deco = b; | ||
175 | } | ||
176 | |||
177 | void LiquidSettings::changeFlat ( bool b ) | 147 | void LiquidSettings::changeFlat ( bool b ) |
178 | { | 148 | { |
179 | m_flat = b; | 149 | m_flat = b; |
180 | } | 150 | } |
181 | 151 | ||
182 | 152 | ||
@@ -187,13 +157,12 @@ bool LiquidSettings::writeConfig ( ) | |||
187 | 157 | ||
188 | config. writeEntry ( "Type", m_type ); | 158 | config. writeEntry ( "Type", m_type ); |
189 | config. writeEntry ( "Color", m_menubtn-> color ( ). name ( )); | 159 | config. writeEntry ( "Color", m_menubtn-> color ( ). name ( )); |
190 | config. writeEntry ( "TextColor", m_textbtn-> color ( ). name ( )); | 160 | config. writeEntry ( "TextColor", m_textbtn-> color ( ). name ( )); |
191 | config. writeEntry ( "Opacity", m_opacsld-> value ( )); | 161 | config. writeEntry ( "Opacity", m_opacsld-> value ( )); |
192 | config. writeEntry ( "ShadowText", m_shadow ); | 162 | config. writeEntry ( "ShadowText", m_shadow ); |
193 | config. writeEntry ( "WinDecoration", m_deco ); | ||
194 | config. writeEntry ( "StippleContrast", m_contsld-> value ( )); | 163 | config. writeEntry ( "StippleContrast", m_contsld-> value ( )); |
195 | config. writeEntry ( "FlatToolButtons", m_flat ); | 164 | config. writeEntry ( "FlatToolButtons", m_flat ); |
196 | config. write ( ); | 165 | config. write ( ); |
197 | 166 | ||
198 | return true; | 167 | return true; |
199 | } | 168 | } |