Diffstat (limited to 'noncore/styles/liquid/settings') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/styles/liquid/settings/.cvsignore | 2 | ||||
-rw-r--r-- | noncore/styles/liquid/settings/liquidset.cpp | 234 | ||||
-rw-r--r-- | noncore/styles/liquid/settings/liquidset.h | 42 | ||||
-rw-r--r-- | noncore/styles/liquid/settings/main.cpp | 34 | ||||
-rw-r--r-- | noncore/styles/liquid/settings/settings.pro | 24 |
5 files changed, 0 insertions, 336 deletions
diff --git a/noncore/styles/liquid/settings/.cvsignore b/noncore/styles/liquid/settings/.cvsignore deleted file mode 100644 index c13418b..0000000 --- a/noncore/styles/liquid/settings/.cvsignore +++ b/dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | Makefile* | ||
2 | moc_* | ||
diff --git a/noncore/styles/liquid/settings/liquidset.cpp b/noncore/styles/liquid/settings/liquidset.cpp deleted file mode 100644 index 1479ac0..0000000 --- a/noncore/styles/liquid/settings/liquidset.cpp +++ b/dev/null | |||
@@ -1,234 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | |||
22 | |||
23 | #include "liquidset.h" | ||
24 | #include "../liquid.h" | ||
25 | |||
26 | #include <qpe/qpeapplication.h> | ||
27 | #include <qpe/global.h> | ||
28 | |||
29 | #include <qslider.h> | ||
30 | #include <qtoolbutton.h> | ||
31 | #include <qbuttongroup.h> | ||
32 | #include <qradiobutton.h> | ||
33 | #include <qcheckbox.h> | ||
34 | #include <qlabel.h> | ||
35 | #include <qlayout.h> | ||
36 | #include <qpalette.h> | ||
37 | |||
38 | #include <qpe/config.h> | ||
39 | |||
40 | #include <opie/colorpopupmenu.h> | ||
41 | |||
42 | |||
43 | static void changeButtonColor ( QWidget *btn, const QColor &col ) | ||
44 | { | ||
45 | QPalette pal = btn-> palette ( ); | ||
46 | |||
47 | pal. setColor ( QPalette::Normal, QColorGroup::Button, col ); | ||
48 | pal. setColor ( QPalette::Active, QColorGroup::Button, col ); | ||
49 | pal. setColor ( QPalette::Disabled, 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 ); | ||
55 | |||
56 | btn-> setPalette ( pal ); | ||
57 | } | ||
58 | |||
59 | |||
60 | LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl ) | ||
61 | : QDialog ( parent, name, fl ) | ||
62 | { | ||
63 | setCaption ( tr( "Liquid Style" ) ); | ||
64 | |||
65 | Config config ( "qpe" ); | ||
66 | config. setGroup ( "Liquid-Style" ); | ||
67 | |||
68 | m_type = config. readNumEntry ( "Type", TransStippleBg ); | ||
69 | m_menucol = QColor ( config. readEntry ( "Color", QApplication::palette ( ). active ( ). button ( ). name ( ))); | ||
70 | m_textcol = QColor ( config. readEntry ( "TextColor", QApplication::palette ( ). active ( ). text ( ). name ( ))); | ||
71 | int opacity = config. readNumEntry ( "Opacity", 10 ); | ||
72 | m_shadow = config. readBoolEntry ( "ShadowText", true ); | ||
73 | m_deco = config. readBoolEntry ( "WinDecoration", true ); | ||
74 | int contrast = config. readNumEntry ( "StippleContrast", 5 ); | ||
75 | |||
76 | QVBoxLayout *vbox = new QVBoxLayout ( this ); | ||
77 | vbox-> setSpacing ( 3 ); | ||
78 | vbox-> setMargin ( 6 ); | ||
79 | |||
80 | QButtonGroup *btngrp = new QButtonGroup ( this ); | ||
81 | btngrp-> hide ( ); | ||
82 | |||
83 | QRadioButton *rad; | ||
84 | |||
85 | rad = new QRadioButton ( tr( "No translucency" ), this ); | ||
86 | btngrp-> insert ( rad, None ); | ||
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 | |||
105 | rad = new QRadioButton ( tr( "Custom translucency" ), this ); | ||
106 | btngrp-> insert ( rad, Custom ); | ||
107 | vbox-> addWidget ( rad ); | ||
108 | |||
109 | btngrp-> setExclusive ( true ); | ||
110 | btngrp-> setButton ( m_type ); | ||
111 | |||
112 | QGridLayout *grid = new QGridLayout ( vbox ); | ||
113 | grid-> addColSpacing ( 0, 16 ); | ||
114 | grid-> addColSpacing ( 3, 8 ); | ||
115 | |||
116 | grid-> addWidget ( m_menulbl = new QLabel ( tr( "Menu color" ), this ), 0, 1 ); | ||
117 | grid-> addWidget ( m_textlbl = new QLabel ( tr( "Text color" ), this ), 0, 4 ); | ||
118 | grid-> addWidget ( m_opaclbl = new QLabel ( tr( "Opacity" ), this ), 1, 1 ); | ||
119 | |||
120 | m_menubtn = new QToolButton ( this ); | ||
121 | grid-> addWidget ( m_menubtn, 0, 2 ); | ||
122 | |||
123 | QPopupMenu *popup; | ||
124 | |||
125 | popup = new ColorPopupMenu ( m_menucol, this ); | ||
126 | m_menubtn-> setPopup ( popup ); | ||
127 | m_menubtn-> setPopupDelay ( 0 ); | ||
128 | connect ( popup, SIGNAL( colorSelected ( const QColor & )), this, SLOT( changeMenuColor ( const QColor & ))); | ||
129 | changeMenuColor ( m_menucol ); | ||
130 | |||
131 | m_textbtn = new QToolButton ( this ); | ||
132 | grid-> addWidget ( m_textbtn, 0, 5 ); | ||
133 | |||
134 | popup = new ColorPopupMenu ( m_textcol, this ); | ||
135 | m_textbtn-> setPopup ( popup ); | ||
136 | m_textbtn-> setPopupDelay ( 0 ); | ||
137 | connect ( popup, SIGNAL( colorSelected ( const QColor & )), this, SLOT( changeTextColor ( const QColor & ))); | ||
138 | changeTextColor ( m_textcol ); | ||
139 | |||
140 | m_opacsld = new QSlider ( Horizontal, this ); | ||
141 | m_opacsld-> setRange ( -20, 20 ); | ||
142 | m_opacsld-> setValue ( opacity ); | ||
143 | m_opacsld-> setTickmarks ( QSlider::Below ); | ||
144 | grid-> addMultiCellWidget ( m_opacsld, 1, 1, 2, 5 ); | ||
145 | |||
146 | vbox-> addSpacing ( 4 ); | ||
147 | |||
148 | QCheckBox *shadow = new QCheckBox ( tr( "Use shadowed menu text" ), this ); | ||
149 | shadow-> setChecked ( m_shadow ); | ||
150 | vbox-> addWidget ( shadow ); | ||
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 | |||
170 | vbox-> addStretch ( 10 ); | ||
171 | |||
172 | changeType ( m_type ); | ||
173 | |||
174 | connect ( btngrp, SIGNAL( clicked ( int ) ), this, SLOT( changeType ( int ) ) ); | ||
175 | connect ( shadow, SIGNAL( toggled ( bool ) ), this, SLOT( changeShadow ( bool ) ) ); | ||
176 | connect ( windeco, SIGNAL( toggled ( bool ) ), this, SLOT( changeDeco ( bool ) ) ); | ||
177 | } | ||
178 | |||
179 | void LiquidSet::changeType ( int t ) | ||
180 | { | ||
181 | bool custom = ( t == Custom ); | ||
182 | |||
183 | m_menulbl-> setEnabled ( custom ); | ||
184 | m_textlbl-> setEnabled ( custom ); | ||
185 | m_opaclbl-> setEnabled ( custom ); | ||
186 | m_menubtn-> setEnabled ( custom ); | ||
187 | m_textbtn-> setEnabled ( custom ); | ||
188 | m_opacsld-> setEnabled ( custom ); | ||
189 | |||
190 | m_type = t; | ||
191 | } | ||
192 | |||
193 | void LiquidSet::changeMenuColor ( const QColor &col ) | ||
194 | { | ||
195 | changeButtonColor ( m_menubtn, col ); | ||
196 | m_menucol = col; | ||
197 | } | ||
198 | |||
199 | void LiquidSet::changeTextColor ( const QColor &col ) | ||
200 | { | ||
201 | changeButtonColor ( m_textbtn, col ); | ||
202 | m_textcol = col; | ||
203 | } | ||
204 | |||
205 | void LiquidSet::changeShadow ( bool b ) | ||
206 | { | ||
207 | m_shadow = b; | ||
208 | } | ||
209 | |||
210 | void LiquidSet::changeDeco ( bool b ) | ||
211 | { | ||
212 | m_deco = b; | ||
213 | } | ||
214 | |||
215 | |||
216 | void LiquidSet::accept ( ) | ||
217 | { | ||
218 | Config config ( "qpe" ); | ||
219 | config. setGroup ( "Liquid-Style" ); | ||
220 | |||
221 | config. writeEntry ( "Type", m_type ); | ||
222 | config. writeEntry ( "Color", m_menucol. name ( )); | ||
223 | config. writeEntry ( "TextColor", m_textcol. name ( )); | ||
224 | config. writeEntry ( "Opacity", m_opacsld-> value ( )); | ||
225 | config. writeEntry ( "ShadowText", m_shadow ); | ||
226 | config. writeEntry ( "WinDecoration", m_deco ); | ||
227 | config. writeEntry ( "StippleContrast", m_contsld-> value ( )); | ||
228 | config. write ( ); | ||
229 | |||
230 | Global::applyStyle ( ); | ||
231 | |||
232 | QDialog::accept ( ); | ||
233 | } | ||
234 | |||
diff --git a/noncore/styles/liquid/settings/liquidset.h b/noncore/styles/liquid/settings/liquidset.h deleted file mode 100644 index a0f590a..0000000 --- a/noncore/styles/liquid/settings/liquidset.h +++ b/dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | #ifndef __OPIE_LIQUID_SET_H__ | ||
2 | #define __OPIE_LIQUID_SET_H__ | ||
3 | |||
4 | #include <qdialog.h> | ||
5 | #include <qcolor.h> | ||
6 | |||
7 | class QLabel; | ||
8 | class QToolButton; | ||
9 | class QSlider; | ||
10 | |||
11 | class LiquidSet : public QDialog { | ||
12 | Q_OBJECT | ||
13 | |||
14 | public: | ||
15 | LiquidSet ( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 ); | ||
16 | |||
17 | public slots: | ||
18 | void changeType ( int t ); | ||
19 | void changeMenuColor ( const QColor &col ); | ||
20 | void changeTextColor ( const QColor &col ); | ||
21 | void changeShadow ( bool b ); | ||
22 | void changeDeco ( bool b ); | ||
23 | |||
24 | protected: | ||
25 | virtual void accept ( ); | ||
26 | |||
27 | private: | ||
28 | QColor m_menucol; | ||
29 | QColor m_textcol; | ||
30 | int m_type; | ||
31 | bool m_shadow; | ||
32 | bool m_deco; | ||
33 | |||
34 | QSlider * m_opacsld; | ||
35 | QSlider * m_contsld; | ||
36 | QLabel * m_menulbl; | ||
37 | QLabel * m_textlbl; | ||
38 | QLabel * m_opaclbl; | ||
39 | QToolButton *m_menubtn; | ||
40 | QToolButton *m_textbtn; | ||
41 | }; | ||
42 | #endif | ||
diff --git a/noncore/styles/liquid/settings/main.cpp b/noncore/styles/liquid/settings/main.cpp deleted file mode 100644 index fd69007..0000000 --- a/noncore/styles/liquid/settings/main.cpp +++ b/dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | #include "liquidset.h" | ||
22 | |||
23 | #include <qpe/qpeapplication.h> | ||
24 | |||
25 | |||
26 | int main ( int argc, char** argv ) | ||
27 | { | ||
28 | QPEApplication a ( argc, argv ); | ||
29 | |||
30 | LiquidSet dlg; | ||
31 | a. showMainWidget ( &dlg ); | ||
32 | |||
33 | return a. exec ( ); | ||
34 | } | ||
diff --git a/noncore/styles/liquid/settings/settings.pro b/noncore/styles/liquid/settings/settings.pro deleted file mode 100644 index bfda7a4..0000000 --- a/noncore/styles/liquid/settings/settings.pro +++ b/dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | TEMPLATE= app | ||
2 | CONFIG += qt warn_on release | ||
3 | DESTDIR = $(OPIEDIR)/bin | ||
4 | HEADERS = liquidset.h | ||
5 | SOURCES = liquidset.cpp main.cpp | ||
6 | INCLUDEPATH += $(OPIEDIR)/include | ||
7 | DEPENDPATH+= ../$(OPIEDIR)/include | ||
8 | LIBS += -lqpe -lopie | ||
9 | TARGET = liquid-settings | ||
10 | |||
11 | TRANSLATIONS = ../../../../i18n/de/liquid-settings.ts \ | ||
12 | ../../../../i18n/en/liquid-settings.ts \ | ||
13 | ../../../../i18n/es/liquid-settings.ts \ | ||
14 | ../../../../i18n/fr/liquid-settings.ts \ | ||
15 | ../../../../i18n/hu/liquid-settings.ts \ | ||
16 | ../../../../i18n/ja/liquid-settings.ts \ | ||
17 | ../../../../i18n/ko/liquid-settings.ts \ | ||
18 | ../../../../i18n/no/liquid-settings.ts \ | ||
19 | ../../../../i18n/pl/liquid-settings.ts \ | ||
20 | ../../../../i18n/pt/liquid-settings.ts \ | ||
21 | ../../../../i18n/pt_BR/liquid-settings.ts \ | ||
22 | ../../../../i18n/sl/liquid-settings.ts \ | ||
23 | ../../../../i18n/zh_CN/liquid-settings.ts \ | ||
24 | ../../../../i18n/zh_TW/liquid-settings.ts | ||