author | sandman <sandman> | 2002-11-18 03:48:58 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-11-18 03:48:58 (UTC) |
commit | c2d7749ca68a545b67e1b07ffbb65f08da203702 (patch) (unidiff) | |
tree | b5d867ada033b4c98ffaba8bb1d4cfbb8c0e023a /noncore/styles/liquid/opie-liquid.diff | |
parent | ee9696cbb7a39e0f13739ae86cd925b0f675a43c (diff) | |
download | opie-c2d7749ca68a545b67e1b07ffbb65f08da203702.zip opie-c2d7749ca68a545b67e1b07ffbb65f08da203702.tar.gz opie-c2d7749ca68a545b67e1b07ffbb65f08da203702.tar.bz2 |
Optimized Liquid for handhelds:
- removed some dead code from the original liquid
- removed all code related to mouse-hover
- rewrote QToolButton drawing, so navigating toolbars with Menu/Direction
keys looks nicer
- changed the way focus indicators are drawn on many widgets
- support for libqte's with version < 2.3.4
Diffstat (limited to 'noncore/styles/liquid/opie-liquid.diff') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/styles/liquid/opie-liquid.diff | 1117 |
1 files changed, 910 insertions, 207 deletions
diff --git a/noncore/styles/liquid/opie-liquid.diff b/noncore/styles/liquid/opie-liquid.diff index f3531e5..29ae6f3 100644 --- a/noncore/styles/liquid/opie-liquid.diff +++ b/noncore/styles/liquid/opie-liquid.diff | |||
@@ -1,19 +1,19 @@ | |||
1 | This is a patch to mosfet's liquid 0.7. | 1 | This is a patch to mosfet's liquid 0.7. |
2 | Features: | 2 | Features: |
3 | - Qt-only | 3 | - Qt-only |
4 | - works with Qt/E on QPE/OPIE | 4 | - works with Qt/E on QPE/OPIE |
5 | 5 | ||
6 | --- -2002-10-24 03:19:30.000000000 +0200 | 6 | --- -2002-11-18 04:47:41.000000000 +0100 |
7 | +++ liquid.h2002-07-15 02:52:50.000000000 +0200 | 7 | +++ liquid.h2002-11-18 03:32:40.000000000 +0100 |
8 | @@ -2,7 +2,7 @@ | 8 | @@ -2,7 +2,7 @@ |
9 | #define LIQUID_STYLE_H | 9 | #define LIQUID_STYLE_H |
10 | 10 | ||
11 | 11 | ||
12 | -#include <kstyle.h> | 12 | -#include <kstyle.h> |
13 | +#include <qwindowsstyle.h> | 13 | +#include <qwindowsstyle.h> |
14 | #include <qpainter.h> | 14 | #include <qpainter.h> |
15 | #include <qdrawutil.h> | 15 | #include <qdrawutil.h> |
16 | #include <qpalette.h> | 16 | #include <qpalette.h> |
17 | @@ -20,7 +20,7 @@ | 17 | @@ -20,7 +20,7 @@ |
18 | * Copyright (C)QPL 2001 Daniel M. Duley. All rights reserved. | 18 | * Copyright (C)QPL 2001 Daniel M. Duley. All rights reserved. |
19 | */ | 19 | */ |
@@ -93,92 +93,134 @@ Features: | |||
93 | void drawToolButton(QPainter *p, int x, int y, int w, | 93 | void drawToolButton(QPainter *p, int x, int y, int w, |
94 | int h, const QColorGroup &g, | 94 | int h, const QColorGroup &g, |
95 | bool sunken, const QBrush *fill); | 95 | bool sunken, const QBrush *fill); |
96 | - void drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h, | 96 | - void drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h, |
97 | - const QColorGroup &g, QBrush *); | 97 | - const QColorGroup &g, QBrush *); |
98 | - void drawKickerTaskButton(QPainter *p, int x, int y, int w, int h, | 98 | - void drawKickerTaskButton(QPainter *p, int x, int y, int w, int h, |
99 | - const QColorGroup &g, | 99 | - const QColorGroup &g, |
100 | - const QString &title, bool active, | 100 | - const QString &title, bool active, |
101 | - QPixmap *icon, QBrush *fill); | 101 | - QPixmap *icon, QBrush *fill); |
102 | // for repainting toolbuttons when the toolbar is resized | 102 | // for repainting toolbuttons when the toolbar is resized |
103 | bool eventFilter(QObject *obj, QEvent *ev); | 103 | bool eventFilter(QObject *obj, QEvent *ev); |
104 | void drawSliderGroove(QPainter * p, int x, int y, int w, int h, | 104 | void drawSliderGroove(QPainter * p, int x, int y, int w, int h, |
105 | @@ -204,6 +177,7 @@ | 105 | @@ -198,25 +171,15 @@ |
106 | void drawSBButton(QPainter *p, const QRect &r, const QColorGroup &g, | ||
107 | bool down=false, bool fast = true); | ||
108 | void drawRoundRect(QPainter *p, int x, int y, int w, int h); | ||
109 | - void loadCustomButtons(); | ||
110 | - void applyCustomAttributes(QPushButton *btn); | ||
111 | - void unapplyCustomAttributes(QPushButton *btn); | ||
106 | QPixmap* getPixmap(BitmapData item); | 112 | QPixmap* getPixmap(BitmapData item); |
107 | QPixmap* processEmbedded(const char *label, int h, int s, int v, bool blend=false); | 113 | QPixmap* processEmbedded(const char *label, int h, int s, int v, bool blend=false); |
108 | private: | 114 | private: |
115 | - bool highcolor; | ||
116 | - QColorGroup radioOnGrp; | ||
117 | +bool oldqte; | ||
109 | +bool flatTBButtons; | 118 | +bool flatTBButtons; |
110 | bool highcolor; | ||
111 | QColorGroup radioOnGrp; | ||
112 | QWidget *highlightWidget; | 119 | QWidget *highlightWidget; |
113 | --- -2002-10-24 03:19:31.000000000 +0200 | 120 | - QBrush wallpaper; |
114 | +++ liquid.cpp2002-10-24 03:18:15.000000000 +0200 | 121 | - QBitmap lightBmp; |
115 | @@ -10,12 +10,10 @@ | 122 | - QBitmap grayBmp; |
123 | - QBitmap dgrayBmp; | ||
124 | - QBitmap maskBmp; | ||
125 | - QBitmap xBmp; | ||
126 | QBitmap btnMaskBmp, htmlBtnMaskBmp; | ||
127 | QPixmap *btnBorderPix, *btnBlendPix, *bevelFillPix, *smallBevelFillPix, *menuPix; | ||
128 | - QBitmap paper1, paper2, paper3; | ||
129 | - QBrush baseBrush, menuBrush, pagerBrush, pagerHoverBrush, bgBrush; | ||
130 | + QBrush bgBrush, menuBrush; | ||
131 | bool menuAni, menuFade; | ||
132 | |||
133 | QIntDict<QPixmap>btnDict; | ||
134 | @@ -224,9 +187,6 @@ | ||
135 | QIntDict<QPixmap>bevelFillDict; | ||
136 | QIntDict<QPixmap>smallBevelFillDict; | ||
137 | |||
138 | - QList<QColor>customBtnColorList; | ||
139 | - QList<QPixmap>customBtnIconList; | ||
140 | - QStrList customBtnLabelList; | ||
141 | QPixmap *vsbSliderFillPix; | ||
142 | TransMenuHandler *menuHandler; | ||
143 | QPixmap *pixmaps[BITMAP_ITEMS]; | ||
144 | --- -2002-11-18 04:47:41.000000000 +0100 | ||
145 | +++ liquid.cpp2002-11-18 04:46:13.000000000 +0100 | ||
146 | @@ -2,6 +2,9 @@ | ||
147 | * Copyright (C)QPL 2001 Daniel M. Duley. All rights reserved. | ||
148 | */ | ||
149 | |||
150 | +// | ||
151 | +// (c) 2002 Robert 'sandman' Griebl | ||
152 | +// | ||
153 | |||
154 | |||
155 | #ifndef INCLUDE_MENUITEM_DEF | ||
156 | @@ -10,12 +13,10 @@ | ||
116 | 157 | ||
117 | #include <qmenudata.h> | 158 | #include <qmenudata.h> |
118 | #include "liquid.h" | 159 | #include "liquid.h" |
119 | -#include <kapp.h> | 160 | -#include <kapp.h> |
120 | -#include <kglobal.h> | 161 | -#include <kglobal.h> |
121 | -#include <kconfig.h> | 162 | -#include <kconfig.h> |
122 | -#include <kdrawutil.h> | 163 | -#include <kdrawutil.h> |
123 | -#include <kglobalsettings.h> | 164 | -#include <kglobalsettings.h> |
124 | -#include <kpixmapeffect.h> | 165 | -#include <kpixmapeffect.h> |
125 | +//#include "liquiddeco.h" | 166 | +//#include "liquiddeco.h" |
126 | +#include <qapplication.h> | 167 | +#include <qapplication.h> |
127 | +#include <qpe/config.h> | 168 | +#include <qpe/config.h> |
128 | +#include "effects.h" | 169 | +#include "effects.h" |
129 | #include <qpalette.h> | 170 | #include <qpalette.h> |
130 | #include <qbitmap.h> | 171 | #include <qbitmap.h> |
131 | #include <qtabbar.h> | 172 | #include <qtabbar.h> |
132 | @@ -25,28 +23,29 @@ | 173 | @@ -25,28 +26,30 @@ |
133 | #include <qtimer.h> | 174 | #include <qtimer.h> |
134 | #include <qpixmapcache.h> | 175 | #include <qpixmapcache.h> |
135 | #include <qradiobutton.h> | 176 | #include <qradiobutton.h> |
136 | -#include <kimageeffect.h> | 177 | -#include <kimageeffect.h> |
137 | -#include <ktoolbar.h> | 178 | -#include <ktoolbar.h> |
138 | +#include <qcombobox.h> | 179 | +#include <qcombobox.h> |
139 | #include <qdrawutil.h> | 180 | #include <qdrawutil.h> |
140 | #include <qwidgetlist.h> | 181 | #include <qwidgetlist.h> |
141 | #include <qtoolbutton.h> | 182 | #include <qtoolbutton.h> |
142 | #include <qheader.h> | 183 | #include <qheader.h> |
143 | #include <unistd.h> | 184 | #include <unistd.h> |
144 | -#include <klocale.h> | 185 | -#include <klocale.h> |
145 | -#include <kiconloader.h> | 186 | -#include <kiconloader.h> |
146 | -#include <kmenubar.h> | 187 | -#include <kmenubar.h> |
147 | -#include <kipc.h> | 188 | -#include <kipc.h> |
148 | +#include <qmenubar.h> | 189 | +#include <qmenubar.h> |
149 | +#include <qprogressbar.h> | 190 | +#include <qprogressbar.h> |
191 | +#include <qlineedit.h> | ||
150 | 192 | ||
151 | -#include <X11/X.h> | 193 | -#include <X11/X.h> |
152 | -#include <X11/Xlib.h> | 194 | -#include <X11/Xlib.h> |
153 | +#include <stdio.h> | 195 | +#include <stdio.h> |
154 | 196 | ||
155 | #include "htmlmasks.h" | 197 | #include "htmlmasks.h" |
156 | #include "embeddata.h" | 198 | #include "embeddata.h" |
157 | 199 | ||
158 | -void TransMenuHandler::stripePixmap(KPixmap &pix, const QColor &color) | 200 | -void TransMenuHandler::stripePixmap(KPixmap &pix, const QColor &color) |
159 | +typedef void (QStyle::*QDrawMenuBarItemImpl) (QPainter *, int, int, int, int, QMenuItem *, | 201 | +typedef void (QStyle::*QDrawMenuBarItemImpl) (QPainter *, int, int, int, int, QMenuItem *, |
160 | + QColorGroup &, bool, bool); | 202 | + QColorGroup &, bool, bool); |
161 | + | 203 | + |
162 | +QDrawMenuBarItemImpl qt_set_draw_menu_bar_impl(QDrawMenuBarItemImpl impl); | 204 | +QDrawMenuBarItemImpl qt_set_draw_menu_bar_impl(QDrawMenuBarItemImpl impl); |
163 | + | 205 | + |
164 | +void TransMenuHandler::stripePixmap(QPixmap &pix, const QColor &color) | 206 | +void TransMenuHandler::stripePixmap(QPixmap &pix, const QColor &color) |
165 | { | 207 | { |
166 | QImage img(pix.convertToImage()); | 208 | QImage img(pix.convertToImage()); |
167 | - KImageEffect::fade(img, 0.9, color); | 209 | - KImageEffect::fade(img, 0.9, color); |
168 | + QImageEffect::fade(img, 0.9, color); | 210 | + QImageEffect::fade(img, 0.9, color); |
169 | int x, y; | 211 | int x, y; |
170 | int r, g, b; | 212 | int r, g, b; |
171 | for(y=0; y < img.height(); y+=3){ | 213 | for(y=0; y < img.height(); y+=3){ |
172 | @@ -71,35 +70,37 @@ | 214 | @@ -71,35 +74,37 @@ |
173 | : QObject(parent) | 215 | : QObject(parent) |
174 | { | 216 | { |
175 | pixDict.setAutoDelete(true); | 217 | pixDict.setAutoDelete(true); |
176 | - connect(kapp, SIGNAL(kipcMessage(int, int)), this, | 218 | - connect(kapp, SIGNAL(kipcMessage(int, int)), this, |
177 | - SLOT(slotKIPCMessage(int, int))); | 219 | - SLOT(slotKIPCMessage(int, int))); |
178 | reloadSettings(); | 220 | reloadSettings(); |
179 | } | 221 | } |
180 | 222 | ||
181 | void TransMenuHandler::reloadSettings() | 223 | void TransMenuHandler::reloadSettings() |
182 | { | 224 | { |
183 | pixDict.clear(); | 225 | pixDict.clear(); |
184 | - KConfig *config = KGlobal::config(); | 226 | - KConfig *config = KGlobal::config(); |
@@ -211,34 +253,34 @@ Features: | |||
211 | - QPopupMenu *p = (QPopupMenu *)obj; | 253 | - QPopupMenu *p = (QPopupMenu *)obj; |
212 | + QWidget *p = (QWidget *)obj; | 254 | + QWidget *p = (QWidget *)obj; |
213 | 255 | ||
214 | if(ev->type() == QEvent::Show){ | 256 | if(ev->type() == QEvent::Show){ |
215 | if(type == TransStippleBg || type == TransStippleBtn || | 257 | if(type == TransStippleBg || type == TransStippleBtn || |
216 | type == Custom){ | 258 | type == Custom){ |
217 | QApplication::syncX(); | 259 | QApplication::syncX(); |
218 | - KPixmap *pix = new KPixmap; | 260 | - KPixmap *pix = new KPixmap; |
219 | + QPixmap *pix = new QPixmap; | 261 | + QPixmap *pix = new QPixmap; |
220 | if(p->testWFlags(Qt::WType_Popup)){ | 262 | if(p->testWFlags(Qt::WType_Popup)){ |
221 | QRect r(p->x(), p->y(), p->width(), p->height()); | 263 | QRect r(p->x(), p->y(), p->width(), p->height()); |
222 | QRect deskR = QApplication::desktop()->rect(); | 264 | QRect deskR = QApplication::desktop()->rect(); |
223 | @@ -107,7 +108,7 @@ | 265 | @@ -107,7 +112,7 @@ |
224 | r.setBottom(deskR.bottom()); | 266 | r.setBottom(deskR.bottom()); |
225 | r.setRight(deskR.right()); | 267 | r.setRight(deskR.right()); |
226 | } | 268 | } |
227 | - *pix = QPixmap::grabWindow(qt_xrootwin(), r.x(), r.y(), | 269 | - *pix = QPixmap::grabWindow(qt_xrootwin(), r.x(), r.y(), |
228 | + *pix = QPixmap::grabWindow(QApplication::desktop()-> winId(), r.x(), r.y(), | 270 | + *pix = QPixmap::grabWindow(QApplication::desktop()-> winId(), r.x(), r.y(), |
229 | r.width(), r.height()); | 271 | r.width(), r.height()); |
230 | } | 272 | } |
231 | else{ // tear off menu | 273 | else{ // tear off menu |
232 | @@ -121,82 +122,53 @@ | 274 | @@ -121,82 +126,61 @@ |
233 | stripePixmap(*pix, p->colorGroup().button()); | 275 | stripePixmap(*pix, p->colorGroup().button()); |
234 | } | 276 | } |
235 | else{ | 277 | else{ |
236 | - KPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color); | 278 | - KPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color); |
237 | + QPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color); | 279 | + QPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color); |
238 | } | 280 | } |
239 | + | 281 | + |
240 | pixDict.insert(p->winId(), pix); | 282 | pixDict.insert(p->winId(), pix); |
241 | + | 283 | + |
242 | + if ( !p->inherits("QPopupMenu")) | 284 | + if ( !p->inherits("QPopupMenu")) |
243 | + p->setBackgroundPixmap(*pix); | 285 | + p->setBackgroundPixmap(*pix); |
244 | + | 286 | + |
@@ -257,29 +299,29 @@ Features: | |||
257 | type == Custom){ | 299 | type == Custom){ |
258 | - qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width()); | 300 | - qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width()); |
259 | - pixDict.remove(p->winId()); | 301 | - pixDict.remove(p->winId()); |
260 | - } | 302 | - } |
261 | - } | 303 | - } |
262 | - return(false); | 304 | - return(false); |
263 | -} | 305 | -} |
264 | - | 306 | - |
265 | -void TransMenuHandler::slotKIPCMessage(int id, int) | 307 | -void TransMenuHandler::slotKIPCMessage(int id, int) |
266 | -{ | 308 | -{ |
267 | - if(id == LIQUID_MENU_CHANGE){ | 309 | - if(id == LIQUID_MENU_CHANGE){ |
268 | - bool oldShadow = shadowText; | 310 | - bool oldShadow = shadowText; |
269 | +// qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width()); | 311 | - |
270 | |||
271 | - KConfig *config = KGlobal::config(); | 312 | - KConfig *config = KGlobal::config(); |
272 | - config->reparseConfiguration(); // in case KControl changed values | 313 | - config->reparseConfiguration(); // in case KControl changed values |
273 | - | 314 | +// qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width()); |
315 | |||
274 | - // Make sure no popupmenus are shown. There shouldn't be any because | 316 | - // Make sure no popupmenus are shown. There shouldn't be any because |
275 | - // the user just clicked "Apply", but there can be tear offs ;-) | 317 | - // the user just clicked "Apply", but there can be tear offs ;-) |
276 | - // We just close them so the pixmaps are deleted and regenerated. | 318 | - // We just close them so the pixmaps are deleted and regenerated. |
277 | - QWidgetList *list = QApplication::topLevelWidgets(); | 319 | - QWidgetList *list = QApplication::topLevelWidgets(); |
278 | - QWidgetListIt it( *list ); | 320 | - QWidgetListIt it( *list ); |
279 | - QWidget *w; | 321 | - QWidget *w; |
280 | - while ((w=it.current()) != 0 ){ | 322 | - while ((w=it.current()) != 0 ){ |
281 | - ++it; | 323 | - ++it; |
282 | - if(w->inherits("QPopupMenu")){ | 324 | - if(w->inherits("QPopupMenu")){ |
283 | - w->close(); | 325 | - w->close(); |
284 | - } | 326 | - } |
285 | - } | 327 | - } |
@@ -290,79 +332,305 @@ Features: | |||
290 | - reloadSettings(); | 332 | - reloadSettings(); |
291 | + QObjectList *ol = p-> queryList("QWidget"); | 333 | + QObjectList *ol = p-> queryList("QWidget"); |
292 | + for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { | 334 | + for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { |
293 | + QWidget *wid = (QWidget *) it.current ( ); | 335 | + QWidget *wid = (QWidget *) it.current ( ); |
294 | 336 | ||
295 | - // Now repaint menubar if needed | 337 | - // Now repaint menubar if needed |
296 | - if(shadowText != oldShadow){ | 338 | - if(shadowText != oldShadow){ |
297 | - it.toFirst(); | 339 | - it.toFirst(); |
298 | - while ((w=it.current()) != 0 ){ | 340 | - while ((w=it.current()) != 0 ){ |
299 | - ++it; | 341 | - ++it; |
300 | - if(w->inherits("QMenuBar")){ | 342 | - if(w->inherits("QMenuBar")){ |
301 | - w->repaint(); | 343 | - w->repaint(); |
344 | - } | ||
345 | - } | ||
302 | + wid-> setBackgroundMode( QWidget::PaletteBackground ); | 346 | + wid-> setBackgroundMode( QWidget::PaletteBackground ); |
303 | } | ||
304 | + delete ol; | ||
305 | } | ||
306 | } | 347 | } |
307 | - } | 348 | - } |
308 | - else if(id == MOSFET_BUTTON_CHANGE){ | 349 | - else if(id == MOSFET_BUTTON_CHANGE){ |
309 | - qWarning("In mosfet button change"); | 350 | - qWarning("In mosfet button change"); |
310 | - // really, this should be in LiquidStyle, but what the hell? ;-) | 351 | - // really, this should be in LiquidStyle, but what the hell? ;-) |
311 | - QWidgetList *list = QApplication::allWidgets(); | 352 | - QWidgetList *list = QApplication::allWidgets(); |
312 | - QWidgetListIt it( *list ); | 353 | - QWidgetListIt it( *list ); |
313 | - QWidget *w; | 354 | - QWidget *w; |
314 | - while ((w=it.current()) != 0 ){ | 355 | - while ((w=it.current()) != 0 ){ |
315 | - ++it; | 356 | - ++it; |
316 | - if(w->inherits("QPushButton")){ | 357 | - if(w->inherits("QPushButton")){ |
317 | - ((LiquidStyle*)parent())->unapplyCustomAttributes((QPushButton *)w); | 358 | - ((LiquidStyle*)parent())->unapplyCustomAttributes((QPushButton *)w); |
318 | - } | 359 | - } |
319 | - } | 360 | - } |
320 | - ((LiquidStyle*)parent())->loadCustomButtons(); | 361 | - ((LiquidStyle*)parent())->loadCustomButtons(); |
321 | - it.toFirst(); | 362 | - it.toFirst(); |
322 | - while ((w=it.current()) != 0 ){ | 363 | - while ((w=it.current()) != 0 ){ |
323 | - ++it; | 364 | - ++it; |
324 | - if(w->inherits("QPushButton")){ | 365 | - if(w->inherits("QPushButton")){ |
325 | - ((LiquidStyle*)parent())->applyCustomAttributes((QPushButton *)w); | 366 | - ((LiquidStyle*)parent())->applyCustomAttributes((QPushButton *)w); |
326 | - } | 367 | + delete ol; |
327 | - } | 368 | } |
328 | - | 369 | } |
329 | - } | ||
330 | + return(false); | 370 | + return(false); |
371 | +} | ||
372 | |||
373 | - } | ||
374 | + | ||
375 | +static int qt_version ( ) | ||
376 | +{ | ||
377 | +const char *qver = qVersion ( ); | ||
378 | +return ( qver [0] - '0' ) * 100 + ( qver [2] - '0' ) * 10 + ( qver [4] - '0' ); | ||
331 | } | 379 | } |
332 | 380 | ||
333 | + | 381 | + |
334 | LiquidStyle::LiquidStyle() | 382 | LiquidStyle::LiquidStyle() |
335 | - :KStyle() | 383 | - :KStyle() |
336 | + :QWindowsStyle() | 384 | + :QWindowsStyle() |
337 | { | 385 | { |
338 | + setName ( "LiquidStyle" ); | 386 | + setName ( "LiquidStyle" ); |
339 | + | 387 | + |
388 | +oldqte = ( qt_version ( ) < 234 ); | ||
340 | +flatTBButtons = false; | 389 | +flatTBButtons = false; |
341 | + | 390 | + |
342 | btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true); | 391 | btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true); |
343 | btnMaskBmp.setMask(btnMaskBmp); | 392 | btnMaskBmp.setMask(btnMaskBmp); |
344 | htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true); | 393 | htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true); |
345 | @@ -711,7 +683,6 @@ | 394 | @@ -207,12 +191,8 @@ |
395 | btnDict.setAutoDelete(true); | ||
396 | bevelFillDict.setAutoDelete(true); | ||
397 | smallBevelFillDict.setAutoDelete(true); | ||
398 | - customBtnColorList.setAutoDelete(true); | ||
399 | - customBtnIconList.setAutoDelete(true); | ||
400 | - customBtnLabelList.setAutoDelete(true); | ||
401 | |||
402 | rMatrix.rotate(270.0); | ||
403 | - highcolor = QPixmap::defaultDepth() > 8; | ||
404 | btnBorderPix = new QPixmap; | ||
405 | btnBorderPix->convertFromImage(qembed_findImage("buttonfill")); | ||
406 | btnBlendPix = new QPixmap; | ||
407 | @@ -572,131 +552,119 @@ | ||
408 | case HTMLBtnBorderDown: | ||
409 | pixmaps[HTMLBtnBorderDown] = processEmbedded("htmlbtnborder", btnHoverH, btnHoverS, btnHoverV); | ||
410 | break; | ||
411 | + | ||
412 | case HTMLCB: | ||
413 | pixmaps[HTMLCB] = processEmbedded("htmlcheckbox", bH, bS, bV); | ||
414 | break; | ||
415 | + case HTMLCBHover: | ||
416 | + pixmaps[HTMLCBHover] = processEmbedded("htmlcheckbox", btnHoverH, btnHoverS, btnHoverV); | ||
417 | + break; | ||
418 | case HTMLCBDown: | ||
419 | pixmaps[HTMLCBDown] = processEmbedded("htmlcheckboxdown", btnH, btnS, btnV); | ||
420 | break; | ||
421 | - case HTMLCBHover: | ||
422 | - pixmaps[HTMLCBHover] = processEmbedded("htmlcheckbox", btnH, btnS, btnV); | ||
423 | - break; | ||
424 | case HTMLCBDownHover: | ||
425 | - pixmaps[HTMLCBDownHover] = processEmbedded("htmlcheckboxdown", | ||
426 | - btnHoverH, btnHoverS, | ||
427 | - btnHoverV); | ||
428 | + pixmaps[HTMLCBDownHover] = processEmbedded("htmlcheckboxdown", btnHoverH, btnHoverS, btnHoverV); | ||
429 | break; | ||
430 | + | ||
431 | case HTMLRadio: | ||
432 | pixmaps[HTMLRadio] = processEmbedded("htmlradio", bH, bS, bV); | ||
433 | + break; | ||
434 | + case HTMLRadioHover: | ||
435 | + pixmaps[HTMLRadioHover] = processEmbedded("htmlradio", btnHoverH, btnHoverS, btnHoverV); | ||
436 | + break; | ||
437 | case HTMLRadioDown: | ||
438 | pixmaps[HTMLRadioDown] = processEmbedded("htmlradiodown", btnH, btnS, btnV); | ||
439 | - case HTMLRadioHover: | ||
440 | - pixmaps[HTMLRadioHover] = processEmbedded("htmlradio", btnH, btnS, btnV); | ||
441 | + break; | ||
442 | case HTMLRadioDownHover: | ||
443 | - pixmaps[HTMLRadioDownHover] = processEmbedded("htmlradiodown", | ||
444 | - btnHoverH, btnHoverS, | ||
445 | - btnHoverV); | ||
446 | + pixmaps[HTMLRadioDownHover] = processEmbedded("htmlradiodown", btnHoverH, btnHoverS, btnHoverV); | ||
447 | + break; | ||
448 | + | ||
449 | + case RadioOff: | ||
450 | + pixmaps[RadioOff] = processEmbedded("radio", bH, bS, bV /*, true*/); | ||
451 | + break; | ||
452 | + case RadioOffHover: | ||
453 | + pixmaps[RadioOffHover] = processEmbedded("radio", btnHoverH, btnHoverS, btnHoverV /*, true*/); | ||
454 | + break; | ||
455 | case RadioOn: | ||
456 | - pixmaps[RadioOn] = processEmbedded("radio_down", btnH, btnS, btnV, true); | ||
457 | + pixmaps[RadioOn] = processEmbedded("radio_down", btnH, btnS, btnV /*, true*/); | ||
458 | break; | ||
459 | case RadioOnHover: | ||
460 | - pixmaps[RadioOnHover] = processEmbedded("radio_down", btnHoverH, btnHoverS, | ||
461 | - btnHoverV, true); | ||
462 | + pixmaps[RadioOnHover] = processEmbedded("radio_down", btnHoverH, btnHoverS, btnHoverV /*, true*/); | ||
463 | break; | ||
464 | - case RadioOffHover: | ||
465 | - pixmaps[RadioOffHover] = processEmbedded("radio", btnH, btnS, btnV, true); | ||
466 | + | ||
467 | + case Tab: | ||
468 | + pixmaps[Tab] = processEmbedded("tab", bH, bS, bV /*, true*/); | ||
469 | break; | ||
470 | case TabDown: | ||
471 | - pixmaps[TabDown] = processEmbedded("tab", btnH, btnS, btnV, true); | ||
472 | + pixmaps[TabDown] = processEmbedded("tab", btnH, btnS, btnV /*, true*/); | ||
473 | break; | ||
474 | case TabFocus: | ||
475 | - pixmaps[TabFocus] = processEmbedded("tab", btnHoverH, btnHoverS, | ||
476 | - btnHoverS, true); | ||
477 | - break; | ||
478 | - case CBDown: | ||
479 | - pixmaps[CBDown] = processEmbedded("checkboxdown", btnH, btnS, btnV, true); | ||
480 | + pixmaps[TabFocus] = processEmbedded("tab", btnHoverH, btnHoverS, btnHoverV /*, true*/); | ||
481 | break; | ||
482 | - case CBDownHover: | ||
483 | - pixmaps[CBDownHover] = processEmbedded("checkboxdown", btnHoverH, | ||
484 | - btnHoverS, btnHoverV, true); | ||
485 | + | ||
486 | +case CB: | ||
487 | + pixmaps[CB] = processEmbedded("checkbox", bH, bS, bV /*, true*/); | ||
488 | break; | ||
489 | case CBHover: | ||
490 | - pixmaps[CBHover] = processEmbedded("checkbox", btnH, btnS, btnV, true); | ||
491 | + pixmaps[CBHover] = processEmbedded("checkbox", btnHoverH, btnHoverS, btnHoverV /*, true*/); | ||
492 | break; | ||
493 | - case HSlider: | ||
494 | - pixmaps[HSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true); | ||
495 | + case CBDown: | ||
496 | + pixmaps[CBDown] = processEmbedded("checkboxdown", btnH, btnS, btnV /*, true*/); | ||
497 | break; | ||
498 | + case CBDownHover: | ||
499 | + pixmaps[CBDownHover] = processEmbedded("checkboxdown", btnHoverH, btnHoverS, btnHoverV /*, true*/); | ||
500 | + break; | ||
501 | + | ||
502 | case VSlider: | ||
503 | - pixmaps[VSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true); | ||
504 | + pixmaps[VSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true ); | ||
505 | *pixmaps[VSlider] = pixmaps[VSlider]->xForm(rMatrix); | ||
506 | break; | ||
507 | - case RadioOff: | ||
508 | - pixmaps[RadioOff] = processEmbedded("radio", bH, bS, bV, true); | ||
509 | - break; | ||
510 | - case Tab: | ||
511 | - pixmaps[Tab] = processEmbedded("tab", bH, bS, bV, true); | ||
512 | - break; | ||
513 | - case CB: | ||
514 | - pixmaps[CB] = processEmbedded("checkbox", bH, bS, bV, true); | ||
515 | - break; | ||
516 | case VSBSliderTop: | ||
517 | - pixmaps[VSBSliderTop] = processEmbedded("sbslider_top", btnH, btnS, btnV, true); | ||
518 | + case VSBSliderTopHover: | ||
519 | + pixmaps[item] = processEmbedded("sbslider_top", btnH, btnS, btnV /*, true*/); | ||
520 | break; | ||
521 | case VSBSliderBtm: | ||
522 | - pixmaps[VSBSliderBtm] = processEmbedded("sbslider_btm", btnH, btnS, btnV, true); | ||
523 | + case VSBSliderBtmHover: | ||
524 | + pixmaps[item] = processEmbedded("sbslider_btm", btnH, btnS, btnV /*, true*/); | ||
525 | break; | ||
526 | case VSBSliderMid: | ||
527 | - pixmaps[VSBSliderMid] = processEmbedded("sbslider_mid", btnH, btnS, btnV); | ||
528 | + case VSBSliderMidHover: | ||
529 | + pixmaps[item] = processEmbedded("sbslider_mid", btnH, btnS, btnV); | ||
530 | break; | ||
531 | - case VSBSliderTopHover: | ||
532 | - pixmaps[VSBSliderTopHover] = processEmbedded("sbslider_top", btnHoverH, btnHoverS, btnHoverV, true); | ||
533 | +case VSBSliderTopBg: | ||
534 | + pixmaps[VSBSliderTopBg] = processEmbedded("sbslider_top", bH, bS, bV /*, true*/); | ||
535 | break; | ||
536 | - case VSBSliderBtmHover: | ||
537 | - pixmaps[VSBSliderBtmHover] = processEmbedded("sbslider_btm", btnHoverH, btnHoverS, btnHoverV, true); | ||
538 | + case VSBSliderBtmBg: | ||
539 | + pixmaps[VSBSliderBtmBg] = processEmbedded("sbslider_btm", bH, bS, bV /*, true*/); | ||
540 | break; | ||
541 | - case VSBSliderMidHover: | ||
542 | - pixmaps[VSBSliderMidHover] = processEmbedded("sbslider_mid", btnHoverH, btnHoverS, btnHoverV); | ||
543 | + case VSBSliderMidBg: | ||
544 | + pixmaps[VSBSliderMidBg] = processEmbedded("sbslider_mid", bH, bS, bV); | ||
545 | break; | ||
546 | |||
547 | - case HSBSliderTop: | ||
548 | - pixmaps[HSBSliderTop] = processEmbedded("sbslider_top", btnH, btnS, btnV, true); | ||
549 | - *pixmaps[HSBSliderTop] = pixmaps[HSBSliderTop]->xForm(rMatrix); | ||
550 | - break; | ||
551 | - case HSBSliderBtm: | ||
552 | - pixmaps[HSBSliderBtm] = processEmbedded("sbslider_btm", btnH, btnS, btnV, true); | ||
553 | - *pixmaps[HSBSliderBtm] = pixmaps[HSBSliderBtm]->xForm(rMatrix); | ||
554 | - break; | ||
555 | - case HSBSliderMid: | ||
556 | - pixmaps[HSBSliderMid] = processEmbedded("sbslider_mid", btnH, btnS, btnV); | ||
557 | - *pixmaps[HSBSliderMid] = pixmaps[HSBSliderMid]->xForm(rMatrix); | ||
558 | +case HSlider: | ||
559 | + pixmaps[HSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV /*, true*/); | ||
560 | break; | ||
561 | + case HSBSliderTop: | ||
562 | case HSBSliderTopHover: | ||
563 | - pixmaps[HSBSliderTopHover] = processEmbedded("sbslider_top", btnHoverH, btnHoverS, btnHoverV, true); | ||
564 | - *pixmaps[HSBSliderTopHover] = pixmaps[HSBSliderTopHover]->xForm(rMatrix); | ||
565 | + pixmaps[item] = processEmbedded("sbslider_top", btnH, btnS, btnV, true ); | ||
566 | + *pixmaps[item] = pixmaps[item]->xForm(rMatrix); | ||
567 | break; | ||
568 | + case HSBSliderBtm: | ||
569 | case HSBSliderBtmHover: | ||
570 | - pixmaps[HSBSliderBtmHover] = processEmbedded("sbslider_btm", btnHoverH, btnHoverS, btnHoverV, true); | ||
571 | - *pixmaps[HSBSliderBtmHover] = pixmaps[HSBSliderBtmHover]->xForm(rMatrix); | ||
572 | + pixmaps[item] = processEmbedded("sbslider_btm", btnH, btnS, btnV, true ); | ||
573 | + *pixmaps[item] = pixmaps[item]->xForm(rMatrix); | ||
574 | break; | ||
575 | + case HSBSliderMid: | ||
576 | case HSBSliderMidHover: | ||
577 | - pixmaps[HSBSliderMidHover] = processEmbedded("sbslider_mid", btnHoverH, btnHoverS, btnHoverV); | ||
578 | - *pixmaps[HSBSliderMidHover] = pixmaps[HSBSliderMidHover]->xForm(rMatrix); | ||
579 | - break; | ||
580 | - case VSBSliderTopBg: | ||
581 | - pixmaps[VSBSliderTopBg] = processEmbedded("sbslider_top", bH, bS, bV, true); | ||
582 | - break; | ||
583 | - case VSBSliderBtmBg: | ||
584 | - pixmaps[VSBSliderBtmBg] = processEmbedded("sbslider_btm", bH, bS, bV, true); | ||
585 | - break; | ||
586 | - case VSBSliderMidBg: | ||
587 | - pixmaps[VSBSliderMidBg] = processEmbedded("sbslider_mid", bH, bS, bV); | ||
588 | + pixmaps[item] = processEmbedded("sbslider_mid", btnH, btnS, btnV); | ||
589 | + *pixmaps[item] = pixmaps[item]->xForm(rMatrix); | ||
590 | break; | ||
591 | case HSBSliderTopBg: | ||
592 | - pixmaps[HSBSliderTopBg] = processEmbedded("sbslider_top", bH, bS, bV, true); | ||
593 | + pixmaps[HSBSliderTopBg] = processEmbedded("sbslider_top", bH, bS, bV, true ); | ||
594 | *pixmaps[HSBSliderTopBg] = pixmaps[HSBSliderTopBg]->xForm(rMatrix); | ||
595 | break; | ||
596 | case HSBSliderBtmBg: | ||
597 | - pixmaps[HSBSliderBtmBg] = processEmbedded("sbslider_btm", bH, bS, bV, true); | ||
598 | + pixmaps[HSBSliderBtmBg] = processEmbedded("sbslider_btm", bH, bS, bV, true ); | ||
599 | *pixmaps[HSBSliderBtmBg] = pixmaps[HSBSliderBtmBg]->xForm(rMatrix); | ||
600 | break; | ||
601 | case HSBSliderMidBg: | ||
602 | @@ -711,7 +679,6 @@ | ||
346 | 603 | ||
347 | void LiquidStyle::polish(QPalette &appPal) | 604 | void LiquidStyle::polish(QPalette &appPal) |
348 | { | 605 | { |
349 | - | 606 | - |
350 | int i; | 607 | int i; |
351 | for(i=0; i < BITMAP_ITEMS; ++i){ | 608 | for(i=0; i < BITMAP_ITEMS; ++i){ |
352 | if(pixmaps[i]){ | 609 | if(pixmaps[i]){ |
353 | @@ -730,20 +701,29 @@ | 610 | @@ -719,31 +686,28 @@ |
611 | pixmaps[i] = NULL; | ||
612 | } | ||
354 | } | 613 | } |
355 | 614 | - QWidgetList *list = QApplication::allWidgets(); | |
356 | loadCustomButtons(); | 615 | - QWidgetListIt it( *list ); |
616 | - QWidget *w; | ||
617 | - while ((w=it.current()) != 0 ){ | ||
618 | - ++it; | ||
619 | - if(w->inherits("QPushButton")){ | ||
620 | - unapplyCustomAttributes((QPushButton *)w); | ||
621 | - } | ||
622 | - } | ||
623 | - | ||
624 | - loadCustomButtons(); | ||
357 | - lowLightVal = 100 + (2*KGlobalSettings::contrast()+4)*10; | 625 | - lowLightVal = 100 + (2*KGlobalSettings::contrast()+4)*10; |
358 | + lowLightVal = 100 + (2* /*KGlobalSettings::contrast()*/ 3 +4)*10; | 626 | + lowLightVal = 100 + (2* /*KGlobalSettings::contrast()*/ 3 +4)*10; |
359 | btnDict.clear(); | 627 | btnDict.clear(); |
360 | btnBorderDict.clear(); | 628 | btnBorderDict.clear(); |
361 | bevelFillDict.clear(); | 629 | bevelFillDict.clear(); |
362 | smallBevelFillDict.clear(); | 630 | smallBevelFillDict.clear(); |
363 | 631 | ||
364 | - KConfig *config = KGlobal::config(); | 632 | - KConfig *config = KGlobal::config(); |
365 | - QString oldGrp = config->group(); | 633 | - QString oldGrp = config->group(); |
366 | - QPalette pal = QApplication::palette(); | 634 | - QPalette pal = QApplication::palette(); |
367 | + Config config ( "qpe" ); | 635 | + Config config ( "qpe" ); |
368 | + config. setGroup ( "Liquid-Style" ); | 636 | + config. setGroup ( "Liquid-Style" ); |
@@ -370,78 +638,112 @@ Features: | |||
370 | +if ( contrast < 0 ) | 638 | +if ( contrast < 0 ) |
371 | + contrast = 0; | 639 | + contrast = 0; |
372 | +else if ( contrast > 10 ) | 640 | +else if ( contrast > 10 ) |
373 | + contrast = 10; | 641 | + contrast = 10; |
374 | + | 642 | + |
375 | +// QPalette pal = QApplication::palette(); | 643 | +// QPalette pal = QApplication::palette(); |
376 | 644 | ||
377 | // button color stuff | 645 | // button color stuff |
378 | - config->setGroup("General"); | 646 | - config->setGroup("General"); |
379 | - QColor c = config->readColorEntry("buttonBackground", &Qt::lightGray); | 647 | - QColor c = config->readColorEntry("buttonBackground", &Qt::lightGray); |
380 | - if(c == config->readColorEntry("background", &Qt::lightGray)){ | 648 | - if(c == config->readColorEntry("background", &Qt::lightGray)){ |
381 | + config. setGroup ( "Appearance" ); | 649 | + config. setGroup ( "Appearance" ); |
382 | + QColor c = // QColor ( config. readEntry("Button", ( Qt::lightGray ). name ( ))); | 650 | + QColor c = oldqte ? QColor ( config. readEntry("Button", ( Qt::lightGray ). name ( ))) |
383 | + appPal. color ( QPalette::Active, QColorGroup::Button ); | 651 | + : appPal. color ( QPalette::Active, QColorGroup::Button ); |
384 | + if ( c == appPal. color ( QPalette::Active, QColorGroup::Background ) | 652 | + if ( c == ( oldqte ? QColor ( config. readEntry ( "background", ( Qt::lightGray ). name ( ))) |
385 | + //QColor ( config. readEntry ( "background", ( Qt::lightGray ). name ( ))) | 653 | + : appPal. color ( QPalette::Active, QColorGroup::Background ))) { |
386 | + ) { | ||
387 | // force button color to be different from background | 654 | // force button color to be different from background |
388 | QBrush btnBrush(QColor(200, 202, 228)); | 655 | QBrush btnBrush(QColor(200, 202, 228)); |
389 | appPal.setBrush(QColorGroup::Button, btnBrush); | 656 | appPal.setBrush(QColorGroup::Button, btnBrush); |
390 | @@ -794,15 +774,7 @@ | 657 | @@ -778,8 +742,8 @@ |
391 | pagerBrush.setPixmap(*pix); | 658 | adjustHSV(*pix, h, s, v); |
659 | smallBevelFillDict.insert(c.rgb(), pix); | ||
660 | } | ||
661 | - pagerHoverBrush.setColor(c); | ||
662 | - pagerHoverBrush.setPixmap(*pix); | ||
663 | +// pagerHoverBrush.setColor(c); | ||
664 | +// pagerHoverBrush.setPixmap(*pix); | ||
665 | |||
666 | c = c.dark(120); | ||
667 | pix = smallBevelFillDict.find(c.rgb()); // better be NULL ;-) | ||
668 | @@ -790,19 +754,13 @@ | ||
669 | adjustHSV(*pix, h, s, v); | ||
670 | smallBevelFillDict.insert(c.rgb(), pix); | ||
671 | } | ||
672 | - pagerBrush.setColor(c); | ||
673 | - pagerBrush.setPixmap(*pix); | ||
674 | +// pagerBrush.setColor(c); | ||
675 | +// pagerBrush.setPixmap(*pix); | ||
392 | 676 | ||
393 | // background color stuff | 677 | // background color stuff |
394 | - c = config->readColorEntry("background", &Qt::lightGray); | 678 | - c = config->readColorEntry("background", &Qt::lightGray); |
395 | - if(qstrcmp(kapp->argv()[0], "kicker") == 0){ | 679 | - if(qstrcmp(kapp->argv()[0], "kicker") == 0){ |
396 | - appPal.setColor(QColorGroup::Mid, menuBrush.color().dark(110)); | 680 | - appPal.setColor(QColorGroup::Mid, menuBrush.color().dark(110)); |
397 | - appPal.setColor(QColorGroup::Dark, menuBrush.color().dark(130)); | 681 | - appPal.setColor(QColorGroup::Dark, menuBrush.color().dark(130)); |
398 | - appPal.setColor(QColorGroup::Midlight, menuBrush.color().light(110)); | 682 | - appPal.setColor(QColorGroup::Midlight, menuBrush.color().light(110)); |
399 | - appPal.setColor(QColorGroup::Light, menuBrush.color().light(115)); | 683 | - appPal.setColor(QColorGroup::Light, menuBrush.color().light(115)); |
400 | - menuBrush.setColor(c); // hack - used for kicker applets | 684 | - menuBrush.setColor(c); // hack - used for kicker applets |
401 | - appPal.setBrush(QColorGroup::Background, menuBrush); | 685 | - appPal.setBrush(QColorGroup::Background, menuBrush); |
402 | - } | 686 | - } |
403 | + c = /*QColor ( config. readEntry ( "Background", ( Qt::lightGray ).name ( )));*/ appPal. color ( QPalette::Active, QColorGroup::Background ); | 687 | + c = oldqte ? QColor ( config. readEntry ( "Background", ( Qt::lightGray ).name ( ))) |
688 | + : appPal. color ( QPalette::Active, QColorGroup::Background ); | ||
689 | + | ||
404 | c.hsv(&bH, &bS, &bV); | 690 | c.hsv(&bH, &bS, &bV); |
405 | c.light(120).hsv(&bHoverH, &bHoverS, &bHoverV); | 691 | c.light(120).hsv(&bHoverH, &bHoverS, &bHoverV); |
406 | 692 | ||
407 | @@ -817,21 +789,18 @@ | 693 | @@ -817,101 +775,50 @@ |
408 | wallPaper.fill(c.rgb()); | 694 | wallPaper.fill(c.rgb()); |
409 | painter.begin(&wallPaper); | 695 | painter.begin(&wallPaper); |
410 | for(i=0; i < 32; i+=4){ | 696 | for(i=0; i < 32; i+=4){ |
411 | - painter.setPen(c.dark(105)); | 697 | - painter.setPen(c.dark(105)); |
412 | + painter.setPen(c.dark(100 + contrast)); | 698 | + painter.setPen(c.dark(100 + contrast)); |
413 | painter.drawLine(0, i, 32, i); | 699 | painter.drawLine(0, i, 32, i); |
414 | - painter.setPen(c.dark(103)); | 700 | - painter.setPen(c.dark(103)); |
415 | + painter.setPen(c.dark(100 + 3 * contrast / 5 ) ); | 701 | + painter.setPen(c.dark(100 + 3 * contrast / 5 ) ); |
416 | painter.drawLine(0, i+1, 32, i+1); | 702 | painter.drawLine(0, i+1, 32, i+1); |
417 | }; | 703 | }; |
418 | painter.end(); | 704 | painter.end(); |
419 | bgBrush.setColor(c); | 705 | bgBrush.setColor(c); |
420 | bgBrush.setPixmap(wallPaper); | 706 | bgBrush.setPixmap(wallPaper); |
421 | - if(qstrcmp(kapp->argv()[0], "kicker") != 0 && | 707 | - if(qstrcmp(kapp->argv()[0], "kicker") != 0 && |
422 | - qstrcmp(kapp->argv()[0], "ksplash") != 0){ | 708 | - qstrcmp(kapp->argv()[0], "ksplash") != 0){ |
423 | appPal.setBrush(QColorGroup::Background, bgBrush); | 709 | appPal.setBrush(QColorGroup::Background, bgBrush); |
424 | - } | 710 | - } |
425 | 711 | - | |
426 | // lineedits | 712 | - // lineedits |
427 | - c = config->readColorEntry("windowBackground", &Qt::white); | 713 | - c = config->readColorEntry("windowBackground", &Qt::white); |
428 | + c = /*QColor ( config. readEntry("Base", ( Qt::white). name ( )));*/ appPal. color ( QPalette::Active, QColorGroup::Base ); | 714 | - QPixmap basePix; |
429 | QPixmap basePix; | 715 | - basePix.resize(32, 32); |
430 | basePix.resize(32, 32); | 716 | - basePix.fill(c.rgb()); |
431 | basePix.fill(c.rgb()); | 717 | - painter.begin(&basePix); |
432 | @@ -856,52 +825,37 @@ | 718 | - painter.setPen(c.dark(105)); |
433 | applyCustomAttributes((QPushButton *)w); | 719 | - for(i=0; i < 32; i+=4){ |
434 | } | 720 | - painter.drawLine(0, i, 32, i); |
435 | } | 721 | - painter.drawLine(0, i+1, 32, i+1); |
722 | - }; | ||
723 | - painter.end(); | ||
724 | - baseBrush.setColor(c); | ||
725 | - baseBrush.setPixmap(basePix); | ||
726 | - it.toFirst(); | ||
727 | - while ((w=it.current()) != 0 ){ | ||
728 | - ++it; | ||
729 | - if(w->inherits("QLineEdit")){ | ||
730 | - QPalette pal = w->palette(); | ||
731 | - pal.setBrush(QColorGroup::Base, baseBrush); | ||
732 | - w->setPalette(pal); | ||
733 | - } | ||
734 | - else if(w->inherits("QPushButton")){ | ||
735 | - applyCustomAttributes((QPushButton *)w); | ||
736 | - } | ||
737 | - } | ||
436 | - | 738 | - |
437 | - config->setGroup(oldGrp); | 739 | - config->setGroup(oldGrp); |
438 | } | 740 | } |
439 | 741 | ||
440 | void LiquidStyle::polish(QWidget *w) | 742 | void LiquidStyle::polish(QWidget *w) |
441 | { | 743 | { |
442 | if(w->inherits("QMenuBar")){ | 744 | if(w->inherits("QMenuBar")){ |
443 | - ((QFrame*)w)->setLineWidth(0); | 745 | - ((QFrame*)w)->setLineWidth(0); |
444 | - w->setBackgroundMode(QWidget::NoBackground); | 746 | - w->setBackgroundMode(QWidget::NoBackground); |
445 | + //((QFrame*)w)->setLineWidth(0); | 747 | + //((QFrame*)w)->setLineWidth(0); |
446 | + w->setBackgroundMode(QWidget::PaletteBackground); | 748 | + w->setBackgroundMode(QWidget::PaletteBackground); |
447 | + w->setBackgroundOrigin(QWidget::ParentOrigin); | 749 | + w->setBackgroundOrigin(QWidget::ParentOrigin); |
@@ -480,65 +782,70 @@ Features: | |||
480 | - pal.setColor(QColorGroup::Light, bgBrush.color().light(120)); | 782 | - pal.setColor(QColorGroup::Light, bgBrush.color().light(120)); |
481 | - w->setPalette(pal); | 783 | - w->setPalette(pal); |
482 | - } | 784 | - } |
483 | - } | 785 | - } |
484 | return; | 786 | return; |
485 | } | 787 | } |
486 | - if(qstrcmp(kapp->argv()[0], "kicker") == 0 && | 788 | - if(qstrcmp(kapp->argv()[0], "kicker") == 0 && |
487 | - w->inherits("KPanelExtension")){ // FIXME - doesn't work | 789 | - w->inherits("KPanelExtension")){ // FIXME - doesn't work |
488 | - w->setPalette(kapp->palette()); | 790 | - w->setPalette(kapp->palette()); |
489 | - } | 791 | - } |
490 | 792 | ||
491 | - if(w->inherits("QComboBox") || | 793 | - if(w->inherits("QComboBox") || |
492 | + if(w->inherits("QComboBox") || w->inherits("QProgressBar") || | 794 | - w->inherits("QLineEdit") || w->inherits("QRadioButton") || |
493 | w->inherits("QLineEdit") || w->inherits("QRadioButton") || | ||
494 | - w->inherits("QCheckBox") || w->inherits("QScrollBar") || | 795 | - w->inherits("QCheckBox") || w->inherits("QScrollBar") || |
495 | - w->isA("AppletHandle") || w->inherits("KMiniPagerButton") || | 796 | - w->isA("AppletHandle") || w->inherits("KMiniPagerButton") || |
496 | - w->inherits("TaskContainer")){ | 797 | - w->inherits("TaskContainer")){ |
497 | + w->inherits("QCheckBox") || w->inherits("QScrollBar")) { | 798 | + if(w->inherits("QRadioButton") || w->inherits("QCheckBox") || w->inherits("QProgressBar")) { |
498 | w->installEventFilter(this); | ||
499 | } | ||
500 | if(w->inherits("QLineEdit")){ | ||
501 | @@ -913,6 +867,10 @@ | ||
502 | applyCustomAttributes((QPushButton *)w); | ||
503 | w->installEventFilter(this); | 799 | w->installEventFilter(this); |
504 | } | 800 | } |
801 | - if(w->inherits("QLineEdit")){ | ||
802 | - QPalette pal = w->palette(); | ||
803 | - pal.setBrush(QColorGroup::Base, baseBrush); | ||
804 | - w->setPalette(pal); | ||
805 | - } | ||
806 | - if(w->inherits("QPushButton")){ | ||
807 | - applyCustomAttributes((QPushButton *)w); | ||
808 | - w->installEventFilter(this); | ||
809 | + | ||
505 | + if(w->inherits("QButton") || w-> inherits("QComboBox")){ | 810 | + if(w->inherits("QButton") || w-> inherits("QComboBox")){ |
506 | + w-> setBackgroundMode ( QWidget::PaletteBackground ); | 811 | + w-> setBackgroundMode ( QWidget::PaletteBackground ); |
507 | + w->setBackgroundOrigin ( QWidget::ParentOrigin); | 812 | + w->setBackgroundOrigin ( QWidget::ParentOrigin); |
508 | + } | 813 | } |
509 | 814 | ||
510 | bool isViewport = qstrcmp(w->name(), "qt_viewport") == 0 || | 815 | bool isViewport = qstrcmp(w->name(), "qt_viewport") == 0 || |
511 | qstrcmp(w->name(), "qt_clipped_viewport") == 0; | 816 | @@ -942,11 +849,20 @@ |
512 | @@ -942,11 +900,17 @@ | ||
513 | w->setMouseTracking(true); | 817 | w->setMouseTracking(true); |
514 | w->installEventFilter(this); | 818 | w->installEventFilter(this); |
515 | } | 819 | } |
516 | + if(w-> inherits("QToolButton")&&w->parent()->inherits("QToolBar")) { | 820 | + if(w-> inherits("QToolButton")) { |
517 | + ((QToolButton*)w)->setAutoRaise (flatTBButtons); | 821 | + if (w->parent()->inherits("QToolBar")) { |
518 | + if ( flatTBButtons ) | 822 | + ((QToolButton*)w)->setAutoRaise (flatTBButtons); |
519 | + w->setBackgroundOrigin(QWidget::ParentOrigin); | 823 | + if ( flatTBButtons ) |
824 | + w->setBackgroundOrigin(QWidget::ParentOrigin); | ||
825 | + } | ||
826 | + w-> installEventFilter ( this ); | ||
520 | + } | 827 | + } |
521 | + if(w-> inherits("QToolBarSeparator")&&w->parent()->inherits("QToolBar")) { | 828 | + if(w-> inherits("QToolBarSeparator")&&w->parent()->inherits("QToolBar")) { |
522 | + ((QFrame *) w)-> setFrameShape ( QFrame::NoFrame ); | 829 | + ((QFrame *) w)-> setFrameShape ( QFrame::NoFrame ); |
523 | + } | 830 | + } |
524 | if(w->ownPalette() && !w->inherits("QButton") && !w->inherits("QComboBox")){ | 831 | if(w->ownPalette() && !w->inherits("QButton") && !w->inherits("QComboBox")){ |
525 | return; | 832 | return; |
526 | } | 833 | } |
527 | - if(w->inherits("PanelButtonBase")) | 834 | - if(w->inherits("PanelButtonBase")) |
528 | - return; | 835 | - return; |
529 | 836 | ||
530 | if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())-> | 837 | if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())-> |
531 | palette().active().brush(QColorGroup::Background).pixmap()){ | 838 | palette().active().brush(QColorGroup::Background).pixmap()){ |
532 | @@ -954,16 +918,21 @@ | 839 | @@ -954,16 +870,21 @@ |
533 | return; | 840 | return; |
534 | } | 841 | } |
535 | if(!isViewport && !isViewportChild && !w->testWFlags(WType_Popup) && | 842 | if(!isViewport && !isViewportChild && !w->testWFlags(WType_Popup) && |
536 | - !w->inherits("KDesktop") && !w->inherits("PasswordDlg")){ | 843 | - !w->inherits("KDesktop") && !w->inherits("PasswordDlg")){ |
537 | + !( !w-> inherits("QLineEdit") && w-> parent() && w-> parent()-> isWidgetType ( ) && w-> parent()-> inherits ( "QMultiLineEdit" ))) { | 844 | + !( !w-> inherits("QLineEdit") && w-> parent() && w-> parent()-> isWidgetType ( ) && w-> parent()-> inherits ( "QMultiLineEdit" ))) { |
538 | if(w->backgroundMode() == QWidget::PaletteBackground || | 845 | if(w->backgroundMode() == QWidget::PaletteBackground || |
539 | w->backgroundMode() == QWidget::PaletteButton){ | 846 | w->backgroundMode() == QWidget::PaletteButton){ |
540 | - w->setBackgroundMode(QWidget::X11ParentRelative); | 847 | - w->setBackgroundMode(QWidget::X11ParentRelative); |
541 | + w->setBackgroundMode(w->parentWidget()->backgroundMode( )/*QWidget::X11ParentRelative*/); | 848 | + w->setBackgroundMode(w->parentWidget()->backgroundMode( )/*QWidget::X11ParentRelative*/); |
542 | + w->setBackgroundOrigin(QWidget::ParentOrigin); | 849 | + w->setBackgroundOrigin(QWidget::ParentOrigin); |
543 | +// w->setBackgroundMode(QWidget::NoBackground); | 850 | +// w->setBackgroundMode(QWidget::NoBackground); |
544 | } | 851 | } |
@@ -548,77 +855,83 @@ Features: | |||
548 | - //w->setBackgroundMode(QWidget::NoBackground); | 855 | - //w->setBackgroundMode(QWidget::NoBackground); |
549 | - return; | 856 | - return; |
550 | + if ( !w-> inherits("QFrame") || (((QFrame*) w)-> frameShape () == QFrame::NoFrame )) | 857 | + if ( !w-> inherits("QFrame") || (((QFrame*) w)-> frameShape () == QFrame::NoFrame )) |
551 | + w-> setBackgroundOrigin ( QWidget::ParentOrigin ); | 858 | + w-> setBackgroundOrigin ( QWidget::ParentOrigin ); |
552 | +else if ( w-> inherits("QFrame") ) | 859 | +else if ( w-> inherits("QFrame") ) |
553 | + w->setBackgroundOrigin ( QWidget::WidgetOrigin ); | 860 | + w->setBackgroundOrigin ( QWidget::WidgetOrigin ); |
554 | + | 861 | + |
555 | +if ( w->parentWidget()->inherits ( "QWidgetStack" )) { | 862 | +if ( w->parentWidget()->inherits ( "QWidgetStack" )) { |
556 | + w->setBackgroundOrigin ( QWidget::WidgetOrigin ); | 863 | + w->setBackgroundOrigin ( QWidget::WidgetOrigin ); |
557 | } | 864 | } |
558 | } | 865 | } |
559 | 866 | ||
560 | @@ -977,6 +946,11 @@ | 867 | @@ -977,6 +898,11 @@ |
561 | 868 | ||
562 | if(w->inherits("QPopupMenu")) | 869 | if(w->inherits("QPopupMenu")) |
563 | w->setBackgroundMode(QWidget::PaletteButton); | 870 | w->setBackgroundMode(QWidget::PaletteButton); |
564 | + else if(w-> testWFlags(Qt::WType_Popup) && | 871 | + else if(w-> testWFlags(Qt::WType_Popup) && |
565 | + !w->inherits("QListBox") && | 872 | + !w->inherits("QListBox") && |
566 | + ( qstrcmp ( w-> name(), "automatic what's this? widget" ) != 0 )) { | 873 | + ( qstrcmp ( w-> name(), "automatic what's this? widget" ) != 0 )) { |
567 | + w->removeEventFilter(menuHandler); | 874 | + w->removeEventFilter(menuHandler); |
568 | + } | 875 | + } |
569 | 876 | ||
570 | if(w->isTopLevel()) | 877 | if(w->isTopLevel()) |
571 | return; | 878 | return; |
572 | @@ -986,7 +960,7 @@ | 879 | @@ -986,7 +912,7 @@ |
573 | ((qstrcmp(w->parent()->name(), "qt_viewport") == 0) || | 880 | ((qstrcmp(w->parent()->name(), "qt_viewport") == 0) || |
574 | (qstrcmp(w->parent()->name(), "qt_clipped_viewport") == 0)); | 881 | (qstrcmp(w->parent()->name(), "qt_clipped_viewport") == 0)); |
575 | 882 | ||
576 | - w->setPalette(QApplication::palette()); | 883 | - w->setPalette(QApplication::palette()); |
577 | + w->unsetPalette(); | 884 | + w->unsetPalette(); |
578 | if(w->backgroundMode() == QWidget::X11ParentRelative || isViewportChild){ | 885 | if(w->backgroundMode() == QWidget::X11ParentRelative || isViewportChild){ |
579 | if(w->inherits("QPushButton")) | 886 | if(w->inherits("QPushButton")) |
580 | w->setBackgroundMode(QWidget::PaletteButton); | 887 | w->setBackgroundMode(QWidget::PaletteButton); |
581 | @@ -1001,12 +975,14 @@ | 888 | @@ -997,16 +923,12 @@ |
582 | unapplyCustomAttributes((QPushButton *)w); | 889 | if(isViewportChild) |
583 | w->removeEventFilter(this); | 890 | w->setAutoMask(false); |
584 | } | 891 | |
585 | - | 892 | - if(w->inherits("QPushButton")){ |
893 | - unapplyCustomAttributes((QPushButton *)w); | ||
894 | - w->removeEventFilter(this); | ||
586 | +/* | 895 | +/* |
587 | + if(w->inherits("QPushButton") || w-> inherits("QComboBox")){ | 896 | + if(w->inherits("QPushButton") || w-> inherits("QComboBox")){ |
588 | + w-> setBackgroundMode ( PaletteBackground ); | 897 | + w-> setBackgroundMode ( PaletteBackground ); |
589 | + } | 898 | } |
590 | +*/ | 899 | - |
591 | if(w->inherits("QComboBox") || | 900 | - if(w->inherits("QComboBox") || |
592 | w->inherits("QLineEdit") || w->inherits("QRadioButton") || | 901 | - w->inherits("QLineEdit") || w->inherits("QRadioButton") || |
593 | - w->inherits("QCheckBox") || w->inherits("QScrollBar") || | 902 | - w->inherits("QCheckBox") || w->inherits("QScrollBar") || |
594 | - w->isA("AppletHandle") || w->inherits("KMiniPagerButton") || | 903 | - w->isA("AppletHandle") || w->inherits("KMiniPagerButton") || |
595 | - w->inherits("TaskContainer")){ | 904 | - w->inherits("TaskContainer")){ |
596 | + w->inherits("QCheckBox") || w->inherits("QScrollBar")) { | 905 | +*/ |
906 | + if( w->inherits("QRadioButton") || w->inherits("QCheckBox") || w->inherits("QProgressBar")) { | ||
597 | w->removeEventFilter(this); | 907 | w->removeEventFilter(this); |
598 | } | 908 | } |
599 | if(w->inherits("QButton") || w->inherits("QComboBox")){ | 909 | if(w->inherits("QButton") || w->inherits("QComboBox")){ |
600 | @@ -1014,9 +990,9 @@ | 910 | @@ -1014,9 +936,12 @@ |
601 | w->setAutoMask(false); | 911 | w->setAutoMask(false); |
602 | } | 912 | } |
603 | } | 913 | } |
604 | - if(w->inherits("KToolBar")){ | 914 | - if(w->inherits("KToolBar")){ |
915 | + if(w-> inherits("QToolButton")) { | ||
916 | + w-> removeEventFilter ( this ); | ||
917 | + } | ||
605 | + if(w->inherits("QToolBar")){ | 918 | + if(w->inherits("QToolBar")){ |
606 | w->removeEventFilter(this); | 919 | w->removeEventFilter(this); |
607 | - //w->setBackgroundMode(QWidget::PaletteBackground); | 920 | - //w->setBackgroundMode(QWidget::PaletteBackground); |
608 | + w->setBackgroundMode(QWidget::PaletteBackground); | 921 | + w->setBackgroundMode(QWidget::PaletteBackground); |
609 | return; | 922 | return; |
610 | } | 923 | } |
611 | if(w->inherits("QHeader")){ | 924 | if(w->inherits("QHeader")){ |
612 | @@ -1028,22 +1004,98 @@ | 925 | @@ -1028,22 +953,118 @@ |
613 | void LiquidStyle::polish(QApplication *app) | 926 | void LiquidStyle::polish(QApplication *app) |
614 | { | 927 | { |
615 | 928 | ||
616 | - KStyle::polish(app); | 929 | - KStyle::polish(app); |
617 | + QWindowsStyle::polish(app); | 930 | + QWindowsStyle::polish(app); |
618 | menuAni = app->isEffectEnabled(UI_AnimateMenu); | 931 | menuAni = app->isEffectEnabled(UI_AnimateMenu); |
619 | menuFade = app->isEffectEnabled(UI_FadeMenu); | 932 | menuFade = app->isEffectEnabled(UI_FadeMenu); |
620 | if(menuAni) | 933 | if(menuAni) |
621 | app->setEffectEnabled(UI_AnimateMenu, false); | 934 | app->setEffectEnabled(UI_AnimateMenu, false); |
622 | if(menuFade) | 935 | if(menuFade) |
623 | app->setEffectEnabled(UI_FadeMenu, false); | 936 | app->setEffectEnabled(UI_FadeMenu, false); |
624 | + | 937 | + |
@@ -697,38 +1010,58 @@ Features: | |||
697 | + | 1010 | + |
698 | + if ( progress ( )>= 0 && totalSteps ( ) > 0 ) { | 1011 | + if ( progress ( )>= 0 && totalSteps ( ) > 0 ) { |
699 | + QString pstr; | 1012 | + QString pstr; |
700 | + pstr. sprintf ( "%d%%", 100 * progress()/totalSteps ()); | 1013 | + pstr. sprintf ( "%d%%", 100 * progress()/totalSteps ()); |
701 | + p. setPen ( g.text());//g.highlightedText ( )); | 1014 | + p. setPen ( g.text());//g.highlightedText ( )); |
702 | + p. drawText (x,y,w-1,h-1,AlignCenter,pstr); | 1015 | + p. drawText (x,y,w-1,h-1,AlignCenter,pstr); |
703 | + } | 1016 | + } |
704 | + } | 1017 | + } |
705 | +} | 1018 | +} |
706 | +}; | 1019 | +}; |
707 | + | 1020 | + |
708 | + | 1021 | + |
1022 | +/* | ||
1023 | + * The same for QToolButton: | ||
1024 | + * TT hardcoded the drawing of the focus rect ... | ||
1025 | + * | ||
1026 | + * - sandman | ||
1027 | + */ | ||
1028 | + | ||
1029 | + | ||
1030 | +class HackToolButton : public QToolButton { | ||
1031 | +public: | ||
1032 | +HackToolButton ( ); | ||
1033 | + | ||
1034 | +void paint ( QPaintEvent *ev ) | ||
1035 | +{ | ||
1036 | + erase ( ev-> region ( )); | ||
1037 | + QPainter p ( this ); | ||
1038 | + style ( ). drawToolButton ( this, &p ); | ||
1039 | + drawButtonLabel ( &p ); | ||
1040 | +} | ||
1041 | +}; | ||
709 | + | 1042 | + |
710 | /* | 1043 | /* |
711 | * This is a fun method ;-) Here's an overview. KToolBar grabs resize to | 1044 | * This is a fun method ;-) Here's an overview. KToolBar grabs resize to |
712 | * force everything to erase and repaint on resize. This is going away, I'm | 1045 | * force everything to erase and repaint on resize. This is going away, I'm |
713 | @@ -1063,7 +1115,7 @@ | 1046 | @@ -1063,7 +1084,7 @@ |
714 | */ | 1047 | */ |
715 | bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev) | 1048 | bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev) |
716 | { | 1049 | { |
717 | - if(obj->inherits("KToolBar")){ | 1050 | - if(obj->inherits("KToolBar")){ |
718 | + if(obj->inherits("QToolBar")){ | 1051 | + if(obj->inherits("QToolBar")){ |
719 | if(ev->type() == QEvent::Resize){ | 1052 | if(ev->type() == QEvent::Resize){ |
720 | const QObjectList *tbChildList = obj->children(); | 1053 | const QObjectList *tbChildList = obj->children(); |
721 | QObjectListIt it(*tbChildList); | 1054 | QObjectListIt it(*tbChildList); |
722 | @@ -1076,35 +1128,7 @@ | 1055 | @@ -1076,116 +1097,27 @@ |
723 | 1056 | ||
724 | } | 1057 | } |
725 | } | 1058 | } |
726 | - else if(obj->inherits("KMiniPagerButton")){ | 1059 | - else if(obj->inherits("KMiniPagerButton")){ |
727 | - QButton *btn = (QButton *)obj; | 1060 | - QButton *btn = (QButton *)obj; |
728 | - if(ev->type() == QEvent::Paint){ | 1061 | - if(ev->type() == QEvent::Paint){ |
729 | - if(!(btn->isOn() || btn->isDown())){ | 1062 | - if(!(btn->isOn() || btn->isDown())){ |
730 | - QPalette pal = btn->palette(); | 1063 | - QPalette pal = btn->palette(); |
731 | - pal.setBrush(QColorGroup::Dark, btn == highlightWidget ? | 1064 | - pal.setBrush(QColorGroup::Dark, btn == highlightWidget ? |
732 | - pagerHoverBrush : pagerBrush); | 1065 | - pagerHoverBrush : pagerBrush); |
733 | - btn->setPalette(pal); | 1066 | - btn->setPalette(pal); |
734 | - } | 1067 | - } |
@@ -743,51 +1076,173 @@ Features: | |||
743 | - else if(ev->type() == QEvent::Enter){ | 1076 | - else if(ev->type() == QEvent::Enter){ |
744 | - highlightWidget = btn; | 1077 | - highlightWidget = btn; |
745 | - btn->repaint(false); | 1078 | - btn->repaint(false); |
746 | - } | 1079 | - } |
747 | - else if(ev->type() == QEvent::Leave){ | 1080 | - else if(ev->type() == QEvent::Leave){ |
748 | - highlightWidget = NULL; | 1081 | - highlightWidget = NULL; |
749 | - btn->repaint(false); | 1082 | - btn->repaint(false); |
750 | - } | 1083 | - } |
751 | - | 1084 | - |
752 | - } | 1085 | - } |
753 | - else if(obj->inherits("QPushButton") || obj->inherits("QComboBox") || | 1086 | - else if(obj->inherits("QPushButton") || obj->inherits("QComboBox") || |
754 | - obj->isA("AppletHandle")){ | 1087 | - obj->isA("AppletHandle")){ |
755 | + else if(obj->inherits("QPushButton") || obj->inherits("QComboBox")){ | 1088 | - QWidget *btn = (QWidget *)obj; |
756 | QWidget *btn = (QWidget *)obj; | 1089 | - if(ev->type() == QEvent::Enter){ |
757 | if(ev->type() == QEvent::Enter){ | 1090 | - if(btn->isEnabled()){ |
758 | if(btn->isEnabled()){ | 1091 | - highlightWidget = btn; |
759 | @@ -1119,20 +1143,7 @@ | 1092 | - btn->repaint(false); |
760 | } | 1093 | - } |
761 | } | 1094 | - } |
762 | } | 1095 | - else if(ev->type() == QEvent::Leave){ |
1096 | - if(btn == highlightWidget){ | ||
1097 | - highlightWidget = NULL; | ||
1098 | - btn->repaint(false); | ||
1099 | - } | ||
1100 | - } | ||
1101 | - } | ||
763 | - else if(obj->inherits("TaskContainer")){ | 1102 | - else if(obj->inherits("TaskContainer")){ |
764 | - QButton *btn = (QButton *)obj; | 1103 | - QButton *btn = (QButton *)obj; |
765 | - QPalette pal = btn->palette(); | 1104 | - QPalette pal = btn->palette(); |
766 | - if(ev->type() == QEvent::Enter){ | 1105 | - if(ev->type() == QEvent::Enter){ |
767 | - pal.setColor(QColorGroup::Background, pal.active().button().light(110)); | 1106 | - pal.setColor(QColorGroup::Background, pal.active().button().light(110)); |
768 | - btn->setPalette(pal); | 1107 | - btn->setPalette(pal); |
769 | - } | 1108 | - } |
770 | - else if(ev->type() == QEvent::Leave){ | 1109 | - else if(ev->type() == QEvent::Leave){ |
771 | - pal.setColor(QColorGroup::Background, | 1110 | - pal.setColor(QColorGroup::Background, |
772 | - QApplication::palette().active().background()); | 1111 | - QApplication::palette().active().background()); |
773 | - btn->setPalette(pal); | 1112 | - btn->setPalette(pal); |
774 | - } | 1113 | - } |
775 | - } | 1114 | - } |
776 | - else if(obj->inherits("QToolButton") && !obj->inherits("KToolBarButton")){ | 1115 | - else if(obj->inherits("QToolButton") && !obj->inherits("KToolBarButton")){ |
1116 | - QToolButton *btn = (QToolButton *)btn; | ||
1117 | - if(!btn->autoRaise()){ | ||
777 | + else if(obj->inherits("QToolButton")){ | 1118 | + else if(obj->inherits("QToolButton")){ |
778 | QToolButton *btn = (QToolButton *)btn; | 1119 | + QToolButton *btn = (QToolButton *)obj; |
779 | if(!btn->autoRaise()){ | 1120 | + if(ev->type() == QEvent::FocusIn ){ // && !btn-> autoRaise () |
780 | if(btn->isEnabled()){ | 1121 | if(btn->isEnabled()){ |
781 | @@ -1290,7 +1301,24 @@ | 1122 | highlightWidget = btn; |
1123 | btn->repaint(false); | ||
1124 | + | ||
1125 | + qDebug ( "TB FOCUS IN [%p]", btn ); | ||
1126 | } | ||
1127 | } | ||
1128 | - else if(ev->type() == QEvent::Leave){ | ||
1129 | - QWidget *btn = (QWidget *)obj; | ||
1130 | + else if(ev->type() == QEvent::FocusOut ){ | ||
1131 | if(btn == highlightWidget){ | ||
1132 | highlightWidget = NULL; | ||
1133 | btn->repaint(false); | ||
1134 | + | ||
1135 | + qDebug ( "TB FOCUS OUT [%p]", btn ); | ||
1136 | } | ||
1137 | } | ||
1138 | - else | ||
1139 | - highlightWidget = NULL; | ||
1140 | - } | ||
1141 | - else if(obj->inherits("QScrollBar")){ | ||
1142 | - QScrollBar *sb = (QScrollBar *)obj; | ||
1143 | - if(ev->type() == QEvent::Enter){ | ||
1144 | - if(sb->isEnabled()){ | ||
1145 | - highlightWidget = sb; | ||
1146 | - sb->repaint(false); | ||
1147 | - } | ||
1148 | - } | ||
1149 | - else if(ev->type() == QEvent::Leave){ | ||
1150 | - if(sb == highlightWidget && !sb->draggingSlider()){ | ||
1151 | - highlightWidget = NULL; | ||
1152 | - sb->repaint(false); | ||
1153 | - } | ||
1154 | - } | ||
1155 | - else if(ev->type() == QEvent::MouseButtonRelease){ | ||
1156 | - QMouseEvent *me = (QMouseEvent *)ev; | ||
1157 | - if(sb == highlightWidget && !sb->rect().contains(me->pos())){ | ||
1158 | - highlightWidget = NULL; | ||
1159 | - sb->repaint(false); | ||
1160 | - } | ||
1161 | - } | ||
1162 | - } | ||
1163 | - else if(obj->inherits("QLineEdit")){ | ||
1164 | - if(obj->parent() && obj->parent()->inherits("QComboBox")){ | ||
1165 | - QWidget *btn = (QComboBox *)obj->parent(); | ||
1166 | - if(ev->type() == QEvent::Enter){ | ||
1167 | - if (btn->isEnabled()){ | ||
1168 | - highlightWidget = btn; | ||
1169 | - btn->repaint(false); | ||
1170 | - } | ||
1171 | - } | ||
1172 | - else if(ev->type() == QEvent::Leave){ | ||
1173 | - if (btn == highlightWidget) | ||
1174 | - highlightWidget = NULL; | ||
1175 | - btn->repaint(false); | ||
1176 | - } | ||
1177 | + else if(ev->type() == QEvent::Paint) { | ||
1178 | + (( HackToolButton *) btn )-> paint ((QPaintEvent *) ev ); | ||
1179 | + return true; | ||
1180 | } | ||
1181 | } | ||
1182 | else if(obj->inherits("QRadioButton") || obj->inherits("QCheckBox")){ | ||
1183 | @@ -1201,6 +1133,7 @@ | ||
1184 | QSize sz = isRadio ? exclusiveIndicatorSize() | ||
1185 | : indicatorSize(); | ||
1186 | |||
1187 | +/* | ||
1188 | if(btn->hasFocus()){ | ||
1189 | QRect r = QRect(0, 0, btn->width(), btn->height()); | ||
1190 | p.setPen(btn->colorGroup().button().dark(140)); | ||
1191 | @@ -1209,6 +1142,7 @@ | ||
1192 | p.drawLine(r.right(), r.y()+1, r.right(), r.bottom()-1); | ||
1193 | p.drawLine(r.x()+1, r.bottom(), r.right()-1, r.bottom()); | ||
1194 | } | ||
1195 | +*/ | ||
1196 | int x = 0; | ||
1197 | int y = (btn->height()-lsz.height()+fm.height()-sz.height())/2; | ||
1198 | if(isRadio) | ||
1199 | @@ -1228,36 +1162,6 @@ | ||
1200 | p.end(); | ||
1201 | return(true); | ||
1202 | } | ||
1203 | - // for hover, just redraw the indicator (not the text) | ||
1204 | - else if((ev->type() == QEvent::Enter && btn->isEnabled()) || | ||
1205 | - (ev->type() == QEvent::Leave && btn == highlightWidget)){ | ||
1206 | - QButton *btn = (QButton *)obj; | ||
1207 | - bool isRadio = obj->inherits("QRadioButton"); | ||
1208 | - | ||
1209 | - if(ev->type() == QEvent::Enter) | ||
1210 | - highlightWidget = btn; | ||
1211 | - else | ||
1212 | - highlightWidget = NULL; | ||
1213 | - QFontMetrics fm = btn->fontMetrics(); | ||
1214 | - QSize lsz = fm.size(ShowPrefix, btn->text()); | ||
1215 | - QSize sz = isRadio ? exclusiveIndicatorSize() | ||
1216 | - : indicatorSize(); | ||
1217 | - int x = 0; | ||
1218 | - int y = (btn->height()-lsz.height()+fm.height()-sz.height())/2; | ||
1219 | - //if(btn->autoMask()) | ||
1220 | - // btn->erase(x+1, y+1, sz.width()-2, sz.height()-2); | ||
1221 | - QPainter p; | ||
1222 | - p.begin(btn); | ||
1223 | - if(isRadio) | ||
1224 | - drawExclusiveIndicator(&p, x, y, sz.width(), sz.height(), | ||
1225 | - btn->colorGroup(), btn->isOn(), | ||
1226 | - btn->isDown(), btn->isEnabled()); | ||
1227 | - else | ||
1228 | - drawIndicator(&p, x, y, sz.width(), sz.height(), | ||
1229 | - btn->colorGroup(), btn->state(), btn->isDown(), | ||
1230 | - btn->isEnabled()); | ||
1231 | - p.end(); | ||
1232 | - } | ||
1233 | } | ||
1234 | else if(obj->inherits("QHeader")){ | ||
1235 | QHeader *hw = (QHeader *)obj; | ||
1236 | @@ -1290,7 +1194,24 @@ | ||
782 | } | 1237 | } |
783 | } | 1238 | } |
784 | } | 1239 | } |
785 | - return(false); | 1240 | - return(false); |
786 | + else if (obj-> inherits( "QProgressBar" )) { | 1241 | + else if (obj-> inherits( "QProgressBar" )) { |
787 | + if ( ev->type() == QEvent::Paint ) { | 1242 | + if ( ev->type() == QEvent::Paint ) { |
788 | + HackProgressBar *p = (HackProgressBar *) obj; | 1243 | + HackProgressBar *p = (HackProgressBar *) obj; |
789 | + const QColorGroup &g = p-> colorGroup ( ); | 1244 | + const QColorGroup &g = p-> colorGroup ( ); |
790 | + | 1245 | + |
791 | + QPixmap *pix = bevelFillDict.find(g.button().dark(120).rgb()); | 1246 | + QPixmap *pix = bevelFillDict.find(g.button().dark(120).rgb()); |
792 | + if(!pix){ | 1247 | + if(!pix){ |
793 | + int h, s, v; | 1248 | + int h, s, v; |
@@ -795,213 +1250,406 @@ Features: | |||
795 | + pix = new QPixmap(*bevelFillPix); | 1250 | + pix = new QPixmap(*bevelFillPix); |
796 | + adjustHSV(*pix, h, s, v); | 1251 | + adjustHSV(*pix, h, s, v); |
797 | + bevelFillDict.insert(g.button().dark(120).rgb(), pix); | 1252 | + bevelFillDict.insert(g.button().dark(120).rgb(), pix); |
798 | + } | 1253 | + } |
799 | + p-> paint ((QPaintEvent *) ev, g, pix ); | 1254 | + p-> paint ((QPaintEvent *) ev, g, pix ); |
800 | + return true; | 1255 | + return true; |
801 | + } | 1256 | + } |
802 | + } | 1257 | + } |
803 | +return false ; | 1258 | +return false ; |
804 | } | 1259 | } |
805 | 1260 | ||
806 | void LiquidStyle::drawButton(QPainter *p, int x, int y, int w, int h, | 1261 | void LiquidStyle::drawButton(QPainter *p, int x, int y, int w, int h, |
807 | @@ -1340,11 +1368,6 @@ | 1262 | @@ -1325,8 +1246,11 @@ |
1263 | } | ||
1264 | |||
1265 | p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix); | ||
1266 | + qDebug ( "DRAW TOOLBUTTON IN PIXMAP" ); | ||
1267 | } | ||
1268 | else{ | ||
1269 | + qDebug ( "DRAW TOOLBUTTON sunken=%d/high=%p/device=%p", sunken, highlightWidget,p->device() ); | ||
1270 | + | ||
1271 | drawClearBevel(p, x, y, w, h, sunken ? g.button() : | ||
1272 | highlightWidget == p->device() ? g.button().light(110) : | ||
1273 | g.background(), g.background()); | ||
1274 | @@ -1340,11 +1264,6 @@ | ||
808 | QColorGroup g = btn->colorGroup(); | 1275 | QColorGroup g = btn->colorGroup(); |
809 | 1276 | ||
810 | 1277 | ||
811 | - QColor testColor; | 1278 | - QColor testColor; |
812 | - if(btn->parent() && btn->parent()->isWidgetType()){ | 1279 | - if(btn->parent() && btn->parent()->isWidgetType()){ |
813 | - testColor = p->backgroundColor(); // remove me | 1280 | - testColor = p->backgroundColor(); // remove me |
814 | - } | 1281 | - } |
815 | - | 1282 | - |
816 | //int dw = buttonDefaultIndicatorWidth(); | 1283 | //int dw = buttonDefaultIndicatorWidth(); |
817 | if(btn->hasFocus() || btn->isDefault()){ | 1284 | if(btn->hasFocus() || btn->isDefault()){ |
818 | QColor c = btn->hasFocus() ? g.button().light(110) : g.background(); | 1285 | QColor c = btn->hasFocus() ? g.button().light(110) : g.background(); |
819 | @@ -1596,7 +1619,7 @@ | 1286 | @@ -1488,7 +1407,20 @@ |
1287 | const QColorGroup &g, bool sunken, | ||
1288 | bool edit, bool, const QBrush *) | ||
1289 | { | ||
1290 | - bool isHover = highlightWidget == painter->device(); | ||
1291 | + bool isActive = false; | ||
1292 | + if (( painter->device()->devType() == QInternal::Widget ) && | ||
1293 | + ( | ||
1294 | + ( qApp-> focusWidget ( ) == painter-> device ( )) || | ||
1295 | + ( | ||
1296 | + edit && | ||
1297 | + ((QWidget *) painter-> device ( ))-> inherits ( "QComboBox" ) && | ||
1298 | + ( qApp-> focusWidget ( ) == ((QComboBox *) painter->device())->lineEdit ( )) | ||
1299 | + ) | ||
1300 | + ) | ||
1301 | + ) { | ||
1302 | + isActive = true; | ||
1303 | + } | ||
1304 | + | ||
1305 | bool isMasked = false; | ||
1306 | if(painter->device()->devType() == QInternal::Widget) | ||
1307 | isMasked = ((QWidget*)painter->device())->autoMask(); | ||
1308 | @@ -1498,7 +1430,7 @@ | ||
1309 | |||
1310 | drawRoundButton(&p, g.button(), g.background(), 0, 0, w, h, false, | ||
1311 | sunken, false, isMasked); | ||
1312 | - if(!isHover){ | ||
1313 | + if(!isActive){ | ||
1314 | p.setClipRect(0, 0, w-17, h); | ||
1315 | drawRoundButton(&p, g.background(), g.background(), 0, 0, w, h, false, | ||
1316 | sunken, false, isMasked); | ||
1317 | @@ -1550,16 +1482,17 @@ | ||
1318 | return(QRect(x+9, y+3, w - (h / 3) - 20, h-6)); | ||
1319 | } | ||
1320 | |||
1321 | -QRect LiquidStyle::comboButtonFocusRect(int x, int y, int w, int h) | ||
1322 | +QRect LiquidStyle::comboButtonFocusRect(int /*x*/, int /*y*/, int /*w*/, int /*h*/) | ||
1323 | { | ||
1324 | - return(QRect(x+5, y+3, w-(h/3)-13, h-5)); | ||
1325 | +return QRect ( ); | ||
1326 | + | ||
1327 | +// return(QRect(x+5, y+3, w-(h/3)-13, h-5)); | ||
1328 | } | ||
1329 | |||
1330 | void LiquidStyle::drawScrollBarControls(QPainter *p, const QScrollBar *sb, | ||
1331 | int sliderStart, uint controls, | ||
1332 | uint activeControl) | ||
1333 | { | ||
1334 | - bool isHover = highlightWidget == p->device(); | ||
1335 | int sliderMin, sliderMax, sliderLength, buttonDim; | ||
1336 | scrollBarMetrics( sb, sliderMin, sliderMax, sliderLength, buttonDim ); | ||
1337 | |||
1338 | @@ -1596,7 +1529,7 @@ | ||
820 | if(sbBuffer.size() != sb->size()) | 1339 | if(sbBuffer.size() != sb->size()) |
821 | sbBuffer.resize(sb->size()); | 1340 | sbBuffer.resize(sb->size()); |
822 | } | 1341 | } |
823 | - subB.setRect( subX,subY,buttonDim,buttonDim ); | 1342 | - subB.setRect( subX,subY,buttonDim,buttonDim ); |
824 | + subB.setRect( subX,subY,0,0); // buttonDim,buttonDim ); | 1343 | + subB.setRect( subX,subY,0,0); // buttonDim,buttonDim ); |
825 | addB.setRect( addX,addY,buttonDim,buttonDim ); | 1344 | addB.setRect( addX,addY,buttonDim,buttonDim ); |
826 | if(horiz) | 1345 | if(horiz) |
827 | subHC.setRect(addX-buttonDim,addY,buttonDim,buttonDim ); | 1346 | subHC.setRect(addX-buttonDim,addY,buttonDim,buttonDim ); |
828 | @@ -1624,7 +1647,7 @@ | 1347 | @@ -1624,7 +1557,7 @@ |
829 | QPainter painter; | 1348 | QPainter painter; |
830 | if(!horiz){ | 1349 | if(!horiz){ |
831 | painter.begin(&sbBuffer); | 1350 | painter.begin(&sbBuffer); |
832 | - QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*3))+1); | 1351 | - QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*3))+1); |
833 | + QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*2))+1); | 1352 | + QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*2))+1); |
834 | if(sliderR.height() >= 8){ | 1353 | if(sliderR.height() >= 8){ |
835 | painter.drawPixmap(bgR.x()+1, bgR.y(), *vsbSliderFillPix, 0, 0, | 1354 | painter.drawPixmap(bgR.x()+1, bgR.y(), *vsbSliderFillPix, 0, 0, |
836 | 13, 8); | 1355 | 13, 8); |
837 | @@ -1690,7 +1713,7 @@ | 1356 | @@ -1648,25 +1581,15 @@ |
1357 | } | ||
1358 | if(controls & Slider){ | ||
1359 | if(sliderR.height() >= 16){ | ||
1360 | - painter.drawPixmap(sliderR.x()+1, sliderR.y(), | ||
1361 | - isHover ? *getPixmap(VSBSliderTopHover): | ||
1362 | - *getPixmap(VSBSliderTop)); | ||
1363 | + painter.drawPixmap(sliderR.x()+1, sliderR.y(), *getPixmap(VSBSliderTop)); | ||
1364 | painter.drawTiledPixmap(sliderR.x()+1, sliderR.y()+8, 13, | ||
1365 | - sliderR.height()-16, isHover ? | ||
1366 | - *getPixmap(VSBSliderMidHover) : | ||
1367 | - *getPixmap(VSBSliderMid)); | ||
1368 | - painter.drawPixmap(sliderR.x()+1, sliderR.bottom()-8, | ||
1369 | - isHover ? *getPixmap(VSBSliderBtmHover) : | ||
1370 | - *getPixmap(VSBSliderBtm)); | ||
1371 | + sliderR.height()-16, *getPixmap(VSBSliderMid)); | ||
1372 | + painter.drawPixmap(sliderR.x()+1, sliderR.bottom()-8, *getPixmap(VSBSliderBtm)); | ||
1373 | } | ||
1374 | else if(sliderR.height() >= 8){ | ||
1375 | int m = sliderR.height()/2; | ||
1376 | - painter.drawPixmap(sliderR.x()+1, sliderR.y(), | ||
1377 | - isHover ? *getPixmap(VSBSliderTopHover): | ||
1378 | - *getPixmap(VSBSliderTop), 0, 0, 13, m); | ||
1379 | - painter.drawPixmap(sliderR.x()+1, sliderR.y()+m, | ||
1380 | - isHover ? *getPixmap(VSBSliderBtmHover): | ||
1381 | - *getPixmap(VSBSliderBtm), 0, 8-m, 13, m); | ||
1382 | + painter.drawPixmap(sliderR.x()+1, sliderR.y(), *getPixmap(VSBSliderTop), 0, 0, 13, m); | ||
1383 | + painter.drawPixmap(sliderR.x()+1, sliderR.y()+m, *getPixmap(VSBSliderBtm), 0, 8-m, 13, m); | ||
1384 | } | ||
1385 | else{ | ||
1386 | painter.setPen(g.button().dark(210)); | ||
1387 | @@ -1674,7 +1597,6 @@ | ||
1388 | 13, sliderR.height()); | ||
1389 | painter.drawTiledPixmap(sliderR.x()+2, sliderR.y()+1, | ||
1390 | 11, sliderR.height()-2, | ||
1391 | - isHover ? *getPixmap(VSBSliderMidHover) : | ||
1392 | *getPixmap(VSBSliderMid), 1, 0); | ||
1393 | } | ||
1394 | } | ||
1395 | @@ -1690,7 +1612,7 @@ | ||
838 | } | 1396 | } |
839 | else{ | 1397 | else{ |
840 | painter.begin(&sbBuffer); | 1398 | painter.begin(&sbBuffer); |
841 | - QRect bgR(subB.right()+1, 0, (len-(buttonDim*3))+1, sb->height()); | 1399 | - QRect bgR(subB.right()+1, 0, (len-(buttonDim*3))+1, sb->height()); |
842 | + QRect bgR(subB.right()+1, 0, (len-(buttonDim*2))+1, sb->height()); | 1400 | + QRect bgR(subB.right()+1, 0, (len-(buttonDim*2))+1, sb->height()); |
843 | if(sliderR.width() >= 8){ | 1401 | if(sliderR.width() >= 8){ |
844 | painter.drawPixmap(bgR.x(), bgR.y()+1, *vsbSliderFillPix, 0, 0, | 1402 | painter.drawPixmap(bgR.x(), bgR.y()+1, *vsbSliderFillPix, 0, 0, |
845 | 8, 13); | 1403 | 8, 13); |
846 | @@ -1761,10 +1784,10 @@ | 1404 | @@ -1715,22 +1637,17 @@ |
1405 | if(controls & Slider){ | ||
1406 | if(sliderR.width() >= 16){ | ||
1407 | painter.drawPixmap(sliderR.x(), sliderR.y()+1, | ||
1408 | - isHover ? *getPixmap(HSBSliderTopHover) : | ||
1409 | *getPixmap(HSBSliderTop)); | ||
1410 | painter.drawTiledPixmap(sliderR.x()+8, sliderR.y()+1, sliderR.width()-16, | ||
1411 | - 13, isHover ? *getPixmap(HSBSliderMidHover) : | ||
1412 | - *getPixmap(HSBSliderMid)); | ||
1413 | - painter.drawPixmap(sliderR.right()-8, sliderR.y()+1, isHover ? | ||
1414 | - *getPixmap(HSBSliderBtmHover) : | ||
1415 | + 13, *getPixmap(HSBSliderMid)); | ||
1416 | + painter.drawPixmap(sliderR.right()-8, sliderR.y()+1, | ||
1417 | *getPixmap(HSBSliderBtm)); | ||
1418 | } | ||
1419 | else if(sliderR.width() >= 8){ | ||
1420 | int m = sliderR.width()/2; | ||
1421 | painter.drawPixmap(sliderR.x(), sliderR.y()+1, | ||
1422 | - isHover ? *getPixmap(HSBSliderTopHover) : | ||
1423 | *getPixmap(HSBSliderTop), 0, 0, m, 13); | ||
1424 | - painter.drawPixmap(sliderR.right()-8, sliderR.y()+1, isHover ? | ||
1425 | - *getPixmap(HSBSliderBtmHover) : | ||
1426 | + painter.drawPixmap(sliderR.right()-8, sliderR.y()+1, | ||
1427 | *getPixmap(HSBSliderBtm), 8-m, 0, m, 13); | ||
1428 | } | ||
1429 | else{ | ||
1430 | @@ -1738,8 +1655,7 @@ | ||
1431 | drawRoundRect(&painter, sliderR.x(), sliderR.y()+1, | ||
1432 | sliderR.width(), 13); | ||
1433 | painter.drawTiledPixmap(sliderR.x()+1, sliderR.y()+2, | ||
1434 | - sliderR.width()-2, 11, isHover ? | ||
1435 | - *getPixmap(HSBSliderMidHover) : | ||
1436 | + sliderR.width()-2, 11, | ||
1437 | *getPixmap(HSBSliderMid), 0, 1); | ||
1438 | } | ||
1439 | } | ||
1440 | @@ -1761,10 +1677,10 @@ | ||
847 | addB.width()-8, addB.height()-8, g, !maxed); | 1441 | addB.width()-8, addB.height()-8, g, !maxed); |
848 | } | 1442 | } |
849 | if ( controls & SubLine ) { | 1443 | if ( controls & SubLine ) { |
850 | - drawSBButton(p, subB, g, activeControl == SubLine); | 1444 | - drawSBButton(p, subB, g, activeControl == SubLine); |
851 | - drawArrow( p, horiz ? LeftArrow : UpArrow, | 1445 | - drawArrow( p, horiz ? LeftArrow : UpArrow, |
852 | - false, subB.x()+4, subB.y()+4, | 1446 | - false, subB.x()+4, subB.y()+4, |
853 | - subB.width()-8, subB.height()-8, g, !maxed); | 1447 | - subB.width()-8, subB.height()-8, g, !maxed); |
854 | + // drawSBButton(p, subB, g, activeControl == SubLine); | 1448 | + // drawSBButton(p, subB, g, activeControl == SubLine); |
855 | + // drawArrow( p, horiz ? LeftArrow : UpArrow, | 1449 | + // drawArrow( p, horiz ? LeftArrow : UpArrow, |
856 | + // false, subB.x()+4, subB.y()+4, | 1450 | + // false, subB.x()+4, subB.y()+4, |
857 | + // subB.width()-8, subB.height()-8, g, !maxed); | 1451 | + // subB.width()-8, subB.height()-8, g, !maxed); |
858 | drawSBButton(p, subHC, g, activeControl == SubLine); | 1452 | drawSBButton(p, subHC, g, activeControl == SubLine); |
859 | drawArrow( p, horiz ? LeftArrow : UpArrow, | 1453 | drawArrow( p, horiz ? LeftArrow : UpArrow, |
860 | false, subHC.x()+4, subHC.y()+4, | 1454 | false, subHC.x()+4, subHC.y()+4, |
861 | @@ -1865,8 +1888,8 @@ | 1455 | @@ -1865,8 +1781,8 @@ |
862 | else | 1456 | else |
863 | buttonDim = ( length - b*2 )/2 - 1; | 1457 | buttonDim = ( length - b*2 )/2 - 1; |
864 | 1458 | ||
865 | - sliderMin = b + buttonDim; | 1459 | - sliderMin = b + buttonDim; |
866 | - maxLength = length - b*2 - buttonDim*3; | 1460 | - maxLength = length - b*2 - buttonDim*3; |
867 | + sliderMin = b + 0; // buttonDim; | 1461 | + sliderMin = b + 0; // buttonDim; |
868 | + maxLength = length - b*2 - buttonDim*2; // 3; | 1462 | + maxLength = length - b*2 - buttonDim*2; // 3; |
869 | 1463 | ||
870 | if ( sb->maxValue() == sb->minValue() ) { | 1464 | if ( sb->maxValue() == sb->minValue() ) { |
871 | sliderLength = maxLength; | 1465 | sliderLength = maxLength; |
872 | @@ -1914,8 +1937,8 @@ | 1466 | @@ -1914,31 +1830,31 @@ |
873 | return(QSize(16, 16)); | 1467 | return(QSize(16, 16)); |
874 | } | 1468 | } |
875 | 1469 | ||
876 | -void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int w, | 1470 | -void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int w, |
877 | - int h, const QColorGroup &g, bool on, | 1471 | - int h, const QColorGroup &g, bool on, |
878 | +void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int /*w*/, | 1472 | +void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int /*w*/, |
879 | + int /*h*/, const QColorGroup &/*g*/, bool on, | 1473 | + int /*h*/, const QColorGroup &/*g*/, bool on, |
880 | bool down, bool) | 1474 | bool down, bool) |
881 | { | 1475 | { |
882 | bool isHover = highlightWidget == p->device(); | 1476 | - bool isHover = highlightWidget == p->device(); |
883 | @@ -1957,8 +1980,8 @@ | 1477 | + bool isActive = ( p->device()->devType() == QInternal::Widget ) && ( qApp-> focusWidget ( ) == p-> device ( )); |
1478 | bool isMasked = p->device() && p->device()->devType() == QInternal::Widget | ||
1479 | && ((QWidget*)p->device())->autoMask(); | ||
1480 | |||
1481 | if(isMasked){ | ||
1482 | if(on || down){ | ||
1483 | - p->drawPixmap(x, y, isHover ? *getPixmap(HTMLRadioDownHover) : | ||
1484 | + p->drawPixmap(x, y, isActive ? *getPixmap(HTMLRadioDownHover) : | ||
1485 | *getPixmap(HTMLRadioDown)); | ||
1486 | } | ||
1487 | else | ||
1488 | - p->drawPixmap(x, y, isHover ? *getPixmap(HTMLRadioHover) : | ||
1489 | + p->drawPixmap(x, y, isActive ? *getPixmap(HTMLRadioHover) : | ||
1490 | *getPixmap(HTMLRadio)); | ||
1491 | |||
1492 | } | ||
1493 | else{ | ||
1494 | if(on || down){ | ||
1495 | - p->drawPixmap(x, y, isHover ? *getPixmap(RadioOnHover) : | ||
1496 | + p->drawPixmap(x, y, isActive ? *getPixmap(RadioOnHover) : | ||
1497 | *getPixmap(RadioOn)); | ||
1498 | } | ||
1499 | else | ||
1500 | - p->drawPixmap(x, y, isHover ? *getPixmap(RadioOffHover) : | ||
1501 | + p->drawPixmap(x, y, isActive ? *getPixmap(RadioOffHover) : | ||
1502 | *getPixmap(RadioOff)); | ||
1503 | } | ||
1504 | } | ||
1505 | @@ -1957,25 +1873,25 @@ | ||
884 | return(QSize(20, 22)); | 1506 | return(QSize(20, 22)); |
885 | } | 1507 | } |
886 | 1508 | ||
887 | -void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int w, int h, | 1509 | -void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int w, int h, |
888 | - const QColorGroup &g, int state, bool down, bool) | 1510 | - const QColorGroup &g, int state, bool down, bool) |
889 | +void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int /*w*/, int /*h*/, | 1511 | +void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int /*w*/, int /*h*/, |
890 | + const QColorGroup &/*g*/, int state, bool /*down*/, bool) | 1512 | + const QColorGroup &/*g*/, int state, bool /*down*/, bool) |
891 | { | 1513 | { |
892 | bool isHover = highlightWidget == p->device(); | 1514 | - bool isHover = highlightWidget == p->device(); |
1515 | + bool isActive = ( p->device()->devType() == QInternal::Widget ) && ( qApp-> focusWidget ( ) == p-> device ( )); | ||
893 | bool isMasked = p->device() && p->device()->devType() == QInternal::Widget | 1516 | bool isMasked = p->device() && p->device()->devType() == QInternal::Widget |
894 | @@ -1996,8 +2019,8 @@ | 1517 | && ((QWidget*)p->device())->autoMask(); |
1518 | if(isMasked){ | ||
1519 | if(state != QButton::Off){ | ||
1520 | - p->drawPixmap(x, y, isHover ? *getPixmap(HTMLCBDownHover) : | ||
1521 | + p->drawPixmap(x, y, isActive ? *getPixmap(HTMLCBDownHover) : | ||
1522 | *getPixmap(HTMLCBDown)); | ||
1523 | } | ||
1524 | else | ||
1525 | - p->drawPixmap(x, y, isHover ? *getPixmap(HTMLCBHover) : | ||
1526 | + p->drawPixmap(x, y, isActive ? *getPixmap(HTMLCBHover) : | ||
1527 | *getPixmap(HTMLCB)); | ||
1528 | |||
1529 | } | ||
1530 | else{ | ||
1531 | if(state != QButton::Off){ | ||
1532 | - p->drawPixmap(x, y, isHover ? *getPixmap(CBDownHover) : | ||
1533 | + p->drawPixmap(x, y, isActive ? *getPixmap(CBDownHover) : | ||
1534 | *getPixmap(CBDown)); | ||
1535 | /* Todo - tristate | ||
1536 | if(state == QButton::On){ | ||
1537 | @@ -1992,12 +1908,12 @@ | ||
1538 | }*/ | ||
1539 | } | ||
1540 | else | ||
1541 | - p->drawPixmap(x, y, isHover ? *getPixmap(CBHover) : *getPixmap(CB)); | ||
1542 | + p->drawPixmap(x, y, isActive ? *getPixmap(CBHover) : *getPixmap(CB)); | ||
895 | } | 1543 | } |
896 | } | 1544 | } |
897 | 1545 | ||
898 | -void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int w, int h, | 1546 | -void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int w, int h, |
899 | - int state) | 1547 | - int state) |
900 | +void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int /*w*/, int /*h*/, | 1548 | +void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int /*w*/, int /*h*/, |
901 | + int /*state*/) | 1549 | + int /*state*/) |
902 | { | 1550 | { |
903 | // needed for some reason by KHtml, even tho it's all filled ;P | 1551 | // needed for some reason by KHtml, even tho it's all filled ;P |
904 | p->drawPixmap(x, y, *getPixmap(HTMLCB)->mask()); | 1552 | p->drawPixmap(x, y, *getPixmap(HTMLCB)->mask()); |
905 | @@ -2005,18 +2028,17 @@ | 1553 | @@ -2005,18 +1921,17 @@ |
906 | } | 1554 | } |
907 | 1555 | ||
908 | void LiquidStyle::drawSlider(QPainter *p, int x, int y, int w, int h, | 1556 | void LiquidStyle::drawSlider(QPainter *p, int x, int y, int w, int h, |
909 | - const QColorGroup &g, Orientation orient, | 1557 | - const QColorGroup &g, Orientation orient, |
910 | + const QColorGroup &/*g*/, Orientation orient, | 1558 | + const QColorGroup &/*g*/, Orientation orient, |
911 | bool, bool) | 1559 | bool, bool) |
912 | { | 1560 | { |
913 | QWidget *parent = (QWidget *)p->device(); | 1561 | QWidget *parent = (QWidget *)p->device(); |
914 | p->setBrushOrigin(parent->pos()); | 1562 | p->setBrushOrigin(parent->pos()); |
915 | - p->fillRect(x, y, w, h, | 1563 | - p->fillRect(x, y, w, h, |
916 | - QApplication::palette().active().brush(QColorGroup::Background)); | 1564 | - QApplication::palette().active().brush(QColorGroup::Background)); |
917 | + parent->erase(x, y, w, h); | 1565 | + parent->erase(x, y, w, h); |
918 | p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider) : | 1566 | p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider) : |
919 | *getPixmap(VSlider)); | 1567 | *getPixmap(VSlider)); |
920 | } | 1568 | } |
921 | 1569 | ||
922 | -void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int w, int h, | 1570 | -void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int w, int h, |
923 | +void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int /*w*/, int /*h*/, | 1571 | +void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int /*w*/, int /*h*/, |
924 | Orientation orient, bool, bool) | 1572 | Orientation orient, bool, bool) |
925 | { | 1573 | { |
926 | p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider)->mask() : | 1574 | p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider)->mask() : |
927 | @@ -2065,203 +2087,26 @@ | 1575 | @@ -2065,203 +1980,26 @@ |
928 | p->drawLineSegments(a); | 1576 | p->drawLineSegments(a); |
929 | } | 1577 | } |
930 | 1578 | ||
931 | -void LiquidStyle::drawKBarHandle(QPainter *p, int x, int y, int w, int h, | 1579 | -void LiquidStyle::drawKBarHandle(QPainter *p, int x, int y, int w, int h, |
932 | - const QColorGroup &g, KToolBarPos, | 1580 | - const QColorGroup &g, KToolBarPos, |
933 | - QBrush *) | 1581 | - QBrush *) |
934 | -{ | 1582 | -{ |
935 | - p->setPen(g.button().dark(120)); | 1583 | - p->setPen(g.button().dark(120)); |
936 | - int x2 = x+w-1; | 1584 | - int x2 = x+w-1; |
937 | - int y2 = y+h-1; | 1585 | - int y2 = y+h-1; |
938 | - p->drawLine(x+1, y, x2-1, y); | 1586 | - p->drawLine(x+1, y, x2-1, y); |
939 | - p->drawLine(x+1, y2, x2-1, y2); | 1587 | - p->drawLine(x+1, y2, x2-1, y2); |
940 | - p->drawLine(x, y+1, x, y2-1); | 1588 | - p->drawLine(x, y+1, x, y2-1); |
941 | - p->drawLine(x2, y+1, x2, y2-1); | 1589 | - p->drawLine(x2, y+1, x2, y2-1); |
942 | - | 1590 | - |
943 | - p->setPen(g.background()); | 1591 | - p->setPen(g.background()); |
944 | - p->drawPoint(x, y); | 1592 | - p->drawPoint(x, y); |
945 | - p->drawPoint(x2, y); | 1593 | - p->drawPoint(x2, y); |
946 | - p->drawPoint(x, y2); | 1594 | - p->drawPoint(x, y2); |
947 | - p->drawPoint(x2, y2); | 1595 | - p->drawPoint(x2, y2); |
948 | - | 1596 | - |
949 | 1597 | - | |
950 | - | 1598 | - |
951 | - // p->drawRect(x, y, w, h); | 1599 | - // p->drawRect(x, y, w, h); |
952 | - QPixmap *pix = bevelFillDict.find(g.button().rgb()); | 1600 | - QPixmap *pix = bevelFillDict.find(g.button().rgb()); |
953 | - if(!pix){ | 1601 | - if(!pix){ |
954 | - int h, s, v; | 1602 | - int h, s, v; |
955 | - g.button().hsv(&h, &s, &v); | 1603 | - g.button().hsv(&h, &s, &v); |
956 | - pix = new QPixmap(*bevelFillPix); | 1604 | - pix = new QPixmap(*bevelFillPix); |
957 | - adjustHSV(*pix, h, s, v); | 1605 | - adjustHSV(*pix, h, s, v); |
958 | - bevelFillDict.insert(g.button().rgb(), pix); | 1606 | - bevelFillDict.insert(g.button().rgb(), pix); |
959 | - } | 1607 | - } |
960 | - | 1608 | - |
961 | - p->drawTiledPixmap(x+1, y+1, w-2, h-2, *pix); | 1609 | - p->drawTiledPixmap(x+1, y+1, w-2, h-2, *pix); |
962 | -} | 1610 | -} |
963 | - | 1611 | - |
964 | -void LiquidStyle::drawKMenuBar(QPainter *p, int x, int y, int w, int h, | 1612 | -void LiquidStyle::drawKMenuBar(QPainter *p, int x, int y, int w, int h, |
965 | - const QColorGroup &g, bool mac, QBrush *) | 1613 | - const QColorGroup &g, bool mac, QBrush *) |
966 | +void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, | 1614 | -{ |
967 | + QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active ) | ||
968 | { | ||
969 | - if(p->device() && p->device()->devType() == QInternal::Widget && | 1615 | - if(p->device() && p->device()->devType() == QInternal::Widget && |
970 | - ((KMenuBar *)p->device())->isTopLevelMenu()){ | 1616 | - ((KMenuBar *)p->device())->isTopLevelMenu()){ |
971 | - p->setPen(Qt::black); | 1617 | - p->setPen(Qt::black); |
972 | - p->drawRect(x, y, w, h); | 1618 | - p->drawRect(x, y, w, h); |
973 | - p->drawTiledPixmap(x+1, y+1, w-2, h-2, *menuPix); | 1619 | - p->drawTiledPixmap(x+1, y+1, w-2, h-2, *menuPix); |
974 | - // left | 1620 | - // left |
975 | - p->drawLine(x+1, y+1, x+1, y+5); | 1621 | - p->drawLine(x+1, y+1, x+1, y+5); |
976 | - p->drawLine(x+2, y+1, x+2, y+3); | 1622 | - p->drawLine(x+2, y+1, x+2, y+3); |
977 | - p->drawLine(x+3, y+1, x+3, y+2); | 1623 | - p->drawLine(x+3, y+1, x+3, y+2); |
978 | - p->drawLine(x+4, y+1, x+6, y+1); | 1624 | - p->drawLine(x+4, y+1, x+6, y+1); |
979 | - // right | 1625 | - // right |
980 | - int x2 = x+w-1; | 1626 | - int x2 = x+w-1; |
981 | - p->drawLine(x2-1, y+1, x2-1, y+5); | 1627 | - p->drawLine(x2-1, y+1, x2-1, y+5); |
982 | - p->drawLine(x2-2, y+1, x2-2, y+3); | 1628 | - p->drawLine(x2-2, y+1, x2-2, y+3); |
983 | - p->drawLine(x2-3, y+1, x2-3, y+2); | 1629 | - p->drawLine(x2-3, y+1, x2-3, y+2); |
984 | - p->drawLine(x2-4, y+1, x2-6, y+1); | 1630 | - p->drawLine(x2-4, y+1, x2-6, y+1); |
985 | - } | 1631 | - } |
986 | - else{ | 1632 | - else{ |
987 | - qDrawShadePanel(p, x, y, w, h, g, false, 1, | 1633 | - qDrawShadePanel(p, x, y, w, h, g, false, 1, |
988 | - &g.brush(QColorGroup::Background)); | 1634 | - &g.brush(QColorGroup::Background)); |
989 | - } | 1635 | - } |
990 | - | 1636 | - |
991 | -} | 1637 | -} |
992 | - | 1638 | |
993 | -void LiquidStyle::drawKToolBar(QPainter *p, int x, int y, int w, int h, | 1639 | -void LiquidStyle::drawKToolBar(QPainter *p, int x, int y, int w, int h, |
994 | - const QColorGroup &g, KToolBarPos, QBrush *) | 1640 | - const QColorGroup &g, KToolBarPos, QBrush *) |
995 | -{ | 1641 | +void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, |
1642 | + QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active ) | ||
1643 | { | ||
996 | - //p->fillRect(x, y, w, h, g.brush(QColorGroup::Background)); | 1644 | - //p->fillRect(x, y, w, h, g.brush(QColorGroup::Background)); |
997 | -} | 1645 | -} |
998 | - | 1646 | - |
999 | -void LiquidStyle::drawKToolBarButton(QPainter *p, int x, int y, int w, int h, | 1647 | -void LiquidStyle::drawKToolBarButton(QPainter *p, int x, int y, int w, int h, |
1000 | - const QColorGroup &g, bool sunken, | 1648 | - const QColorGroup &g, bool sunken, |
1001 | - bool raised, bool enabled, bool popup, | 1649 | - bool raised, bool enabled, bool popup, |
1002 | - KToolButtonType icontext, | 1650 | - KToolButtonType icontext, |
1003 | - const QString& btext, const QPixmap *pixmap, | 1651 | - const QString& btext, const QPixmap *pixmap, |
1004 | - QFont *font, QWidget *btn) | 1652 | - QFont *font, QWidget *btn) |
1005 | -{ | 1653 | -{ |
1006 | - int dx, dy; | 1654 | - int dx, dy; |
1007 | - | 1655 | - |
@@ -1109,76 +1757,76 @@ Features: | |||
1109 | - qDrawArrow (p, Qt::DownArrow, Qt::WindowsStyle, false, w-5, h-5, 0, 0, | 1757 | - qDrawArrow (p, Qt::DownArrow, Qt::WindowsStyle, false, w-5, h-5, 0, 0, |
1110 | - g, true); | 1758 | - g, true); |
1111 | - else | 1759 | - else |
1112 | - qDrawArrow (p, Qt::DownArrow, Qt::WindowsStyle, false, w-5, h-5, | 1760 | - qDrawArrow (p, Qt::DownArrow, Qt::WindowsStyle, false, w-5, h-5, |
1113 | - 0, 0, g, false); | 1761 | - 0, 0, g, false); |
1114 | + if(active){ | 1762 | + if(active){ |
1115 | + x -= 2; // Bug in Qt/E | 1763 | + x -= 2; // Bug in Qt/E |
1116 | + y -= 2; | 1764 | + y -= 2; |
1117 | + w += 2; | 1765 | + w += 2; |
1118 | + h += 2; | 1766 | + h += 2; |
1119 | } | 1767 | } |
1120 | -} | 1768 | -} |
1121 | |||
1122 | - | 1769 | - |
1770 | |||
1123 | -void LiquidStyle::drawKMenuItem(QPainter *p, int x, int y, int w, int h, | 1771 | -void LiquidStyle::drawKMenuItem(QPainter *p, int x, int y, int w, int h, |
1124 | - const QColorGroup &g, bool active, QMenuItem *mi, | 1772 | - const QColorGroup &g, bool active, QMenuItem *mi, |
1125 | - QBrush *) | 1773 | - QBrush *) |
1126 | -{ | 1774 | -{ |
1127 | - if ( p->font() == KGlobalSettings::generalFont() ) | 1775 | - if ( p->font() == KGlobalSettings::generalFont() ) |
1128 | - p->setFont( KGlobalSettings::menuFont() ); | 1776 | - p->setFont( KGlobalSettings::menuFont() ); |
1129 | + QWidget *parent = (QWidget *)p->device(); | 1777 | + QWidget *parent = (QWidget *)p->device(); |
1130 | + p->setBrushOrigin(parent->pos()); | 1778 | + p->setBrushOrigin(parent->pos()); |
1131 | + parent->erase(x, y, w, h); | 1779 | + parent->erase(x, y, w, h); |
1132 | 1780 | ||
1133 | if(menuHandler->useShadowText()){ | 1781 | if(menuHandler->useShadowText()){ |
1134 | QColor shadow; | 1782 | QColor shadow; |
1135 | if(p->device() && p->device()->devType() == QInternal::Widget && | 1783 | if(p->device() && p->device()->devType() == QInternal::Widget && |
1136 | - ((QWidget *)p->device())->inherits("KMenuBar")){ | 1784 | - ((QWidget *)p->device())->inherits("KMenuBar")){ |
1137 | - shadow = ((KMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) : | 1785 | - shadow = ((KMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) : |
1138 | + ((QWidget *)p->device())->inherits("QMenuBar")){ | 1786 | + ((QWidget *)p->device())->inherits("QMenuBar")){ |
1139 | + shadow = ((QMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) : | 1787 | + shadow = ((QMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) : |
1140 | g.background().dark(130); | 1788 | g.background().dark(130); |
1141 | } | 1789 | } |
1142 | else | 1790 | else |
1143 | @@ -2300,8 +2145,8 @@ | 1791 | @@ -2300,8 +2038,8 @@ |
1144 | } | 1792 | } |
1145 | 1793 | ||
1146 | void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h, | 1794 | void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h, |
1147 | - const QColorGroup &g, int lineWidth, | 1795 | - const QColorGroup &g, int lineWidth, |
1148 | - const QBrush * fill) | 1796 | - const QBrush * fill) |
1149 | + const QColorGroup &g, int /*lineWidth*/, | 1797 | + const QColorGroup &g, int /*lineWidth*/, |
1150 | + const QBrush * /*fill*/) | 1798 | + const QBrush * /*fill*/) |
1151 | { | 1799 | { |
1152 | QColor c; | 1800 | QColor c; |
1153 | switch(menuHandler->transType()){ | 1801 | switch(menuHandler->transType()){ |
1154 | @@ -2336,8 +2181,6 @@ | 1802 | @@ -2336,8 +2074,6 @@ |
1155 | 1803 | ||
1156 | maxpmw = QMAX( maxpmw, 20 ); | 1804 | maxpmw = QMAX( maxpmw, 20 ); |
1157 | 1805 | ||
1158 | - if ( p->font() == KGlobalSettings::generalFont() ) | 1806 | - if ( p->font() == KGlobalSettings::generalFont() ) |
1159 | - p->setFont( KGlobalSettings::menuFont() ); | 1807 | - p->setFont( KGlobalSettings::menuFont() ); |
1160 | 1808 | ||
1161 | bool dis = !enabled; | 1809 | bool dis = !enabled; |
1162 | QColorGroup itemg = dis ? pal.disabled() : pal.active(); | 1810 | QColorGroup itemg = dis ? pal.disabled() : pal.active(); |
1163 | @@ -2363,7 +2206,7 @@ | 1811 | @@ -2363,7 +2099,7 @@ |
1164 | p->fillRect(x, y, w, h, menuBrush); | 1812 | p->fillRect(x, y, w, h, menuBrush); |
1165 | } | 1813 | } |
1166 | else{ | 1814 | else{ |
1167 | - KPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); | 1815 | - KPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); |
1168 | + QPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); | 1816 | + QPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); |
1169 | if(pix) | 1817 | if(pix) |
1170 | p->drawPixmap(x, y, *pix, x, y, w, h); | 1818 | p->drawPixmap(x, y, *pix, x, y, w, h); |
1171 | } | 1819 | } |
1172 | @@ -2508,25 +2351,6 @@ | 1820 | @@ -2508,25 +2244,6 @@ |
1173 | return h; | 1821 | return h; |
1174 | } | 1822 | } |
1175 | 1823 | ||
1176 | -void LiquidStyle::drawKProgressBlock(QPainter *p, int x, int y, int w, int h, | 1824 | -void LiquidStyle::drawKProgressBlock(QPainter *p, int x, int y, int w, int h, |
1177 | - const QColorGroup &g, QBrush *fill) | 1825 | - const QColorGroup &g, QBrush *fill) |
1178 | -{ | 1826 | -{ |
1179 | - p->setPen(g.button().dark(130)); | 1827 | - p->setPen(g.button().dark(130)); |
1180 | - p->drawRect(x, y, w, h); | 1828 | - p->drawRect(x, y, w, h); |
1181 | - p->setPen(g.button().light(120)); | 1829 | - p->setPen(g.button().light(120)); |
1182 | - p->drawRect(x+1, y+1, w-2, h-2); | 1830 | - p->drawRect(x+1, y+1, w-2, h-2); |
1183 | - if(w >= 4 && h >= 4){ | 1831 | - if(w >= 4 && h >= 4){ |
1184 | - QPixmap *pix = bevelFillDict.find(g.button().dark(120).rgb()); | 1832 | - QPixmap *pix = bevelFillDict.find(g.button().dark(120).rgb()); |
@@ -1186,25 +1834,30 @@ Features: | |||
1186 | - int h, s, v; | 1834 | - int h, s, v; |
1187 | - g.button().dark(120).hsv(&h, &s, &v); | 1835 | - g.button().dark(120).hsv(&h, &s, &v); |
1188 | - pix = new QPixmap(*bevelFillPix); | 1836 | - pix = new QPixmap(*bevelFillPix); |
1189 | - adjustHSV(*pix, h, s, v); | 1837 | - adjustHSV(*pix, h, s, v); |
1190 | - bevelFillDict.insert(g.button().dark(120).rgb(), pix); | 1838 | - bevelFillDict.insert(g.button().dark(120).rgb(), pix); |
1191 | - } | 1839 | - } |
1192 | - p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix); | 1840 | - p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix); |
1193 | - } | 1841 | - } |
1194 | -} | 1842 | -} |
1195 | 1843 | ||
1196 | void LiquidStyle::drawFocusRect(QPainter *p, const QRect &r, | 1844 | void LiquidStyle::drawFocusRect(QPainter *p, const QRect &r, |
1197 | const QColorGroup &g, const QColor *c, | 1845 | const QColorGroup &g, const QColor *c, |
1198 | @@ -2540,25 +2364,25 @@ | 1846 | @@ -2536,29 +2253,29 @@ |
1847 | if(p->device()->devType() == QInternal::Widget){ | ||
1848 | // if so does it use a special focus rectangle? | ||
1849 | QWidget *w = (QWidget *)p->device(); | ||
1850 | - if(w->inherits("QPushButton") || w->inherits("QSlider")){ | ||
1851 | + if(w->inherits("QPushButton") || w->inherits("QSlider") || w->inherits("QComboBox") || w->inherits("QToolButton" )){ | ||
1199 | return; | 1852 | return; |
1200 | } | 1853 | } |
1201 | else{ | 1854 | else{ |
1202 | - KStyle::drawFocusRect(p, r, g, c, atBorder); | 1855 | - KStyle::drawFocusRect(p, r, g, c, atBorder); |
1203 | + QWindowsStyle::drawFocusRect(p, r, g, c, atBorder); | 1856 | + QWindowsStyle::drawFocusRect(p, r, g, c, atBorder); |
1204 | } | 1857 | } |
1205 | } | 1858 | } |
1206 | else | 1859 | else |
1207 | - KStyle::drawFocusRect(p, r, g, c, atBorder); | 1860 | - KStyle::drawFocusRect(p, r, g, c, atBorder); |
1208 | + QWindowsStyle::drawFocusRect(p, r, g, c, atBorder); | 1861 | + QWindowsStyle::drawFocusRect(p, r, g, c, atBorder); |
1209 | 1862 | ||
1210 | } | 1863 | } |
@@ -1216,43 +1869,43 @@ Features: | |||
1216 | + QWindowsStyle::polishPopupMenu(mnu); | 1869 | + QWindowsStyle::polishPopupMenu(mnu); |
1217 | } | 1870 | } |
1218 | 1871 | ||
1219 | void LiquidStyle::drawTab(QPainter *p, const QTabBar *tabBar, QTab *tab, | 1872 | void LiquidStyle::drawTab(QPainter *p, const QTabBar *tabBar, QTab *tab, |
1220 | bool selected) | 1873 | bool selected) |
1221 | { | 1874 | { |
1222 | if(tabBar->shape() != QTabBar::RoundedAbove){ | 1875 | if(tabBar->shape() != QTabBar::RoundedAbove){ |
1223 | - KStyle::drawTab(p, tabBar, tab, selected); | 1876 | - KStyle::drawTab(p, tabBar, tab, selected); |
1224 | + QWindowsStyle::drawTab(p, tabBar, tab, selected); | 1877 | + QWindowsStyle::drawTab(p, tabBar, tab, selected); |
1225 | return; | 1878 | return; |
1226 | } | 1879 | } |
1227 | QPixmap tilePix; | 1880 | QPixmap tilePix; |
1228 | @@ -2671,7 +2495,7 @@ | 1881 | @@ -2671,7 +2388,7 @@ |
1229 | vFrame = 8; // was 10 | 1882 | vFrame = 8; // was 10 |
1230 | } | 1883 | } |
1231 | else | 1884 | else |
1232 | - KStyle::tabbarMetrics(t, hFrame, vFrame, overlap); | 1885 | - KStyle::tabbarMetrics(t, hFrame, vFrame, overlap); |
1233 | + QWindowsStyle::tabbarMetrics(t, hFrame, vFrame, overlap); | 1886 | + QWindowsStyle::tabbarMetrics(t, hFrame, vFrame, overlap); |
1234 | } | 1887 | } |
1235 | 1888 | ||
1236 | 1889 | ||
1237 | @@ -2699,7 +2523,7 @@ | 1890 | @@ -2699,7 +2416,7 @@ |
1238 | p->drawLine(x+1, y+1, x+1, y2-1); | 1891 | p->drawLine(x+1, y+1, x+1, y2-1); |
1239 | } | 1892 | } |
1240 | else if(lineWidth != 2 || !sunken) | 1893 | else if(lineWidth != 2 || !sunken) |
1241 | - KStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); | 1894 | - KStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); |
1242 | + QWindowsStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); | 1895 | + QWindowsStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); |
1243 | else{ | 1896 | else{ |
1244 | QPen oldPen = p->pen(); | 1897 | QPen oldPen = p->pen(); |
1245 | int x2 = x+w-1; | 1898 | int x2 = x+w-1; |
1246 | @@ -2726,105 +2550,6 @@ | 1899 | @@ -2726,105 +2443,6 @@ |
1247 | } | 1900 | } |
1248 | } | 1901 | } |
1249 | 1902 | ||
1250 | -void LiquidStyle::drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h, | 1903 | -void LiquidStyle::drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h, |
1251 | - const QColorGroup &g, QBrush *) | 1904 | - const QColorGroup &g, QBrush *) |
1252 | -{ | 1905 | -{ |
1253 | - p->fillRect(x, y, w, h, g.brush(QColorGroup::Background)); | 1906 | - p->fillRect(x, y, w, h, g.brush(QColorGroup::Background)); |
1254 | - drawClearBevel(p, x, y, w, h, highlightWidget == p->device() ? | 1907 | - drawClearBevel(p, x, y, w, h, highlightWidget == p->device() ? |
1255 | - g.button().light(120) : g.button(), g.button()); | 1908 | - g.button().light(120) : g.button(), g.button()); |
1256 | - /* | 1909 | - /* |
1257 | - if(h > w){ | 1910 | - if(h > w){ |
1258 | - int y2 = y+h-1; | 1911 | - int y2 = y+h-1; |
@@ -1340,169 +1993,219 @@ Features: | |||
1340 | - } | 1993 | - } |
1341 | - | 1994 | - |
1342 | - p->setPen(g.buttonText()); | 1995 | - p->setPen(g.buttonText()); |
1343 | - | 1996 | - |
1344 | - p->drawText(br.x()+ textPos, -1, w-textPos, h, | 1997 | - p->drawText(br.x()+ textPos, -1, w-textPos, h, |
1345 | - AlignLeft|AlignVCenter, s); | 1998 | - AlignLeft|AlignVCenter, s); |
1346 | - } | 1999 | - } |
1347 | - | 2000 | - |
1348 | -} | 2001 | -} |
1349 | 2002 | ||
1350 | void LiquidStyle::adjustHSV(QPixmap &pix, int h, int s, int v) | 2003 | void LiquidStyle::adjustHSV(QPixmap &pix, int h, int s, int v) |
1351 | { | 2004 | { |
1352 | @@ -2998,22 +2723,22 @@ | 2005 | @@ -2988,110 +2606,5 @@ |
1353 | customBtnIconList.clear(); | 2006 | } |
1354 | customBtnLabelList.clear(); | 2007 | } |
1355 | 2008 | ||
2009 | -// I'm debating if to use QValueList or QList here. I like QValueList better, | ||
2010 | -// but QList handles pointers which is good for a lot of empty icons... | ||
2011 | - | ||
2012 | -void LiquidStyle::loadCustomButtons() | ||
2013 | -{ | ||
2014 | - return; // TODO | ||
2015 | - customBtnColorList.clear(); | ||
2016 | - customBtnIconList.clear(); | ||
2017 | - customBtnLabelList.clear(); | ||
2018 | - | ||
1356 | - KConfig *config = KGlobal::config(); | 2019 | - KConfig *config = KGlobal::config(); |
1357 | - QString oldGrp = config->group(); | 2020 | - QString oldGrp = config->group(); |
1358 | - config->setGroup("MosfetButtons"); | 2021 | - config->setGroup("MosfetButtons"); |
1359 | +// KConfig *config = KGlobal::config(); | 2022 | - |
1360 | +// QString oldGrp = config->group(); | 2023 | - QStrList iconList, colorList; //temp, we store QPixmaps and QColors |
1361 | +// config->setGroup("MosfetButtons"); | 2024 | - iconList.setAutoDelete(true); |
1362 | 2025 | - colorList.setAutoDelete(true); | |
1363 | QStrList iconList, colorList; //temp, we store QPixmaps and QColors | ||
1364 | iconList.setAutoDelete(true); | ||
1365 | colorList.setAutoDelete(true); | ||
1366 | - config->readListEntry("Labels", customBtnLabelList); | 2026 | - config->readListEntry("Labels", customBtnLabelList); |
1367 | - config->readListEntry("Icons", iconList); | 2027 | - config->readListEntry("Icons", iconList); |
1368 | - config->readListEntry("Colors", colorList); | 2028 | - config->readListEntry("Colors", colorList); |
1369 | +// config->readListEntry("Labels", customBtnLabelList); | 2029 | - |
1370 | +// config->readListEntry("Icons", iconList); | 2030 | - const char *labelStr = customBtnLabelList.first(); |
1371 | +// config->readListEntry("Colors", colorList); | 2031 | - const char *colorStr = colorList.first(); |
1372 | 2032 | - const char *iconStr = iconList.first(); | |
1373 | const char *labelStr = customBtnLabelList.first(); | 2033 | - |
1374 | const char *colorStr = colorList.first(); | ||
1375 | const char *iconStr = iconList.first(); | ||
1376 | |||
1377 | - KIconLoader *ldr = KGlobal::iconLoader(); | 2034 | - KIconLoader *ldr = KGlobal::iconLoader(); |
1378 | +// KIconLoader *ldr = KGlobal::iconLoader(); | 2035 | - while(labelStr != NULL){ |
1379 | while(labelStr != NULL){ | 2036 | - QColor *c = new QColor; |
1380 | QColor *c = new QColor; | 2037 | - c->setNamedColor(QString(colorStr)); |
1381 | c->setNamedColor(QString(colorStr)); | 2038 | - customBtnColorList.append(c); |
1382 | @@ -3022,7 +2747,7 @@ | 2039 | - |
1383 | QString tmpStr(iconStr); | 2040 | - QString tmpStr(iconStr); |
1384 | if(!tmpStr.isEmpty()){ | 2041 | - if(!tmpStr.isEmpty()){ |
1385 | QPixmap *pixmap = | 2042 | - QPixmap *pixmap = |
1386 | - new QPixmap(ldr->loadIcon(tmpStr, KIcon::Small)); | 2043 | - new QPixmap(ldr->loadIcon(tmpStr, KIcon::Small)); |
1387 | + new QPixmap();//ldr->loadIcon(tmpStr, KIcon::Small)); | 2044 | - if(pixmap->isNull()){ |
1388 | if(pixmap->isNull()){ | 2045 | - delete pixmap; |
1389 | delete pixmap; | 2046 | - customBtnIconList.append(NULL); |
1390 | customBtnIconList.append(NULL); | 2047 | - } |
1391 | @@ -3037,7 +2762,6 @@ | 2048 | - else |
1392 | colorStr = colorList.next(); | 2049 | - customBtnIconList.append(pixmap); |
1393 | iconStr = iconList.next(); | 2050 | - } |
1394 | } | 2051 | - else |
2052 | - customBtnIconList.append(NULL); | ||
2053 | - | ||
2054 | - labelStr = customBtnLabelList.next(); | ||
2055 | - colorStr = colorList.next(); | ||
2056 | - iconStr = iconList.next(); | ||
2057 | - } | ||
1395 | - config->setGroup(oldGrp); | 2058 | - config->setGroup(oldGrp); |
1396 | } | 2059 | -} |
1397 | 2060 | - | |
1398 | void LiquidStyle::applyCustomAttributes(QPushButton *btn) | 2061 | -void LiquidStyle::applyCustomAttributes(QPushButton *btn) |
1399 | @@ -3087,7 +2811,7 @@ | 2062 | -{ |
1400 | } | 2063 | - return; // TODO |
1401 | } | 2064 | - QString str = btn->text(); |
1402 | 2065 | - if(str.isEmpty()) | |
2066 | - return; | ||
2067 | - while(str.contains('&') != 0) | ||
2068 | - str = str.remove(str.find('&'), 1); | ||
2069 | - | ||
2070 | - const char *s; | ||
2071 | - int idx = 0; | ||
2072 | - for(s = customBtnLabelList.first(); s != NULL; | ||
2073 | - ++idx, s = customBtnLabelList.next()){ | ||
2074 | - if(qstricmp(s, str.latin1()) == 0){ | ||
2075 | - QPalette pal = btn->palette(); | ||
2076 | - pal.setColor(QColorGroup::Button, | ||
2077 | - *customBtnColorList.at(idx)); | ||
2078 | - btn->setPalette(pal); | ||
2079 | - /* | ||
2080 | - if(customBtnIconList.at(idx) != NULL){ | ||
2081 | - QPixmap *pix = customBtnIconList.at(idx); | ||
2082 | - btn->setIconSet(QIconSet(*pix)); | ||
2083 | - }*/ | ||
2084 | - break; | ||
2085 | - } | ||
2086 | - } | ||
2087 | -} | ||
2088 | - | ||
2089 | -void LiquidStyle::unapplyCustomAttributes(QPushButton *btn) | ||
2090 | -{ | ||
2091 | - return; // TODO | ||
2092 | - QString str = btn->text(); | ||
2093 | - if(str.isEmpty()) | ||
2094 | - return; | ||
2095 | - while(str.contains('&') != 0) | ||
2096 | - str = str.remove(str.find('&'), 1); | ||
2097 | - | ||
2098 | - const char *s; | ||
2099 | - for(s = customBtnLabelList.first(); s != NULL; s = customBtnLabelList.next()){ | ||
2100 | - if(qstricmp(s, str.latin1()) == 0){ | ||
2101 | - btn->setPalette(QApplication::palette()); | ||
2102 | - btn->setIconSet(QIconSet()); | ||
2103 | - break; | ||
2104 | - } | ||
2105 | - } | ||
2106 | -} | ||
2107 | - | ||
1403 | -#include "liquid.moc" | 2108 | -#include "liquid.moc" |
1404 | +// #include "liquid.moc" | 2109 | - |
1405 | 2110 | - | |
1406 | 2111 | - | |
2112 | - | ||
2113 | - | ||
1407 | 2114 | ||
1408 | --- -2002-10-24 03:19:31.000000000 +0200 | 2115 | /* vim: set noet sw=8 ts=8: */ |
1409 | +++ plugin.cpp2002-10-04 03:37:38.000000000 +0200 | 2116 | --- -2002-11-18 04:47:41.000000000 +0100 |
1410 | @@ -1,29 +1,84 @@ | 2117 | +++ plugin.cpp2002-11-18 03:54:56.000000000 +0100 |
2118 | @@ -1,29 +1,79 @@ | ||
1411 | +#include <qapplication.h> | 2119 | +#include <qapplication.h> |
1412 | + | 2120 | + |
1413 | #include "liquid.h" | 2121 | #include "liquid.h" |
1414 | -#include <klocale.h> | 2122 | -#include <klocale.h> |
1415 | +#include "liquidset.h" | 2123 | +#include "liquidset.h" |
1416 | +#include "plugin.h" | 2124 | +#include "plugin.h" |
1417 | + | 2125 | + |
1418 | + | 2126 | + |
1419 | + | 2127 | + |
1420 | +LiquidInterface::LiquidInterface ( ) : ref ( 0 ) | 2128 | +LiquidInterface::LiquidInterface ( ) : ref ( 0 ) |
1421 | +{ | 2129 | +{ |
1422 | +m_widget = 0; | 2130 | +m_widget = 0; |
1423 | +} | 2131 | +} |
1424 | + | 2132 | |
2133 | -extern "C" { | ||
2134 | - KStyle* allocate(); | ||
2135 | - int minor_version(); | ||
2136 | - int major_version(); | ||
2137 | - const char *description(); | ||
1425 | +LiquidInterface::~LiquidInterface ( ) | 2138 | +LiquidInterface::~LiquidInterface ( ) |
1426 | +{ | 2139 | +{ |
1427 | +} | 2140 | } |
1428 | + | 2141 | |
2142 | -KStyle* allocate() | ||
1429 | +QStyle *LiquidInterface::style ( ) | 2143 | +QStyle *LiquidInterface::style ( ) |
1430 | +{ | 2144 | { |
2145 | - return(new LiquidStyle); | ||
1431 | +return new LiquidStyle ( ); | 2146 | +return new LiquidStyle ( ); |
1432 | +} | 2147 | } |
1433 | + | 2148 | |
2149 | -int minor_version() | ||
1434 | +QString LiquidInterface::name ( ) const | 2150 | +QString LiquidInterface::name ( ) const |
1435 | +{ | 2151 | { |
2152 | - return(0); | ||
1436 | +return qApp-> translate ( "Styles", "Liquid" ); | 2153 | +return qApp-> translate ( "Styles", "Liquid" ); |
1437 | +} | 2154 | } |
1438 | + | 2155 | |
2156 | -int major_version() | ||
1439 | +QString LiquidInterface::description ( ) const | 2157 | +QString LiquidInterface::description ( ) const |
1440 | +{ | 2158 | { |
2159 | - return(1); | ||
1441 | +return qApp-> translate ( "Styles", "High Performance Liquid style by Mosfet" ); | 2160 | +return qApp-> translate ( "Styles", "High Performance Liquid style by Mosfet" ); |
1442 | +} | 2161 | } |
1443 | + | 2162 | |
2163 | -const char *description() | ||
1444 | +bool LiquidInterface::hasSettings ( ) const | 2164 | +bool LiquidInterface::hasSettings ( ) const |
1445 | +{ | 2165 | { |
2166 | - return(i18n("High performance liquid plugin").utf8()); | ||
1446 | +return true; | 2167 | +return true; |
1447 | +} | 2168 | +} |
1448 | + | 2169 | + |
1449 | +QWidget *LiquidInterface::create ( QWidget *parent, const char *name ) | 2170 | +QWidget *LiquidInterface::create ( QWidget *parent, const char *name ) |
1450 | +{ | 2171 | +{ |
1451 | +m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" ); | 2172 | +m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" ); |
1452 | 2173 | + | |
1453 | -extern "C" { | ||
1454 | - KStyle* allocate(); | ||
1455 | - int minor_version(); | ||
1456 | - int major_version(); | ||
1457 | - const char *description(); | ||
1458 | +return m_widget; | 2174 | +return m_widget; |
1459 | } | 2175 | +} |
1460 | 2176 | + | |
1461 | -KStyle* allocate() | ||
1462 | +bool LiquidInterface::accept ( ) | 2177 | +bool LiquidInterface::accept ( ) |
1463 | { | 2178 | +{ |
1464 | - return(new LiquidStyle); | ||
1465 | +if ( !m_widget ) | 2179 | +if ( !m_widget ) |
1466 | + return false; | 2180 | + return false; |
1467 | + | 2181 | + |
1468 | +return m_widget-> writeConfig ( ); | 2182 | +return m_widget-> writeConfig ( ); |
1469 | } | 2183 | } |
1470 | 2184 | + | |
1471 | -int minor_version() | ||
1472 | +void LiquidInterface::reject ( ) | 2185 | +void LiquidInterface::reject ( ) |
1473 | { | 2186 | +{ |
1474 | - return(0); | 2187 | +} |
1475 | } | 2188 | + |
1476 | |||
1477 | -int major_version() | ||
1478 | + | 2189 | + |
1479 | +QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | 2190 | +QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) |
1480 | { | 2191 | +{ |
1481 | - return(1); | ||
1482 | +*iface = 0; | 2192 | +*iface = 0; |
1483 | + | 2193 | + |
1484 | +if ( uuid == IID_QUnknown ) | 2194 | +if ( uuid == IID_QUnknown ) |
1485 | + *iface = this; | 2195 | + *iface = this; |
1486 | +else if ( uuid == IID_Style ) | 2196 | +else if ( uuid == IID_Style ) |
1487 | + *iface = this; | 2197 | + *iface = this; |
1488 | +else if ( uuid == IID_StyleExtended ) | 2198 | +else if ( uuid == IID_StyleExtended ) |
1489 | + *iface = this; | 2199 | + *iface = this; |
1490 | + | 2200 | + |
1491 | +if ( *iface ) | 2201 | +if ( *iface ) |
1492 | + (*iface)-> addRef ( ); | 2202 | + (*iface)-> addRef ( ); |
1493 | + | 2203 | + |
1494 | +return QS_OK; | 2204 | +return QS_OK; |
1495 | } | 2205 | +} |
1496 | 2206 | + | |
1497 | -const char *description() | ||
1498 | +Q_EXPORT_INTERFACE() | 2207 | +Q_EXPORT_INTERFACE() |
1499 | { | 2208 | +{ |
1500 | - return(i18n("High performance liquid plugin").utf8()); | ||
1501 | +Q_CREATE_INSTANCE( LiquidInterface ) | 2209 | +Q_CREATE_INSTANCE( LiquidInterface ) |
1502 | } | 2210 | +} |
1503 | + | ||
1504 | + | ||
1505 | + | ||
1506 | + | 2211 | + |
1507 | +// Hack for Retail Z experiments | ||
1508 | +extern "C" { QStyle *allocate ( ) { return new LiquidStyle ( ); } } | ||