author | sandman <sandman> | 2002-11-29 11:35:14 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-11-29 11:35:14 (UTC) |
commit | 3abc1725d255b507f42bcf060018d3ce0b461f4d (patch) (unidiff) | |
tree | af6b2ca73fbc570f104f44223ba7d7d201553cc6 /noncore | |
parent | 96d75cae7e5f270a543b0eb6138c6967577f2b11 (diff) | |
download | opie-3abc1725d255b507f42bcf060018d3ce0b461f4d.zip opie-3abc1725d255b507f42bcf060018d3ce0b461f4d.tar.gz opie-3abc1725d255b507f42bcf060018d3ce0b461f4d.tar.bz2 |
Not making at least qDebug outputs on every QToolButton redraw may speed
things up a bit ;)
-rw-r--r-- | noncore/styles/liquid/liquid.cpp | 7 | ||||
-rw-r--r-- | noncore/styles/liquid/opie-liquid.diff | 137 |
2 files changed, 61 insertions, 83 deletions
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp index daac22c..e6d8310 100644 --- a/noncore/styles/liquid/liquid.cpp +++ b/noncore/styles/liquid/liquid.cpp | |||
@@ -1095,34 +1095,30 @@ bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev) | |||
1095 | if(child->isWidgetType()) | 1095 | if(child->isWidgetType()) |
1096 | ((QWidget *)child)->repaint(true); | 1096 | ((QWidget *)child)->repaint(true); |
1097 | } | 1097 | } |
1098 | 1098 | ||
1099 | } | 1099 | } |
1100 | } | 1100 | } |
1101 | else if(obj->inherits("QToolButton")){ | 1101 | else if(obj->inherits("QToolButton")){ |
1102 | QToolButton *btn = (QToolButton *)obj; | 1102 | QToolButton *btn = (QToolButton *)obj; |
1103 | if(ev->type() == QEvent::FocusIn ){ // && !btn-> autoRaise () | 1103 | if(ev->type() == QEvent::FocusIn ){ // && !btn-> autoRaise () |
1104 | if(btn->isEnabled()){ | 1104 | if(btn->isEnabled()){ |
1105 | highlightWidget = btn; | 1105 | highlightWidget = btn; |
1106 | btn->repaint(false); | 1106 | btn->repaint(false); |
1107 | |||
1108 | qDebug ( "TB FOCUS IN [%p]", btn ); | ||
1109 | } | 1107 | } |
1110 | } | 1108 | } |
1111 | else if(ev->type() == QEvent::FocusOut ){ | 1109 | else if(ev->type() == QEvent::FocusOut ){ |
1112 | if(btn == highlightWidget){ | 1110 | if(btn == highlightWidget){ |
1113 | highlightWidget = NULL; | 1111 | highlightWidget = NULL; |
1114 | btn->repaint(false); | 1112 | btn->repaint(false); |
1115 | |||
1116 | qDebug ( "TB FOCUS OUT [%p]", btn ); | ||
1117 | } | 1113 | } |
1118 | } | 1114 | } |
1119 | else if(ev->type() == QEvent::Paint) { | 1115 | else if(ev->type() == QEvent::Paint) { |
1120 | (( HackToolButton *) btn )-> paint ((QPaintEvent *) ev ); | 1116 | (( HackToolButton *) btn )-> paint ((QPaintEvent *) ev ); |
1121 | return true; | 1117 | return true; |
1122 | } | 1118 | } |
1123 | } | 1119 | } |
1124 | else if(obj->inherits("QRadioButton") || obj->inherits("QCheckBox")){ | 1120 | else if(obj->inherits("QRadioButton") || obj->inherits("QCheckBox")){ |
1125 | QButton *btn = (QButton *)obj; | 1121 | QButton *btn = (QButton *)obj; |
1126 | bool isRadio = obj->inherits("QRadioButton"); | 1122 | bool isRadio = obj->inherits("QRadioButton"); |
1127 | if(ev->type() == QEvent::Paint){ | 1123 | if(ev->type() == QEvent::Paint){ |
1128 | //if(btn->autoMask()) | 1124 | //if(btn->autoMask()) |
@@ -1238,29 +1234,26 @@ void LiquidStyle::drawToolButton(QPainter *p, int x, int y, int w, int h, | |||
1238 | 1234 | ||
1239 | // fill | 1235 | // fill |
1240 | QPixmap *pix = bevelFillDict.find(c.rgb()); | 1236 | QPixmap *pix = bevelFillDict.find(c.rgb()); |
1241 | if(!pix){ | 1237 | if(!pix){ |
1242 | int h, s, v; | 1238 | int h, s, v; |
1243 | c.hsv(&h, &s, &v); | 1239 | c.hsv(&h, &s, &v); |
1244 | pix = new QPixmap(*bevelFillPix); | 1240 | pix = new QPixmap(*bevelFillPix); |
1245 | adjustHSV(*pix, h, s, v); | 1241 | adjustHSV(*pix, h, s, v); |
1246 | bevelFillDict.insert(c.rgb(), pix); | 1242 | bevelFillDict.insert(c.rgb(), pix); |
1247 | } | 1243 | } |
1248 | 1244 | ||
1249 | p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix); | 1245 | p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix); |
1250 | qDebug ( "DRAW TOOLBUTTON IN PIXMAP" ); | ||
1251 | } | 1246 | } |
1252 | else{ | 1247 | else{ |
1253 | qDebug ( "DRAW TOOLBUTTON sunken=%d/high=%p/device=%p", sunken, highlightWidget,p->device() ); | ||
1254 | |||
1255 | drawClearBevel(p, x, y, w, h, sunken ? g.button() : | 1248 | drawClearBevel(p, x, y, w, h, sunken ? g.button() : |
1256 | highlightWidget == p->device() ? g.button().light(110) : | 1249 | highlightWidget == p->device() ? g.button().light(110) : |
1257 | g.background(), g.background()); | 1250 | g.background(), g.background()); |
1258 | } | 1251 | } |
1259 | } | 1252 | } |
1260 | 1253 | ||
1261 | void LiquidStyle::drawPushButton(QPushButton *btn, QPainter *p) | 1254 | void LiquidStyle::drawPushButton(QPushButton *btn, QPainter *p) |
1262 | { | 1255 | { |
1263 | QRect r = btn->rect(); | 1256 | QRect r = btn->rect(); |
1264 | bool sunken = btn->isOn() || btn->isDown(); | 1257 | bool sunken = btn->isOn() || btn->isDown(); |
1265 | QColorGroup g = btn->colorGroup(); | 1258 | QColorGroup g = btn->colorGroup(); |
1266 | 1259 | ||
diff --git a/noncore/styles/liquid/opie-liquid.diff b/noncore/styles/liquid/opie-liquid.diff index d90433c..9ae24cc 100644 --- a/noncore/styles/liquid/opie-liquid.diff +++ b/noncore/styles/liquid/opie-liquid.diff | |||
@@ -1,18 +1,18 @@ | |||
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-11-21 20:45:47.000000000 +0100 | 6 | --- -2002-11-29 12:30:34.000000000 +0100 |
7 | +++ liquid.h2002-11-18 03:32:40.000000000 +0100 | 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. |
@@ -132,26 +132,26 @@ Features: | |||
132 | 132 | ||
133 | QIntDict<QPixmap>btnDict; | 133 | QIntDict<QPixmap>btnDict; |
134 | @@ -224,9 +187,6 @@ | 134 | @@ -224,9 +187,6 @@ |
135 | QIntDict<QPixmap>bevelFillDict; | 135 | QIntDict<QPixmap>bevelFillDict; |
136 | QIntDict<QPixmap>smallBevelFillDict; | 136 | QIntDict<QPixmap>smallBevelFillDict; |
137 | 137 | ||
138 | - QList<QColor>customBtnColorList; | 138 | - QList<QColor>customBtnColorList; |
139 | - QList<QPixmap>customBtnIconList; | 139 | - QList<QPixmap>customBtnIconList; |
140 | - QStrList customBtnLabelList; | 140 | - QStrList customBtnLabelList; |
141 | QPixmap *vsbSliderFillPix; | 141 | QPixmap *vsbSliderFillPix; |
142 | TransMenuHandler *menuHandler; | 142 | TransMenuHandler *menuHandler; |
143 | QPixmap *pixmaps[BITMAP_ITEMS]; | 143 | QPixmap *pixmaps[BITMAP_ITEMS]; |
144 | --- -2002-11-21 20:45:47.000000000 +0100 | 144 | --- -2002-11-29 12:30:34.000000000 +0100 |
145 | +++ liquid.cpp2002-11-21 20:27:48.000000000 +0100 | 145 | +++ liquid.cpp2002-11-29 12:30:24.000000000 +0100 |
146 | @@ -2,6 +2,9 @@ | 146 | @@ -2,6 +2,9 @@ |
147 | * Copyright (C)QPL 2001 Daniel M. Duley. All rights reserved. | 147 | * Copyright (C)QPL 2001 Daniel M. Duley. All rights reserved. |
148 | */ | 148 | */ |
149 | 149 | ||
150 | +// | 150 | +// |
151 | +// (c) 2002 Robert 'sandman' Griebl | 151 | +// (c) 2002 Robert 'sandman' Griebl |
152 | +// | 152 | +// |
153 | 153 | ||
154 | 154 | ||
155 | #ifndef INCLUDE_MENUITEM_DEF | 155 | #ifndef INCLUDE_MENUITEM_DEF |
156 | @@ -10,12 +13,10 @@ | 156 | @@ -10,12 +13,10 @@ |
157 | 157 | ||
@@ -262,25 +262,25 @@ Features: | |||
262 | if(p->testWFlags(Qt::WType_Popup)){ | 262 | if(p->testWFlags(Qt::WType_Popup)){ |
263 | QRect r(p->x(), p->y(), p->width(), p->height()); | 263 | QRect r(p->x(), p->y(), p->width(), p->height()); |
264 | QRect deskR = QApplication::desktop()->rect(); | 264 | QRect deskR = QApplication::desktop()->rect(); |
265 | @@ -107,7 +112,7 @@ | 265 | @@ -107,7 +112,7 @@ |
266 | r.setBottom(deskR.bottom()); | 266 | r.setBottom(deskR.bottom()); |
267 | r.setRight(deskR.right()); | 267 | r.setRight(deskR.right()); |
268 | } | 268 | } |
269 | - *pix = QPixmap::grabWindow(qt_xrootwin(), r.x(), r.y(), | 269 | - *pix = QPixmap::grabWindow(qt_xrootwin(), r.x(), r.y(), |
270 | + *pix = QPixmap::grabWindow(QApplication::desktop()-> winId(), r.x(), r.y(), | 270 | + *pix = QPixmap::grabWindow(QApplication::desktop()-> winId(), r.x(), r.y(), |
271 | r.width(), r.height()); | 271 | r.width(), r.height()); |
272 | } | 272 | } |
273 | else{ // tear off menu | 273 | else{ // tear off menu |
274 | @@ -121,82 +126,61 @@ | 274 | @@ -121,82 +126,62 @@ |
275 | stripePixmap(*pix, p->colorGroup().button()); | 275 | stripePixmap(*pix, p->colorGroup().button()); |
276 | } | 276 | } |
277 | else{ | 277 | else{ |
278 | - KPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color); | 278 | - KPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color); |
279 | + QPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color); | 279 | + QPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color); |
280 | } | 280 | } |
281 | + | 281 | + |
282 | pixDict.insert(p->winId(), pix); | 282 | pixDict.insert(p->winId(), pix); |
283 | + | 283 | + |
284 | + if ( !p->inherits("QPopupMenu")) | 284 | + if ( !p->inherits("QPopupMenu")) |
285 | + p->setBackgroundPixmap(*pix); | 285 | + p->setBackgroundPixmap(*pix); |
286 | + | 286 | + |
@@ -332,88 +332,89 @@ Features: | |||
332 | - reloadSettings(); | 332 | - reloadSettings(); |
333 | + QObjectList *ol = p-> queryList("QWidget"); | 333 | + QObjectList *ol = p-> queryList("QWidget"); |
334 | + for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { | 334 | + for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { |
335 | + QWidget *wid = (QWidget *) it.current ( ); | 335 | + QWidget *wid = (QWidget *) it.current ( ); |
336 | 336 | ||
337 | - // Now repaint menubar if needed | 337 | - // Now repaint menubar if needed |
338 | - if(shadowText != oldShadow){ | 338 | - if(shadowText != oldShadow){ |
339 | - it.toFirst(); | 339 | - it.toFirst(); |
340 | - while ((w=it.current()) != 0 ){ | 340 | - while ((w=it.current()) != 0 ){ |
341 | - ++it; | 341 | - ++it; |
342 | - if(w->inherits("QMenuBar")){ | 342 | - if(w->inherits("QMenuBar")){ |
343 | - w->repaint(); | 343 | - w->repaint(); |
344 | - } | ||
345 | - } | ||
344 | + wid-> setBackgroundMode( QWidget::PaletteBackground ); | 346 | + wid-> setBackgroundMode( QWidget::PaletteBackground ); |
345 | } | ||
346 | + delete ol; | ||
347 | } | ||
348 | } | 347 | } |
349 | - } | 348 | - } |
350 | - else if(id == MOSFET_BUTTON_CHANGE){ | 349 | - else if(id == MOSFET_BUTTON_CHANGE){ |
351 | - qWarning("In mosfet button change"); | 350 | - qWarning("In mosfet button change"); |
352 | - // really, this should be in LiquidStyle, but what the hell? ;-) | 351 | - // really, this should be in LiquidStyle, but what the hell? ;-) |
353 | - QWidgetList *list = QApplication::allWidgets(); | 352 | - QWidgetList *list = QApplication::allWidgets(); |
354 | - QWidgetListIt it( *list ); | 353 | - QWidgetListIt it( *list ); |
355 | - QWidget *w; | 354 | - QWidget *w; |
356 | - while ((w=it.current()) != 0 ){ | 355 | - while ((w=it.current()) != 0 ){ |
357 | - ++it; | 356 | - ++it; |
358 | - if(w->inherits("QPushButton")){ | 357 | - if(w->inherits("QPushButton")){ |
359 | - ((LiquidStyle*)parent())->unapplyCustomAttributes((QPushButton *)w); | 358 | - ((LiquidStyle*)parent())->unapplyCustomAttributes((QPushButton *)w); |
360 | - } | 359 | - } |
361 | - } | 360 | - } |
362 | - ((LiquidStyle*)parent())->loadCustomButtons(); | 361 | - ((LiquidStyle*)parent())->loadCustomButtons(); |
363 | - it.toFirst(); | 362 | - it.toFirst(); |
364 | - while ((w=it.current()) != 0 ){ | 363 | - while ((w=it.current()) != 0 ){ |
365 | - ++it; | 364 | - ++it; |
366 | - if(w->inherits("QPushButton")){ | 365 | - if(w->inherits("QPushButton")){ |
367 | - ((LiquidStyle*)parent())->applyCustomAttributes((QPushButton *)w); | 366 | - ((LiquidStyle*)parent())->applyCustomAttributes((QPushButton *)w); |
368 | - } | 367 | + delete ol; |
369 | - } | 368 | } |
369 | } | ||
370 | + return(false); | 370 | + return(false); |
371 | +} | 371 | +} |
372 | 372 | ||
373 | - } | 373 | - } |
374 | + | 374 | + |
375 | +static int qt_version ( ) | 375 | +static int qt_version ( ) |
376 | +{ | 376 | +{ |
377 | +const char *qver = qVersion ( ); | 377 | +const char *qver = qVersion ( ); |
378 | +return ( qver [0] - '0' ) * 100 + ( qver [2] - '0' ) * 10 + ( qver [4] - '0' ); | 378 | +return ( qver [0] - '0' ) * 100 + ( qver [2] - '0' ) * 10 + ( qver [4] - '0' ); |
379 | } | 379 | } |
380 | 380 | ||
381 | + | 381 | + |
382 | LiquidStyle::LiquidStyle() | 382 | LiquidStyle::LiquidStyle() |
383 | - :KStyle() | 383 | - :KStyle() |
384 | + :QWindowsStyle() | 384 | + :QWindowsStyle() |
385 | { | 385 | { |
386 | + setName ( "LiquidStyle" ); | 386 | + setName ( "LiquidStyle" ); |
387 | + | 387 | + |
388 | +oldqte = ( qt_version ( ) < 234 ); | 388 | +oldqte = ( qt_version ( ) < 234 ); |
389 | +flatTBButtons = false; | 389 | +flatTBButtons = false; |
390 | +currentHeader = 0; | ||
390 | + | 391 | + |
391 | btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true); | 392 | btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true); |
392 | btnMaskBmp.setMask(btnMaskBmp); | 393 | btnMaskBmp.setMask(btnMaskBmp); |
393 | htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true); | 394 | htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true); |
394 | @@ -207,12 +191,8 @@ | 395 | @@ -207,12 +192,8 @@ |
395 | btnDict.setAutoDelete(true); | 396 | btnDict.setAutoDelete(true); |
396 | bevelFillDict.setAutoDelete(true); | 397 | bevelFillDict.setAutoDelete(true); |
397 | smallBevelFillDict.setAutoDelete(true); | 398 | smallBevelFillDict.setAutoDelete(true); |
398 | - customBtnColorList.setAutoDelete(true); | 399 | - customBtnColorList.setAutoDelete(true); |
399 | - customBtnIconList.setAutoDelete(true); | 400 | - customBtnIconList.setAutoDelete(true); |
400 | - customBtnLabelList.setAutoDelete(true); | 401 | - customBtnLabelList.setAutoDelete(true); |
401 | 402 | ||
402 | rMatrix.rotate(270.0); | 403 | rMatrix.rotate(270.0); |
403 | - highcolor = QPixmap::defaultDepth() > 8; | 404 | - highcolor = QPixmap::defaultDepth() > 8; |
404 | btnBorderPix = new QPixmap; | 405 | btnBorderPix = new QPixmap; |
405 | btnBorderPix->convertFromImage(qembed_findImage("buttonfill")); | 406 | btnBorderPix->convertFromImage(qembed_findImage("buttonfill")); |
406 | btnBlendPix = new QPixmap; | 407 | btnBlendPix = new QPixmap; |
407 | @@ -572,131 +552,119 @@ | 408 | @@ -572,131 +553,119 @@ |
408 | case HTMLBtnBorderDown: | 409 | case HTMLBtnBorderDown: |
409 | pixmaps[HTMLBtnBorderDown] = processEmbedded("htmlbtnborder", btnHoverH, btnHoverS, btnHoverV); | 410 | pixmaps[HTMLBtnBorderDown] = processEmbedded("htmlbtnborder", btnHoverH, btnHoverS, btnHoverV); |
410 | break; | 411 | break; |
411 | + | 412 | + |
412 | case HTMLCB: | 413 | case HTMLCB: |
413 | pixmaps[HTMLCB] = processEmbedded("htmlcheckbox", bH, bS, bV); | 414 | pixmaps[HTMLCB] = processEmbedded("htmlcheckbox", bH, bS, bV); |
414 | break; | 415 | break; |
415 | + case HTMLCBHover: | 416 | + case HTMLCBHover: |
416 | + pixmaps[HTMLCBHover] = processEmbedded("htmlcheckbox", btnHoverH, btnHoverS, btnHoverV); | 417 | + pixmaps[HTMLCBHover] = processEmbedded("htmlcheckbox", btnHoverH, btnHoverS, btnHoverV); |
417 | + break; | 418 | + break; |
418 | case HTMLCBDown: | 419 | case HTMLCBDown: |
419 | pixmaps[HTMLCBDown] = processEmbedded("htmlcheckboxdown", btnH, btnS, btnV); | 420 | pixmaps[HTMLCBDown] = processEmbedded("htmlcheckboxdown", btnH, btnS, btnV); |
@@ -485,28 +486,28 @@ Features: | |||
485 | + | 486 | + |
486 | +case CB: | 487 | +case CB: |
487 | + pixmaps[CB] = processEmbedded("checkbox", bH, bS, bV /*, true*/); | 488 | + pixmaps[CB] = processEmbedded("checkbox", bH, bS, bV /*, true*/); |
488 | break; | 489 | break; |
489 | case CBHover: | 490 | case CBHover: |
490 | - pixmaps[CBHover] = processEmbedded("checkbox", btnH, btnS, btnV, true); | 491 | - pixmaps[CBHover] = processEmbedded("checkbox", btnH, btnS, btnV, true); |
491 | + pixmaps[CBHover] = processEmbedded("checkbox", btnHoverH, btnHoverS, btnHoverV /*, true*/); | 492 | + pixmaps[CBHover] = processEmbedded("checkbox", btnHoverH, btnHoverS, btnHoverV /*, true*/); |
492 | break; | 493 | break; |
493 | - case HSlider: | 494 | - case HSlider: |
494 | - pixmaps[HSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true); | 495 | - pixmaps[HSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true); |
495 | + case CBDown: | 496 | + case CBDown: |
496 | + pixmaps[CBDown] = processEmbedded("checkboxdown", btnH, btnS, btnV /*, true*/); | 497 | + pixmaps[CBDown] = processEmbedded("checkboxdown", btnH, btnS, btnV /*, true*/); |
497 | + break; | 498 | break; |
498 | + case CBDownHover: | 499 | + case CBDownHover: |
499 | + pixmaps[CBDownHover] = processEmbedded("checkboxdown", btnHoverH, btnHoverS, btnHoverV /*, true*/); | 500 | + pixmaps[CBDownHover] = processEmbedded("checkboxdown", btnHoverH, btnHoverS, btnHoverV /*, true*/); |
500 | break; | 501 | + break; |
501 | + | 502 | + |
502 | case VSlider: | 503 | case VSlider: |
503 | - pixmaps[VSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true); | 504 | - pixmaps[VSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true); |
504 | + pixmaps[VSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true ); | 505 | + pixmaps[VSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true ); |
505 | *pixmaps[VSlider] = pixmaps[VSlider]->xForm(rMatrix); | 506 | *pixmaps[VSlider] = pixmaps[VSlider]->xForm(rMatrix); |
506 | break; | 507 | break; |
507 | - case RadioOff: | 508 | - case RadioOff: |
508 | - pixmaps[RadioOff] = processEmbedded("radio", bH, bS, bV, true); | 509 | - pixmaps[RadioOff] = processEmbedded("radio", bH, bS, bV, true); |
509 | - break; | 510 | - break; |
510 | - case Tab: | 511 | - case Tab: |
511 | - pixmaps[Tab] = processEmbedded("tab", bH, bS, bV, true); | 512 | - pixmaps[Tab] = processEmbedded("tab", bH, bS, bV, true); |
512 | - break; | 513 | - break; |
@@ -590,33 +591,33 @@ Features: | |||
590 | break; | 591 | break; |
591 | case HSBSliderTopBg: | 592 | case HSBSliderTopBg: |
592 | - pixmaps[HSBSliderTopBg] = processEmbedded("sbslider_top", bH, bS, bV, true); | 593 | - pixmaps[HSBSliderTopBg] = processEmbedded("sbslider_top", bH, bS, bV, true); |
593 | + pixmaps[HSBSliderTopBg] = processEmbedded("sbslider_top", bH, bS, bV, true ); | 594 | + pixmaps[HSBSliderTopBg] = processEmbedded("sbslider_top", bH, bS, bV, true ); |
594 | *pixmaps[HSBSliderTopBg] = pixmaps[HSBSliderTopBg]->xForm(rMatrix); | 595 | *pixmaps[HSBSliderTopBg] = pixmaps[HSBSliderTopBg]->xForm(rMatrix); |
595 | break; | 596 | break; |
596 | case HSBSliderBtmBg: | 597 | case HSBSliderBtmBg: |
597 | - pixmaps[HSBSliderBtmBg] = processEmbedded("sbslider_btm", bH, bS, bV, true); | 598 | - pixmaps[HSBSliderBtmBg] = processEmbedded("sbslider_btm", bH, bS, bV, true); |
598 | + pixmaps[HSBSliderBtmBg] = processEmbedded("sbslider_btm", bH, bS, bV, true ); | 599 | + pixmaps[HSBSliderBtmBg] = processEmbedded("sbslider_btm", bH, bS, bV, true ); |
599 | *pixmaps[HSBSliderBtmBg] = pixmaps[HSBSliderBtmBg]->xForm(rMatrix); | 600 | *pixmaps[HSBSliderBtmBg] = pixmaps[HSBSliderBtmBg]->xForm(rMatrix); |
600 | break; | 601 | break; |
601 | case HSBSliderMidBg: | 602 | case HSBSliderMidBg: |
602 | @@ -711,7 +679,6 @@ | 603 | @@ -711,7 +680,6 @@ |
603 | 604 | ||
604 | void LiquidStyle::polish(QPalette &appPal) | 605 | void LiquidStyle::polish(QPalette &appPal) |
605 | { | 606 | { |
606 | - | 607 | - |
607 | int i; | 608 | int i; |
608 | for(i=0; i < BITMAP_ITEMS; ++i){ | 609 | for(i=0; i < BITMAP_ITEMS; ++i){ |
609 | if(pixmaps[i]){ | 610 | if(pixmaps[i]){ |
610 | @@ -719,31 +686,28 @@ | 611 | @@ -719,31 +687,28 @@ |
611 | pixmaps[i] = NULL; | 612 | pixmaps[i] = NULL; |
612 | } | 613 | } |
613 | } | 614 | } |
614 | - QWidgetList *list = QApplication::allWidgets(); | 615 | - QWidgetList *list = QApplication::allWidgets(); |
615 | - QWidgetListIt it( *list ); | 616 | - QWidgetListIt it( *list ); |
616 | - QWidget *w; | 617 | - QWidget *w; |
617 | - while ((w=it.current()) != 0 ){ | 618 | - while ((w=it.current()) != 0 ){ |
618 | - ++it; | 619 | - ++it; |
619 | - if(w->inherits("QPushButton")){ | 620 | - if(w->inherits("QPushButton")){ |
620 | - unapplyCustomAttributes((QPushButton *)w); | 621 | - unapplyCustomAttributes((QPushButton *)w); |
621 | - } | 622 | - } |
622 | - } | 623 | - } |
@@ -645,61 +646,61 @@ Features: | |||
645 | // button color stuff | 646 | // button color stuff |
646 | - config->setGroup("General"); | 647 | - config->setGroup("General"); |
647 | - QColor c = config->readColorEntry("buttonBackground", &Qt::lightGray); | 648 | - QColor c = config->readColorEntry("buttonBackground", &Qt::lightGray); |
648 | - if(c == config->readColorEntry("background", &Qt::lightGray)){ | 649 | - if(c == config->readColorEntry("background", &Qt::lightGray)){ |
649 | + config. setGroup ( "Appearance" ); | 650 | + config. setGroup ( "Appearance" ); |
650 | + QColor c = oldqte ? QColor ( config. readEntry("Button", ( Qt::lightGray ). name ( ))) | 651 | + QColor c = oldqte ? QColor ( config. readEntry("Button", ( Qt::lightGray ). name ( ))) |
651 | + : appPal. color ( QPalette::Active, QColorGroup::Button ); | 652 | + : appPal. color ( QPalette::Active, QColorGroup::Button ); |
652 | + if ( c == ( oldqte ? QColor ( config. readEntry ( "background", ( Qt::lightGray ). name ( ))) | 653 | + if ( c == ( oldqte ? QColor ( config. readEntry ( "background", ( Qt::lightGray ). name ( ))) |
653 | + : appPal. color ( QPalette::Active, QColorGroup::Background ))) { | 654 | + : appPal. color ( QPalette::Active, QColorGroup::Background ))) { |
654 | // force button color to be different from background | 655 | // force button color to be different from background |
655 | QBrush btnBrush(QColor(200, 202, 228)); | 656 | QBrush btnBrush(QColor(200, 202, 228)); |
656 | appPal.setBrush(QColorGroup::Button, btnBrush); | 657 | appPal.setBrush(QColorGroup::Button, btnBrush); |
657 | @@ -778,8 +742,8 @@ | 658 | @@ -778,8 +743,8 @@ |
658 | adjustHSV(*pix, h, s, v); | 659 | adjustHSV(*pix, h, s, v); |
659 | smallBevelFillDict.insert(c.rgb(), pix); | 660 | smallBevelFillDict.insert(c.rgb(), pix); |
660 | } | 661 | } |
661 | - pagerHoverBrush.setColor(c); | 662 | - pagerHoverBrush.setColor(c); |
662 | - pagerHoverBrush.setPixmap(*pix); | 663 | - pagerHoverBrush.setPixmap(*pix); |
663 | +// pagerHoverBrush.setColor(c); | 664 | +// pagerHoverBrush.setColor(c); |
664 | +// pagerHoverBrush.setPixmap(*pix); | 665 | +// pagerHoverBrush.setPixmap(*pix); |
665 | 666 | ||
666 | c = c.dark(120); | 667 | c = c.dark(120); |
667 | pix = smallBevelFillDict.find(c.rgb()); // better be NULL ;-) | 668 | pix = smallBevelFillDict.find(c.rgb()); // better be NULL ;-) |
668 | @@ -790,19 +754,13 @@ | 669 | @@ -790,19 +755,13 @@ |
669 | adjustHSV(*pix, h, s, v); | 670 | adjustHSV(*pix, h, s, v); |
670 | smallBevelFillDict.insert(c.rgb(), pix); | 671 | smallBevelFillDict.insert(c.rgb(), pix); |
671 | } | 672 | } |
672 | - pagerBrush.setColor(c); | 673 | - pagerBrush.setColor(c); |
673 | - pagerBrush.setPixmap(*pix); | 674 | - pagerBrush.setPixmap(*pix); |
674 | +// pagerBrush.setColor(c); | 675 | +// pagerBrush.setColor(c); |
675 | +// pagerBrush.setPixmap(*pix); | 676 | +// pagerBrush.setPixmap(*pix); |
676 | 677 | ||
677 | // background color stuff | 678 | // background color stuff |
678 | - c = config->readColorEntry("background", &Qt::lightGray); | 679 | - c = config->readColorEntry("background", &Qt::lightGray); |
679 | - if(qstrcmp(kapp->argv()[0], "kicker") == 0){ | 680 | - if(qstrcmp(kapp->argv()[0], "kicker") == 0){ |
680 | - appPal.setColor(QColorGroup::Mid, menuBrush.color().dark(110)); | 681 | - appPal.setColor(QColorGroup::Mid, menuBrush.color().dark(110)); |
681 | - appPal.setColor(QColorGroup::Dark, menuBrush.color().dark(130)); | 682 | - appPal.setColor(QColorGroup::Dark, menuBrush.color().dark(130)); |
682 | - appPal.setColor(QColorGroup::Midlight, menuBrush.color().light(110)); | 683 | - appPal.setColor(QColorGroup::Midlight, menuBrush.color().light(110)); |
683 | - appPal.setColor(QColorGroup::Light, menuBrush.color().light(115)); | 684 | - appPal.setColor(QColorGroup::Light, menuBrush.color().light(115)); |
684 | - menuBrush.setColor(c); // hack - used for kicker applets | 685 | - menuBrush.setColor(c); // hack - used for kicker applets |
685 | - appPal.setBrush(QColorGroup::Background, menuBrush); | 686 | - appPal.setBrush(QColorGroup::Background, menuBrush); |
686 | - } | 687 | - } |
687 | + c = oldqte ? QColor ( config. readEntry ( "Background", ( Qt::lightGray ).name ( ))) | 688 | + c = oldqte ? QColor ( config. readEntry ( "Background", ( Qt::lightGray ).name ( ))) |
688 | + : appPal. color ( QPalette::Active, QColorGroup::Background ); | 689 | + : appPal. color ( QPalette::Active, QColorGroup::Background ); |
689 | + | 690 | + |
690 | c.hsv(&bH, &bS, &bV); | 691 | c.hsv(&bH, &bS, &bV); |
691 | c.light(120).hsv(&bHoverH, &bHoverS, &bHoverV); | 692 | c.light(120).hsv(&bHoverH, &bHoverS, &bHoverV); |
692 | 693 | ||
693 | @@ -817,101 +775,50 @@ | 694 | @@ -817,101 +776,50 @@ |
694 | wallPaper.fill(c.rgb()); | 695 | wallPaper.fill(c.rgb()); |
695 | painter.begin(&wallPaper); | 696 | painter.begin(&wallPaper); |
696 | for(i=0; i < 32; i+=4){ | 697 | for(i=0; i < 32; i+=4){ |
697 | - painter.setPen(c.dark(105)); | 698 | - painter.setPen(c.dark(105)); |
698 | + painter.setPen(c.dark(100 + contrast)); | 699 | + painter.setPen(c.dark(100 + contrast)); |
699 | painter.drawLine(0, i, 32, i); | 700 | painter.drawLine(0, i, 32, i); |
700 | - painter.setPen(c.dark(103)); | 701 | - painter.setPen(c.dark(103)); |
701 | + painter.setPen(c.dark(100 + 3 * contrast / 5 ) ); | 702 | + painter.setPen(c.dark(100 + 3 * contrast / 5 ) ); |
702 | painter.drawLine(0, i+1, 32, i+1); | 703 | painter.drawLine(0, i+1, 32, i+1); |
703 | }; | 704 | }; |
704 | painter.end(); | 705 | painter.end(); |
705 | bgBrush.setColor(c); | 706 | bgBrush.setColor(c); |
@@ -804,48 +805,48 @@ Features: | |||
804 | - w->setPalette(pal); | 805 | - w->setPalette(pal); |
805 | - } | 806 | - } |
806 | - if(w->inherits("QPushButton")){ | 807 | - if(w->inherits("QPushButton")){ |
807 | - applyCustomAttributes((QPushButton *)w); | 808 | - applyCustomAttributes((QPushButton *)w); |
808 | - w->installEventFilter(this); | 809 | - w->installEventFilter(this); |
809 | + | 810 | + |
810 | + if(w->inherits("QButton") || w-> inherits("QComboBox")){ | 811 | + if(w->inherits("QButton") || w-> inherits("QComboBox")){ |
811 | + w-> setBackgroundMode ( QWidget::PaletteBackground ); | 812 | + w-> setBackgroundMode ( QWidget::PaletteBackground ); |
812 | + w->setBackgroundOrigin ( QWidget::ParentOrigin); | 813 | + w->setBackgroundOrigin ( QWidget::ParentOrigin); |
813 | } | 814 | } |
814 | 815 | ||
815 | bool isViewport = qstrcmp(w->name(), "qt_viewport") == 0 || | 816 | bool isViewport = qstrcmp(w->name(), "qt_viewport") == 0 || |
816 | @@ -942,11 +849,20 @@ | 817 | @@ -942,11 +850,20 @@ |
817 | w->setMouseTracking(true); | 818 | w->setMouseTracking(true); |
818 | w->installEventFilter(this); | 819 | w->installEventFilter(this); |
819 | } | 820 | } |
820 | + if(w-> inherits("QToolButton")) { | 821 | + if(w-> inherits("QToolButton")) { |
821 | + if (w->parent()->inherits("QToolBar")) { | 822 | + if (w->parent()->inherits("QToolBar")) { |
822 | + ((QToolButton*)w)->setAutoRaise (flatTBButtons); | 823 | + ((QToolButton*)w)->setAutoRaise (flatTBButtons); |
823 | + if ( flatTBButtons ) | 824 | + if ( flatTBButtons ) |
824 | + w->setBackgroundOrigin(QWidget::ParentOrigin); | 825 | + w->setBackgroundOrigin(QWidget::ParentOrigin); |
825 | + } | 826 | + } |
826 | + w-> installEventFilter ( this ); | 827 | + w-> installEventFilter ( this ); |
827 | + } | 828 | + } |
828 | + if(w-> inherits("QToolBarSeparator")&&w->parent()->inherits("QToolBar")) { | 829 | + if(w-> inherits("QToolBarSeparator")&&w->parent()->inherits("QToolBar")) { |
829 | + ((QFrame *) w)-> setFrameShape ( QFrame::NoFrame ); | 830 | + ((QFrame *) w)-> setFrameShape ( QFrame::NoFrame ); |
830 | + } | 831 | + } |
831 | if(w->ownPalette() && !w->inherits("QButton") && !w->inherits("QComboBox")){ | 832 | if(w->ownPalette() && !w->inherits("QButton") && !w->inherits("QComboBox")){ |
832 | return; | 833 | return; |
833 | } | 834 | } |
834 | - if(w->inherits("PanelButtonBase")) | 835 | - if(w->inherits("PanelButtonBase")) |
835 | - return; | 836 | - return; |
836 | 837 | ||
837 | if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())-> | 838 | if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())-> |
838 | palette().active().brush(QColorGroup::Background).pixmap()){ | 839 | palette().active().brush(QColorGroup::Background).pixmap()){ |
839 | @@ -954,16 +870,21 @@ | 840 | @@ -954,16 +871,21 @@ |
840 | return; | 841 | return; |
841 | } | 842 | } |
842 | if(!isViewport && !isViewportChild && !w->testWFlags(WType_Popup) && | 843 | if(!isViewport && !isViewportChild && !w->testWFlags(WType_Popup) && |
843 | - !w->inherits("KDesktop") && !w->inherits("PasswordDlg")){ | 844 | - !w->inherits("KDesktop") && !w->inherits("PasswordDlg")){ |
844 | + !( !w-> inherits("QLineEdit") && w-> parent() && w-> parent()-> isWidgetType ( ) && w-> parent()-> inherits ( "QMultiLineEdit" ))) { | 845 | + !( !w-> inherits("QLineEdit") && w-> parent() && w-> parent()-> isWidgetType ( ) && w-> parent()-> inherits ( "QMultiLineEdit" ))) { |
845 | if(w->backgroundMode() == QWidget::PaletteBackground || | 846 | if(w->backgroundMode() == QWidget::PaletteBackground || |
846 | w->backgroundMode() == QWidget::PaletteButton){ | 847 | w->backgroundMode() == QWidget::PaletteButton){ |
847 | - w->setBackgroundMode(QWidget::X11ParentRelative); | 848 | - w->setBackgroundMode(QWidget::X11ParentRelative); |
848 | + w->setBackgroundMode(w->parentWidget()->backgroundMode( )/*QWidget::X11ParentRelative*/); | 849 | + w->setBackgroundMode(w->parentWidget()->backgroundMode( )/*QWidget::X11ParentRelative*/); |
849 | + w->setBackgroundOrigin(QWidget::ParentOrigin); | 850 | + w->setBackgroundOrigin(QWidget::ParentOrigin); |
850 | +// w->setBackgroundMode(QWidget::NoBackground); | 851 | +// w->setBackgroundMode(QWidget::NoBackground); |
851 | } | 852 | } |
@@ -855,83 +856,83 @@ Features: | |||
855 | - //w->setBackgroundMode(QWidget::NoBackground); | 856 | - //w->setBackgroundMode(QWidget::NoBackground); |
856 | - return; | 857 | - return; |
857 | + if ( !w-> inherits("QFrame") || (((QFrame*) w)-> frameShape () == QFrame::NoFrame )) | 858 | + if ( !w-> inherits("QFrame") || (((QFrame*) w)-> frameShape () == QFrame::NoFrame )) |
858 | + w-> setBackgroundOrigin ( QWidget::ParentOrigin ); | 859 | + w-> setBackgroundOrigin ( QWidget::ParentOrigin ); |
859 | +else if ( w-> inherits("QFrame") ) | 860 | +else if ( w-> inherits("QFrame") ) |
860 | + w->setBackgroundOrigin ( QWidget::WidgetOrigin ); | 861 | + w->setBackgroundOrigin ( QWidget::WidgetOrigin ); |
861 | + | 862 | + |
862 | +if ( w->parentWidget()->inherits ( "QWidgetStack" )) { | 863 | +if ( w->parentWidget()->inherits ( "QWidgetStack" )) { |
863 | + w->setBackgroundOrigin ( QWidget::WidgetOrigin ); | 864 | + w->setBackgroundOrigin ( QWidget::WidgetOrigin ); |
864 | } | 865 | } |
865 | } | 866 | } |
866 | 867 | ||
867 | @@ -977,6 +898,11 @@ | 868 | @@ -977,6 +899,11 @@ |
868 | 869 | ||
869 | if(w->inherits("QPopupMenu")) | 870 | if(w->inherits("QPopupMenu")) |
870 | w->setBackgroundMode(QWidget::PaletteButton); | 871 | w->setBackgroundMode(QWidget::PaletteButton); |
871 | + else if(w-> testWFlags(Qt::WType_Popup) && | 872 | + else if(w-> testWFlags(Qt::WType_Popup) && |
872 | + !w->inherits("QListBox") && | 873 | + !w->inherits("QListBox") && |
873 | + ( qstrcmp ( w-> name(), "automatic what's this? widget" ) != 0 )) { | 874 | + ( qstrcmp ( w-> name(), "automatic what's this? widget" ) != 0 )) { |
874 | + w->removeEventFilter(menuHandler); | 875 | + w->removeEventFilter(menuHandler); |
875 | + } | 876 | + } |
876 | 877 | ||
877 | if(w->isTopLevel()) | 878 | if(w->isTopLevel()) |
878 | return; | 879 | return; |
879 | @@ -986,7 +912,7 @@ | 880 | @@ -986,7 +913,7 @@ |
880 | ((qstrcmp(w->parent()->name(), "qt_viewport") == 0) || | 881 | ((qstrcmp(w->parent()->name(), "qt_viewport") == 0) || |
881 | (qstrcmp(w->parent()->name(), "qt_clipped_viewport") == 0)); | 882 | (qstrcmp(w->parent()->name(), "qt_clipped_viewport") == 0)); |
882 | 883 | ||
883 | - w->setPalette(QApplication::palette()); | 884 | - w->setPalette(QApplication::palette()); |
884 | + w->unsetPalette(); | 885 | + w->unsetPalette(); |
885 | if(w->backgroundMode() == QWidget::X11ParentRelative || isViewportChild){ | 886 | if(w->backgroundMode() == QWidget::X11ParentRelative || isViewportChild){ |
886 | if(w->inherits("QPushButton")) | 887 | if(w->inherits("QPushButton")) |
887 | w->setBackgroundMode(QWidget::PaletteButton); | 888 | w->setBackgroundMode(QWidget::PaletteButton); |
888 | @@ -997,16 +923,12 @@ | 889 | @@ -997,16 +924,12 @@ |
889 | if(isViewportChild) | 890 | if(isViewportChild) |
890 | w->setAutoMask(false); | 891 | w->setAutoMask(false); |
891 | 892 | ||
892 | - if(w->inherits("QPushButton")){ | 893 | - if(w->inherits("QPushButton")){ |
893 | - unapplyCustomAttributes((QPushButton *)w); | 894 | - unapplyCustomAttributes((QPushButton *)w); |
894 | - w->removeEventFilter(this); | 895 | - w->removeEventFilter(this); |
895 | +/* | 896 | +/* |
896 | + if(w->inherits("QPushButton") || w-> inherits("QComboBox")){ | 897 | + if(w->inherits("QPushButton") || w-> inherits("QComboBox")){ |
897 | + w-> setBackgroundMode ( PaletteBackground ); | 898 | + w-> setBackgroundMode ( PaletteBackground ); |
898 | } | 899 | } |
899 | - | 900 | - |
900 | - if(w->inherits("QComboBox") || | 901 | - if(w->inherits("QComboBox") || |
901 | - w->inherits("QLineEdit") || w->inherits("QRadioButton") || | 902 | - w->inherits("QLineEdit") || w->inherits("QRadioButton") || |
902 | - w->inherits("QCheckBox") || w->inherits("QScrollBar") || | 903 | - w->inherits("QCheckBox") || w->inherits("QScrollBar") || |
903 | - w->isA("AppletHandle") || w->inherits("KMiniPagerButton") || | 904 | - w->isA("AppletHandle") || w->inherits("KMiniPagerButton") || |
904 | - w->inherits("TaskContainer")){ | 905 | - w->inherits("TaskContainer")){ |
905 | +*/ | 906 | +*/ |
906 | + if( w->inherits("QRadioButton") || w->inherits("QCheckBox") || w->inherits("QProgressBar")) { | 907 | + if( w->inherits("QRadioButton") || w->inherits("QCheckBox") || w->inherits("QProgressBar")) { |
907 | w->removeEventFilter(this); | 908 | w->removeEventFilter(this); |
908 | } | 909 | } |
909 | if(w->inherits("QButton") || w->inherits("QComboBox")){ | 910 | if(w->inherits("QButton") || w->inherits("QComboBox")){ |
910 | @@ -1014,9 +936,12 @@ | 911 | @@ -1014,9 +937,12 @@ |
911 | w->setAutoMask(false); | 912 | w->setAutoMask(false); |
912 | } | 913 | } |
913 | } | 914 | } |
914 | - if(w->inherits("KToolBar")){ | 915 | - if(w->inherits("KToolBar")){ |
915 | + if(w-> inherits("QToolButton")) { | 916 | + if(w-> inherits("QToolButton")) { |
916 | + w-> removeEventFilter ( this ); | 917 | + w-> removeEventFilter ( this ); |
917 | + } | 918 | + } |
918 | + if(w->inherits("QToolBar")){ | 919 | + if(w->inherits("QToolBar")){ |
919 | w->removeEventFilter(this); | 920 | w->removeEventFilter(this); |
920 | - //w->setBackgroundMode(QWidget::PaletteBackground); | 921 | - //w->setBackgroundMode(QWidget::PaletteBackground); |
921 | + w->setBackgroundMode(QWidget::PaletteBackground); | 922 | + w->setBackgroundMode(QWidget::PaletteBackground); |
922 | return; | 923 | return; |
923 | } | 924 | } |
924 | if(w->inherits("QHeader")){ | 925 | if(w->inherits("QHeader")){ |
925 | @@ -1028,22 +953,118 @@ | 926 | @@ -1028,22 +954,118 @@ |
926 | void LiquidStyle::polish(QApplication *app) | 927 | void LiquidStyle::polish(QApplication *app) |
927 | { | 928 | { |
928 | 929 | ||
929 | - KStyle::polish(app); | 930 | - KStyle::polish(app); |
930 | + QWindowsStyle::polish(app); | 931 | + QWindowsStyle::polish(app); |
931 | menuAni = app->isEffectEnabled(UI_AnimateMenu); | 932 | menuAni = app->isEffectEnabled(UI_AnimateMenu); |
932 | menuFade = app->isEffectEnabled(UI_FadeMenu); | 933 | menuFade = app->isEffectEnabled(UI_FadeMenu); |
933 | if(menuAni) | 934 | if(menuAni) |
934 | app->setEffectEnabled(UI_AnimateMenu, false); | 935 | app->setEffectEnabled(UI_AnimateMenu, false); |
935 | if(menuFade) | 936 | if(menuFade) |
936 | app->setEffectEnabled(UI_FadeMenu, false); | 937 | app->setEffectEnabled(UI_FadeMenu, false); |
937 | + | 938 | + |
@@ -1034,34 +1035,34 @@ Features: | |||
1034 | +void paint ( QPaintEvent *ev ) | 1035 | +void paint ( QPaintEvent *ev ) |
1035 | +{ | 1036 | +{ |
1036 | + erase ( ev-> region ( )); | 1037 | + erase ( ev-> region ( )); |
1037 | + QPainter p ( this ); | 1038 | + QPainter p ( this ); |
1038 | + style ( ). drawToolButton ( this, &p ); | 1039 | + style ( ). drawToolButton ( this, &p ); |
1039 | + drawButtonLabel ( &p ); | 1040 | + drawButtonLabel ( &p ); |
1040 | +} | 1041 | +} |
1041 | +}; | 1042 | +}; |
1042 | + | 1043 | + |
1043 | /* | 1044 | /* |
1044 | * This is a fun method ;-) Here's an overview. KToolBar grabs resize to | 1045 | * This is a fun method ;-) Here's an overview. KToolBar grabs resize to |
1045 | * force everything to erase and repaint on resize. This is going away, I'm | 1046 | * force everything to erase and repaint on resize. This is going away, I'm |
1046 | @@ -1063,7 +1084,7 @@ | 1047 | @@ -1063,7 +1085,7 @@ |
1047 | */ | 1048 | */ |
1048 | bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev) | 1049 | bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev) |
1049 | { | 1050 | { |
1050 | - if(obj->inherits("KToolBar")){ | 1051 | - if(obj->inherits("KToolBar")){ |
1051 | + if(obj->inherits("QToolBar")){ | 1052 | + if(obj->inherits("QToolBar")){ |
1052 | if(ev->type() == QEvent::Resize){ | 1053 | if(ev->type() == QEvent::Resize){ |
1053 | const QObjectList *tbChildList = obj->children(); | 1054 | const QObjectList *tbChildList = obj->children(); |
1054 | QObjectListIt it(*tbChildList); | 1055 | QObjectListIt it(*tbChildList); |
1055 | @@ -1076,116 +1097,27 @@ | 1056 | @@ -1076,116 +1098,23 @@ |
1056 | 1057 | ||
1057 | } | 1058 | } |
1058 | } | 1059 | } |
1059 | - else if(obj->inherits("KMiniPagerButton")){ | 1060 | - else if(obj->inherits("KMiniPagerButton")){ |
1060 | - QButton *btn = (QButton *)obj; | 1061 | - QButton *btn = (QButton *)obj; |
1061 | - if(ev->type() == QEvent::Paint){ | 1062 | - if(ev->type() == QEvent::Paint){ |
1062 | - if(!(btn->isOn() || btn->isDown())){ | 1063 | - if(!(btn->isOn() || btn->isDown())){ |
1063 | - QPalette pal = btn->palette(); | 1064 | - QPalette pal = btn->palette(); |
1064 | - pal.setBrush(QColorGroup::Dark, btn == highlightWidget ? | 1065 | - pal.setBrush(QColorGroup::Dark, btn == highlightWidget ? |
1065 | - pagerHoverBrush : pagerBrush); | 1066 | - pagerHoverBrush : pagerBrush); |
1066 | - btn->setPalette(pal); | 1067 | - btn->setPalette(pal); |
1067 | - } | 1068 | - } |
@@ -1112,36 +1113,32 @@ Features: | |||
1112 | - btn->setPalette(pal); | 1113 | - btn->setPalette(pal); |
1113 | - } | 1114 | - } |
1114 | - } | 1115 | - } |
1115 | - else if(obj->inherits("QToolButton") && !obj->inherits("KToolBarButton")){ | 1116 | - else if(obj->inherits("QToolButton") && !obj->inherits("KToolBarButton")){ |
1116 | - QToolButton *btn = (QToolButton *)btn; | 1117 | - QToolButton *btn = (QToolButton *)btn; |
1117 | - if(!btn->autoRaise()){ | 1118 | - if(!btn->autoRaise()){ |
1118 | + else if(obj->inherits("QToolButton")){ | 1119 | + else if(obj->inherits("QToolButton")){ |
1119 | + QToolButton *btn = (QToolButton *)obj; | 1120 | + QToolButton *btn = (QToolButton *)obj; |
1120 | + if(ev->type() == QEvent::FocusIn ){ // && !btn-> autoRaise () | 1121 | + if(ev->type() == QEvent::FocusIn ){ // && !btn-> autoRaise () |
1121 | if(btn->isEnabled()){ | 1122 | if(btn->isEnabled()){ |
1122 | highlightWidget = btn; | 1123 | highlightWidget = btn; |
1123 | btn->repaint(false); | 1124 | btn->repaint(false); |
1124 | + | ||
1125 | + qDebug ( "TB FOCUS IN [%p]", btn ); | ||
1126 | } | 1125 | } |
1127 | } | 1126 | } |
1128 | - else if(ev->type() == QEvent::Leave){ | 1127 | - else if(ev->type() == QEvent::Leave){ |
1129 | - QWidget *btn = (QWidget *)obj; | 1128 | - QWidget *btn = (QWidget *)obj; |
1130 | + else if(ev->type() == QEvent::FocusOut ){ | 1129 | + else if(ev->type() == QEvent::FocusOut ){ |
1131 | if(btn == highlightWidget){ | 1130 | if(btn == highlightWidget){ |
1132 | highlightWidget = NULL; | 1131 | highlightWidget = NULL; |
1133 | btn->repaint(false); | 1132 | btn->repaint(false); |
1134 | + | ||
1135 | + qDebug ( "TB FOCUS OUT [%p]", btn ); | ||
1136 | } | 1133 | } |
1137 | } | 1134 | } |
1138 | - else | 1135 | - else |
1139 | - highlightWidget = NULL; | 1136 | - highlightWidget = NULL; |
1140 | - } | 1137 | - } |
1141 | - else if(obj->inherits("QScrollBar")){ | 1138 | - else if(obj->inherits("QScrollBar")){ |
1142 | - QScrollBar *sb = (QScrollBar *)obj; | 1139 | - QScrollBar *sb = (QScrollBar *)obj; |
1143 | - if(ev->type() == QEvent::Enter){ | 1140 | - if(ev->type() == QEvent::Enter){ |
1144 | - if(sb->isEnabled()){ | 1141 | - if(sb->isEnabled()){ |
1145 | - highlightWidget = sb; | 1142 | - highlightWidget = sb; |
1146 | - sb->repaint(false); | 1143 | - sb->repaint(false); |
1147 | - } | 1144 | - } |
@@ -1171,41 +1168,41 @@ Features: | |||
1171 | - } | 1168 | - } |
1172 | - else if(ev->type() == QEvent::Leave){ | 1169 | - else if(ev->type() == QEvent::Leave){ |
1173 | - if (btn == highlightWidget) | 1170 | - if (btn == highlightWidget) |
1174 | - highlightWidget = NULL; | 1171 | - highlightWidget = NULL; |
1175 | - btn->repaint(false); | 1172 | - btn->repaint(false); |
1176 | - } | 1173 | - } |
1177 | + else if(ev->type() == QEvent::Paint) { | 1174 | + else if(ev->type() == QEvent::Paint) { |
1178 | + (( HackToolButton *) btn )-> paint ((QPaintEvent *) ev ); | 1175 | + (( HackToolButton *) btn )-> paint ((QPaintEvent *) ev ); |
1179 | + return true; | 1176 | + return true; |
1180 | } | 1177 | } |
1181 | } | 1178 | } |
1182 | else if(obj->inherits("QRadioButton") || obj->inherits("QCheckBox")){ | 1179 | else if(obj->inherits("QRadioButton") || obj->inherits("QCheckBox")){ |
1183 | @@ -1201,6 +1133,7 @@ | 1180 | @@ -1201,6 +1130,7 @@ |
1184 | QSize sz = isRadio ? exclusiveIndicatorSize() | 1181 | QSize sz = isRadio ? exclusiveIndicatorSize() |
1185 | : indicatorSize(); | 1182 | : indicatorSize(); |
1186 | 1183 | ||
1187 | +/* | 1184 | +/* |
1188 | if(btn->hasFocus()){ | 1185 | if(btn->hasFocus()){ |
1189 | QRect r = QRect(0, 0, btn->width(), btn->height()); | 1186 | QRect r = QRect(0, 0, btn->width(), btn->height()); |
1190 | p.setPen(btn->colorGroup().button().dark(140)); | 1187 | p.setPen(btn->colorGroup().button().dark(140)); |
1191 | @@ -1209,6 +1142,7 @@ | 1188 | @@ -1209,6 +1139,7 @@ |
1192 | p.drawLine(r.right(), r.y()+1, r.right(), r.bottom()-1); | 1189 | 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()); | 1190 | p.drawLine(r.x()+1, r.bottom(), r.right()-1, r.bottom()); |
1194 | } | 1191 | } |
1195 | +*/ | 1192 | +*/ |
1196 | int x = 0; | 1193 | int x = 0; |
1197 | int y = (btn->height()-lsz.height()+fm.height()-sz.height())/2; | 1194 | int y = (btn->height()-lsz.height()+fm.height()-sz.height())/2; |
1198 | if(isRadio) | 1195 | if(isRadio) |
1199 | @@ -1228,36 +1162,6 @@ | 1196 | @@ -1228,36 +1159,6 @@ |
1200 | p.end(); | 1197 | p.end(); |
1201 | return(true); | 1198 | return(true); |
1202 | } | 1199 | } |
1203 | - // for hover, just redraw the indicator (not the text) | 1200 | - // for hover, just redraw the indicator (not the text) |
1204 | - else if((ev->type() == QEvent::Enter && btn->isEnabled()) || | 1201 | - else if((ev->type() == QEvent::Enter && btn->isEnabled()) || |
1205 | - (ev->type() == QEvent::Leave && btn == highlightWidget)){ | 1202 | - (ev->type() == QEvent::Leave && btn == highlightWidget)){ |
1206 | - QButton *btn = (QButton *)obj; | 1203 | - QButton *btn = (QButton *)obj; |
1207 | - bool isRadio = obj->inherits("QRadioButton"); | 1204 | - bool isRadio = obj->inherits("QRadioButton"); |
1208 | - | 1205 | - |
1209 | - if(ev->type() == QEvent::Enter) | 1206 | - if(ev->type() == QEvent::Enter) |
1210 | - highlightWidget = btn; | 1207 | - highlightWidget = btn; |
1211 | - else | 1208 | - else |
@@ -1224,25 +1221,25 @@ Features: | |||
1224 | - drawExclusiveIndicator(&p, x, y, sz.width(), sz.height(), | 1221 | - drawExclusiveIndicator(&p, x, y, sz.width(), sz.height(), |
1225 | - btn->colorGroup(), btn->isOn(), | 1222 | - btn->colorGroup(), btn->isOn(), |
1226 | - btn->isDown(), btn->isEnabled()); | 1223 | - btn->isDown(), btn->isEnabled()); |
1227 | - else | 1224 | - else |
1228 | - drawIndicator(&p, x, y, sz.width(), sz.height(), | 1225 | - drawIndicator(&p, x, y, sz.width(), sz.height(), |
1229 | - btn->colorGroup(), btn->state(), btn->isDown(), | 1226 | - btn->colorGroup(), btn->state(), btn->isDown(), |
1230 | - btn->isEnabled()); | 1227 | - btn->isEnabled()); |
1231 | - p.end(); | 1228 | - p.end(); |
1232 | - } | 1229 | - } |
1233 | } | 1230 | } |
1234 | else if(obj->inherits("QHeader")){ | 1231 | else if(obj->inherits("QHeader")){ |
1235 | QHeader *hw = (QHeader *)obj; | 1232 | QHeader *hw = (QHeader *)obj; |
1236 | @@ -1290,7 +1194,24 @@ | 1233 | @@ -1290,7 +1191,24 @@ |
1237 | } | 1234 | } |
1238 | } | 1235 | } |
1239 | } | 1236 | } |
1240 | - return(false); | 1237 | - return(false); |
1241 | + else if (obj-> inherits( "QProgressBar" )) { | 1238 | + else if (obj-> inherits( "QProgressBar" )) { |
1242 | + if ( ev->type() == QEvent::Paint ) { | 1239 | + if ( ev->type() == QEvent::Paint ) { |
1243 | + HackProgressBar *p = (HackProgressBar *) obj; | 1240 | + HackProgressBar *p = (HackProgressBar *) obj; |
1244 | + const QColorGroup &g = p-> colorGroup ( ); | 1241 | + const QColorGroup &g = p-> colorGroup ( ); |
1245 | + | 1242 | + |
1246 | + QPixmap *pix = bevelFillDict.find(g.button().dark(120).rgb()); | 1243 | + QPixmap *pix = bevelFillDict.find(g.button().dark(120).rgb()); |
1247 | + if(!pix){ | 1244 | + if(!pix){ |
1248 | + int h, s, v; | 1245 | + int h, s, v; |
@@ -1250,119 +1247,107 @@ Features: | |||
1250 | + pix = new QPixmap(*bevelFillPix); | 1247 | + pix = new QPixmap(*bevelFillPix); |
1251 | + adjustHSV(*pix, h, s, v); | 1248 | + adjustHSV(*pix, h, s, v); |
1252 | + bevelFillDict.insert(g.button().dark(120).rgb(), pix); | 1249 | + bevelFillDict.insert(g.button().dark(120).rgb(), pix); |
1253 | + } | 1250 | + } |
1254 | + p-> paint ((QPaintEvent *) ev, g, pix ); | 1251 | + p-> paint ((QPaintEvent *) ev, g, pix ); |
1255 | + return true; | 1252 | + return true; |
1256 | + } | 1253 | + } |
1257 | + } | 1254 | + } |
1258 | +return false ; | 1255 | +return false ; |
1259 | } | 1256 | } |
1260 | 1257 | ||
1261 | void LiquidStyle::drawButton(QPainter *p, int x, int y, int w, int h, | 1258 | void LiquidStyle::drawButton(QPainter *p, int x, int y, int w, int h, |
1262 | @@ -1325,8 +1246,11 @@ | 1259 | @@ -1340,11 +1258,6 @@ |
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 @@ | ||
1275 | QColorGroup g = btn->colorGroup(); | 1260 | QColorGroup g = btn->colorGroup(); |
1276 | 1261 | ||
1277 | 1262 | ||
1278 | - QColor testColor; | 1263 | - QColor testColor; |
1279 | - if(btn->parent() && btn->parent()->isWidgetType()){ | 1264 | - if(btn->parent() && btn->parent()->isWidgetType()){ |
1280 | - testColor = p->backgroundColor(); // remove me | 1265 | - testColor = p->backgroundColor(); // remove me |
1281 | - } | 1266 | - } |
1282 | - | 1267 | - |
1283 | //int dw = buttonDefaultIndicatorWidth(); | 1268 | //int dw = buttonDefaultIndicatorWidth(); |
1284 | if(btn->hasFocus() || btn->isDefault()){ | 1269 | if(btn->hasFocus() || btn->isDefault()){ |
1285 | QColor c = btn->hasFocus() ? g.button().light(110) : g.background(); | 1270 | QColor c = btn->hasFocus() ? g.button().light(110) : g.background(); |
1286 | @@ -1488,7 +1407,20 @@ | 1271 | @@ -1488,7 +1401,20 @@ |
1287 | const QColorGroup &g, bool sunken, | 1272 | const QColorGroup &g, bool sunken, |
1288 | bool edit, bool, const QBrush *) | 1273 | bool edit, bool, const QBrush *) |
1289 | { | 1274 | { |
1290 | - bool isHover = highlightWidget == painter->device(); | 1275 | - bool isHover = highlightWidget == painter->device(); |
1291 | + bool isActive = false; | 1276 | + bool isActive = false; |
1292 | + if (( painter->device()->devType() == QInternal::Widget ) && | 1277 | + if (( painter->device()->devType() == QInternal::Widget ) && |
1293 | + ( | 1278 | + ( |
1294 | + ( qApp-> focusWidget ( ) == painter-> device ( )) || | 1279 | + ( qApp-> focusWidget ( ) == painter-> device ( )) || |
1295 | + ( | 1280 | + ( |
1296 | + edit && | 1281 | + edit && |
1297 | + ((QWidget *) painter-> device ( ))-> inherits ( "QComboBox" ) && | 1282 | + ((QWidget *) painter-> device ( ))-> inherits ( "QComboBox" ) && |
1298 | + ( qApp-> focusWidget ( ) == ((QComboBox *) painter->device())->lineEdit ( )) | 1283 | + ( qApp-> focusWidget ( ) == ((QComboBox *) painter->device())->lineEdit ( )) |
1299 | + ) | 1284 | + ) |
1300 | + ) | 1285 | + ) |
1301 | + ) { | 1286 | + ) { |
1302 | + isActive = true; | 1287 | + isActive = true; |
1303 | + } | 1288 | + } |
1304 | + | 1289 | + |
1305 | bool isMasked = false; | 1290 | bool isMasked = false; |
1306 | if(painter->device()->devType() == QInternal::Widget) | 1291 | if(painter->device()->devType() == QInternal::Widget) |
1307 | isMasked = ((QWidget*)painter->device())->autoMask(); | 1292 | isMasked = ((QWidget*)painter->device())->autoMask(); |
1308 | @@ -1498,7 +1430,7 @@ | 1293 | @@ -1498,7 +1424,7 @@ |
1309 | 1294 | ||
1310 | drawRoundButton(&p, g.button(), g.background(), 0, 0, w, h, false, | 1295 | drawRoundButton(&p, g.button(), g.background(), 0, 0, w, h, false, |
1311 | sunken, false, isMasked); | 1296 | sunken, false, isMasked); |
1312 | - if(!isHover){ | 1297 | - if(!isHover){ |
1313 | + if(!isActive){ | 1298 | + if(!isActive){ |
1314 | p.setClipRect(0, 0, w-17, h); | 1299 | p.setClipRect(0, 0, w-17, h); |
1315 | drawRoundButton(&p, g.background(), g.background(), 0, 0, w, h, false, | 1300 | drawRoundButton(&p, g.background(), g.background(), 0, 0, w, h, false, |
1316 | sunken, false, isMasked); | 1301 | sunken, false, isMasked); |
1317 | @@ -1550,16 +1482,17 @@ | 1302 | @@ -1550,16 +1476,17 @@ |
1318 | return(QRect(x+9, y+3, w - (h / 3) - 20, h-6)); | 1303 | return(QRect(x+9, y+3, w - (h / 3) - 20, h-6)); |
1319 | } | 1304 | } |
1320 | 1305 | ||
1321 | -QRect LiquidStyle::comboButtonFocusRect(int x, int y, int w, int h) | 1306 | -QRect LiquidStyle::comboButtonFocusRect(int x, int y, int w, int h) |
1322 | +QRect LiquidStyle::comboButtonFocusRect(int /*x*/, int /*y*/, int /*w*/, int /*h*/) | 1307 | +QRect LiquidStyle::comboButtonFocusRect(int /*x*/, int /*y*/, int /*w*/, int /*h*/) |
1323 | { | 1308 | { |
1324 | - return(QRect(x+5, y+3, w-(h/3)-13, h-5)); | 1309 | - return(QRect(x+5, y+3, w-(h/3)-13, h-5)); |
1325 | +return QRect ( ); | 1310 | +return QRect ( ); |
1326 | + | 1311 | + |
1327 | +// return(QRect(x+5, y+3, w-(h/3)-13, h-5)); | 1312 | +// return(QRect(x+5, y+3, w-(h/3)-13, h-5)); |
1328 | } | 1313 | } |
1329 | 1314 | ||
1330 | void LiquidStyle::drawScrollBarControls(QPainter *p, const QScrollBar *sb, | 1315 | void LiquidStyle::drawScrollBarControls(QPainter *p, const QScrollBar *sb, |
1331 | int sliderStart, uint controls, | 1316 | int sliderStart, uint controls, |
1332 | uint activeControl) | 1317 | uint activeControl) |
1333 | { | 1318 | { |
1334 | - bool isHover = highlightWidget == p->device(); | 1319 | - bool isHover = highlightWidget == p->device(); |
1335 | int sliderMin, sliderMax, sliderLength, buttonDim; | 1320 | int sliderMin, sliderMax, sliderLength, buttonDim; |
1336 | scrollBarMetrics( sb, sliderMin, sliderMax, sliderLength, buttonDim ); | 1321 | scrollBarMetrics( sb, sliderMin, sliderMax, sliderLength, buttonDim ); |
1337 | 1322 | ||
1338 | @@ -1596,7 +1529,7 @@ | 1323 | @@ -1596,7 +1523,7 @@ |
1339 | if(sbBuffer.size() != sb->size()) | 1324 | if(sbBuffer.size() != sb->size()) |
1340 | sbBuffer.resize(sb->size()); | 1325 | sbBuffer.resize(sb->size()); |
1341 | } | 1326 | } |
1342 | - subB.setRect( subX,subY,buttonDim,buttonDim ); | 1327 | - subB.setRect( subX,subY,buttonDim,buttonDim ); |
1343 | + subB.setRect( subX,subY,0,0); // buttonDim,buttonDim ); | 1328 | + subB.setRect( subX,subY,0,0); // buttonDim,buttonDim ); |
1344 | addB.setRect( addX,addY,buttonDim,buttonDim ); | 1329 | addB.setRect( addX,addY,buttonDim,buttonDim ); |
1345 | if(horiz) | 1330 | if(horiz) |
1346 | subHC.setRect(addX-buttonDim,addY,buttonDim,buttonDim ); | 1331 | subHC.setRect(addX-buttonDim,addY,buttonDim,buttonDim ); |
1347 | @@ -1624,7 +1557,7 @@ | 1332 | @@ -1624,7 +1551,7 @@ |
1348 | QPainter painter; | 1333 | QPainter painter; |
1349 | if(!horiz){ | 1334 | if(!horiz){ |
1350 | painter.begin(&sbBuffer); | 1335 | painter.begin(&sbBuffer); |
1351 | - QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*3))+1); | 1336 | - QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*3))+1); |
1352 | + QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*2))+1); | 1337 | + QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*2))+1); |
1353 | if(sliderR.height() >= 8){ | 1338 | if(sliderR.height() >= 8){ |
1354 | painter.drawPixmap(bgR.x()+1, bgR.y(), *vsbSliderFillPix, 0, 0, | 1339 | painter.drawPixmap(bgR.x()+1, bgR.y(), *vsbSliderFillPix, 0, 0, |
1355 | 13, 8); | 1340 | 13, 8); |
1356 | @@ -1648,25 +1581,15 @@ | 1341 | @@ -1648,25 +1575,15 @@ |
1357 | } | 1342 | } |
1358 | if(controls & Slider){ | 1343 | if(controls & Slider){ |
1359 | if(sliderR.height() >= 16){ | 1344 | if(sliderR.height() >= 16){ |
1360 | - painter.drawPixmap(sliderR.x()+1, sliderR.y(), | 1345 | - painter.drawPixmap(sliderR.x()+1, sliderR.y(), |
1361 | - isHover ? *getPixmap(VSBSliderTopHover): | 1346 | - isHover ? *getPixmap(VSBSliderTopHover): |
1362 | - *getPixmap(VSBSliderTop)); | 1347 | - *getPixmap(VSBSliderTop)); |
1363 | + painter.drawPixmap(sliderR.x()+1, sliderR.y(), *getPixmap(VSBSliderTop)); | 1348 | + painter.drawPixmap(sliderR.x()+1, sliderR.y(), *getPixmap(VSBSliderTop)); |
1364 | painter.drawTiledPixmap(sliderR.x()+1, sliderR.y()+8, 13, | 1349 | painter.drawTiledPixmap(sliderR.x()+1, sliderR.y()+8, 13, |
1365 | - sliderR.height()-16, isHover ? | 1350 | - sliderR.height()-16, isHover ? |
1366 | - *getPixmap(VSBSliderMidHover) : | 1351 | - *getPixmap(VSBSliderMidHover) : |
1367 | - *getPixmap(VSBSliderMid)); | 1352 | - *getPixmap(VSBSliderMid)); |
1368 | - painter.drawPixmap(sliderR.x()+1, sliderR.bottom()-8, | 1353 | - painter.drawPixmap(sliderR.x()+1, sliderR.bottom()-8, |
@@ -1375,42 +1360,42 @@ Features: | |||
1375 | int m = sliderR.height()/2; | 1360 | int m = sliderR.height()/2; |
1376 | - painter.drawPixmap(sliderR.x()+1, sliderR.y(), | 1361 | - painter.drawPixmap(sliderR.x()+1, sliderR.y(), |
1377 | - isHover ? *getPixmap(VSBSliderTopHover): | 1362 | - isHover ? *getPixmap(VSBSliderTopHover): |
1378 | - *getPixmap(VSBSliderTop), 0, 0, 13, m); | 1363 | - *getPixmap(VSBSliderTop), 0, 0, 13, m); |
1379 | - painter.drawPixmap(sliderR.x()+1, sliderR.y()+m, | 1364 | - painter.drawPixmap(sliderR.x()+1, sliderR.y()+m, |
1380 | - isHover ? *getPixmap(VSBSliderBtmHover): | 1365 | - isHover ? *getPixmap(VSBSliderBtmHover): |
1381 | - *getPixmap(VSBSliderBtm), 0, 8-m, 13, m); | 1366 | - *getPixmap(VSBSliderBtm), 0, 8-m, 13, m); |
1382 | + painter.drawPixmap(sliderR.x()+1, sliderR.y(), *getPixmap(VSBSliderTop), 0, 0, 13, m); | 1367 | + 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); | 1368 | + painter.drawPixmap(sliderR.x()+1, sliderR.y()+m, *getPixmap(VSBSliderBtm), 0, 8-m, 13, m); |
1384 | } | 1369 | } |
1385 | else{ | 1370 | else{ |
1386 | painter.setPen(g.button().dark(210)); | 1371 | painter.setPen(g.button().dark(210)); |
1387 | @@ -1674,7 +1597,6 @@ | 1372 | @@ -1674,7 +1591,6 @@ |
1388 | 13, sliderR.height()); | 1373 | 13, sliderR.height()); |
1389 | painter.drawTiledPixmap(sliderR.x()+2, sliderR.y()+1, | 1374 | painter.drawTiledPixmap(sliderR.x()+2, sliderR.y()+1, |
1390 | 11, sliderR.height()-2, | 1375 | 11, sliderR.height()-2, |
1391 | - isHover ? *getPixmap(VSBSliderMidHover) : | 1376 | - isHover ? *getPixmap(VSBSliderMidHover) : |
1392 | *getPixmap(VSBSliderMid), 1, 0); | 1377 | *getPixmap(VSBSliderMid), 1, 0); |
1393 | } | 1378 | } |
1394 | } | 1379 | } |
1395 | @@ -1690,7 +1612,7 @@ | 1380 | @@ -1690,7 +1606,7 @@ |
1396 | } | 1381 | } |
1397 | else{ | 1382 | else{ |
1398 | painter.begin(&sbBuffer); | 1383 | painter.begin(&sbBuffer); |
1399 | - QRect bgR(subB.right()+1, 0, (len-(buttonDim*3))+1, sb->height()); | 1384 | - QRect bgR(subB.right()+1, 0, (len-(buttonDim*3))+1, sb->height()); |
1400 | + QRect bgR(subB.right()+1, 0, (len-(buttonDim*2))+1, sb->height()); | 1385 | + QRect bgR(subB.right()+1, 0, (len-(buttonDim*2))+1, sb->height()); |
1401 | if(sliderR.width() >= 8){ | 1386 | if(sliderR.width() >= 8){ |
1402 | painter.drawPixmap(bgR.x(), bgR.y()+1, *vsbSliderFillPix, 0, 0, | 1387 | painter.drawPixmap(bgR.x(), bgR.y()+1, *vsbSliderFillPix, 0, 0, |
1403 | 8, 13); | 1388 | 8, 13); |
1404 | @@ -1715,22 +1637,17 @@ | 1389 | @@ -1715,22 +1631,17 @@ |
1405 | if(controls & Slider){ | 1390 | if(controls & Slider){ |
1406 | if(sliderR.width() >= 16){ | 1391 | if(sliderR.width() >= 16){ |
1407 | painter.drawPixmap(sliderR.x(), sliderR.y()+1, | 1392 | painter.drawPixmap(sliderR.x(), sliderR.y()+1, |
1408 | - isHover ? *getPixmap(HSBSliderTopHover) : | 1393 | - isHover ? *getPixmap(HSBSliderTopHover) : |
1409 | *getPixmap(HSBSliderTop)); | 1394 | *getPixmap(HSBSliderTop)); |
1410 | painter.drawTiledPixmap(sliderR.x()+8, sliderR.y()+1, sliderR.width()-16, | 1395 | painter.drawTiledPixmap(sliderR.x()+8, sliderR.y()+1, sliderR.width()-16, |
1411 | - 13, isHover ? *getPixmap(HSBSliderMidHover) : | 1396 | - 13, isHover ? *getPixmap(HSBSliderMidHover) : |
1412 | - *getPixmap(HSBSliderMid)); | 1397 | - *getPixmap(HSBSliderMid)); |
1413 | - painter.drawPixmap(sliderR.right()-8, sliderR.y()+1, isHover ? | 1398 | - painter.drawPixmap(sliderR.right()-8, sliderR.y()+1, isHover ? |
1414 | - *getPixmap(HSBSliderBtmHover) : | 1399 | - *getPixmap(HSBSliderBtmHover) : |
1415 | + 13, *getPixmap(HSBSliderMid)); | 1400 | + 13, *getPixmap(HSBSliderMid)); |
1416 | + painter.drawPixmap(sliderR.right()-8, sliderR.y()+1, | 1401 | + painter.drawPixmap(sliderR.right()-8, sliderR.y()+1, |
@@ -1418,61 +1403,61 @@ Features: | |||
1418 | } | 1403 | } |
1419 | else if(sliderR.width() >= 8){ | 1404 | else if(sliderR.width() >= 8){ |
1420 | int m = sliderR.width()/2; | 1405 | int m = sliderR.width()/2; |
1421 | painter.drawPixmap(sliderR.x(), sliderR.y()+1, | 1406 | painter.drawPixmap(sliderR.x(), sliderR.y()+1, |
1422 | - isHover ? *getPixmap(HSBSliderTopHover) : | 1407 | - isHover ? *getPixmap(HSBSliderTopHover) : |
1423 | *getPixmap(HSBSliderTop), 0, 0, m, 13); | 1408 | *getPixmap(HSBSliderTop), 0, 0, m, 13); |
1424 | - painter.drawPixmap(sliderR.right()-8, sliderR.y()+1, isHover ? | 1409 | - painter.drawPixmap(sliderR.right()-8, sliderR.y()+1, isHover ? |
1425 | - *getPixmap(HSBSliderBtmHover) : | 1410 | - *getPixmap(HSBSliderBtmHover) : |
1426 | + painter.drawPixmap(sliderR.right()-8, sliderR.y()+1, | 1411 | + painter.drawPixmap(sliderR.right()-8, sliderR.y()+1, |
1427 | *getPixmap(HSBSliderBtm), 8-m, 0, m, 13); | 1412 | *getPixmap(HSBSliderBtm), 8-m, 0, m, 13); |
1428 | } | 1413 | } |
1429 | else{ | 1414 | else{ |
1430 | @@ -1738,8 +1655,7 @@ | 1415 | @@ -1738,8 +1649,7 @@ |
1431 | drawRoundRect(&painter, sliderR.x(), sliderR.y()+1, | 1416 | drawRoundRect(&painter, sliderR.x(), sliderR.y()+1, |
1432 | sliderR.width(), 13); | 1417 | sliderR.width(), 13); |
1433 | painter.drawTiledPixmap(sliderR.x()+1, sliderR.y()+2, | 1418 | painter.drawTiledPixmap(sliderR.x()+1, sliderR.y()+2, |
1434 | - sliderR.width()-2, 11, isHover ? | 1419 | - sliderR.width()-2, 11, isHover ? |
1435 | - *getPixmap(HSBSliderMidHover) : | 1420 | - *getPixmap(HSBSliderMidHover) : |
1436 | + sliderR.width()-2, 11, | 1421 | + sliderR.width()-2, 11, |
1437 | *getPixmap(HSBSliderMid), 0, 1); | 1422 | *getPixmap(HSBSliderMid), 0, 1); |
1438 | } | 1423 | } |
1439 | } | 1424 | } |
1440 | @@ -1761,10 +1677,10 @@ | 1425 | @@ -1761,10 +1671,10 @@ |
1441 | addB.width()-8, addB.height()-8, g, !maxed); | 1426 | addB.width()-8, addB.height()-8, g, !maxed); |
1442 | } | 1427 | } |
1443 | if ( controls & SubLine ) { | 1428 | if ( controls & SubLine ) { |
1444 | - drawSBButton(p, subB, g, activeControl == SubLine); | 1429 | - drawSBButton(p, subB, g, activeControl == SubLine); |
1445 | - drawArrow( p, horiz ? LeftArrow : UpArrow, | 1430 | - drawArrow( p, horiz ? LeftArrow : UpArrow, |
1446 | - false, subB.x()+4, subB.y()+4, | 1431 | - false, subB.x()+4, subB.y()+4, |
1447 | - subB.width()-8, subB.height()-8, g, !maxed); | 1432 | - subB.width()-8, subB.height()-8, g, !maxed); |
1448 | + // drawSBButton(p, subB, g, activeControl == SubLine); | 1433 | + // drawSBButton(p, subB, g, activeControl == SubLine); |
1449 | + // drawArrow( p, horiz ? LeftArrow : UpArrow, | 1434 | + // drawArrow( p, horiz ? LeftArrow : UpArrow, |
1450 | + // false, subB.x()+4, subB.y()+4, | 1435 | + // false, subB.x()+4, subB.y()+4, |
1451 | + // subB.width()-8, subB.height()-8, g, !maxed); | 1436 | + // subB.width()-8, subB.height()-8, g, !maxed); |
1452 | drawSBButton(p, subHC, g, activeControl == SubLine); | 1437 | drawSBButton(p, subHC, g, activeControl == SubLine); |
1453 | drawArrow( p, horiz ? LeftArrow : UpArrow, | 1438 | drawArrow( p, horiz ? LeftArrow : UpArrow, |
1454 | false, subHC.x()+4, subHC.y()+4, | 1439 | false, subHC.x()+4, subHC.y()+4, |
1455 | @@ -1865,8 +1781,8 @@ | 1440 | @@ -1865,8 +1775,8 @@ |
1456 | else | 1441 | else |
1457 | buttonDim = ( length - b*2 )/2 - 1; | 1442 | buttonDim = ( length - b*2 )/2 - 1; |
1458 | 1443 | ||
1459 | - sliderMin = b + buttonDim; | 1444 | - sliderMin = b + buttonDim; |
1460 | - maxLength = length - b*2 - buttonDim*3; | 1445 | - maxLength = length - b*2 - buttonDim*3; |
1461 | + sliderMin = b + 0; // buttonDim; | 1446 | + sliderMin = b + 0; // buttonDim; |
1462 | + maxLength = length - b*2 - buttonDim*2; // 3; | 1447 | + maxLength = length - b*2 - buttonDim*2; // 3; |
1463 | 1448 | ||
1464 | if ( sb->maxValue() == sb->minValue() ) { | 1449 | if ( sb->maxValue() == sb->minValue() ) { |
1465 | sliderLength = maxLength; | 1450 | sliderLength = maxLength; |
1466 | @@ -1914,31 +1830,31 @@ | 1451 | @@ -1914,31 +1824,31 @@ |
1467 | return(QSize(16, 16)); | 1452 | return(QSize(16, 16)); |
1468 | } | 1453 | } |
1469 | 1454 | ||
1470 | -void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int w, | 1455 | -void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int w, |
1471 | - int h, const QColorGroup &g, bool on, | 1456 | - int h, const QColorGroup &g, bool on, |
1472 | +void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int /*w*/, | 1457 | +void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int /*w*/, |
1473 | + int /*h*/, const QColorGroup &/*g*/, bool on, | 1458 | + int /*h*/, const QColorGroup &/*g*/, bool on, |
1474 | bool down, bool) | 1459 | bool down, bool) |
1475 | { | 1460 | { |
1476 | - bool isHover = highlightWidget == p->device(); | 1461 | - bool isHover = highlightWidget == p->device(); |
1477 | + bool isActive = ( p->device()->devType() == QInternal::Widget ) && ( qApp-> focusWidget ( ) == p-> device ( )); | 1462 | + bool isActive = ( p->device()->devType() == QInternal::Widget ) && ( qApp-> focusWidget ( ) == p-> device ( )); |
1478 | bool isMasked = p->device() && p->device()->devType() == QInternal::Widget | 1463 | bool isMasked = p->device() && p->device()->devType() == QInternal::Widget |
@@ -1493,25 +1478,25 @@ Features: | |||
1493 | else{ | 1478 | else{ |
1494 | if(on || down){ | 1479 | if(on || down){ |
1495 | - p->drawPixmap(x, y, isHover ? *getPixmap(RadioOnHover) : | 1480 | - p->drawPixmap(x, y, isHover ? *getPixmap(RadioOnHover) : |
1496 | + p->drawPixmap(x, y, isActive ? *getPixmap(RadioOnHover) : | 1481 | + p->drawPixmap(x, y, isActive ? *getPixmap(RadioOnHover) : |
1497 | *getPixmap(RadioOn)); | 1482 | *getPixmap(RadioOn)); |
1498 | } | 1483 | } |
1499 | else | 1484 | else |
1500 | - p->drawPixmap(x, y, isHover ? *getPixmap(RadioOffHover) : | 1485 | - p->drawPixmap(x, y, isHover ? *getPixmap(RadioOffHover) : |
1501 | + p->drawPixmap(x, y, isActive ? *getPixmap(RadioOffHover) : | 1486 | + p->drawPixmap(x, y, isActive ? *getPixmap(RadioOffHover) : |
1502 | *getPixmap(RadioOff)); | 1487 | *getPixmap(RadioOff)); |
1503 | } | 1488 | } |
1504 | } | 1489 | } |
1505 | @@ -1957,25 +1873,25 @@ | 1490 | @@ -1957,25 +1867,25 @@ |
1506 | return(QSize(20, 22)); | 1491 | return(QSize(20, 22)); |
1507 | } | 1492 | } |
1508 | 1493 | ||
1509 | -void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int w, int h, | 1494 | -void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int w, int h, |
1510 | - const QColorGroup &g, int state, bool down, bool) | 1495 | - const QColorGroup &g, int state, bool down, bool) |
1511 | +void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int /*w*/, int /*h*/, | 1496 | +void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int /*w*/, int /*h*/, |
1512 | + const QColorGroup &/*g*/, int state, bool /*down*/, bool) | 1497 | + const QColorGroup &/*g*/, int state, bool /*down*/, bool) |
1513 | { | 1498 | { |
1514 | - bool isHover = highlightWidget == p->device(); | 1499 | - bool isHover = highlightWidget == p->device(); |
1515 | + bool isActive = ( p->device()->devType() == QInternal::Widget ) && ( qApp-> focusWidget ( ) == p-> device ( )); | 1500 | + bool isActive = ( p->device()->devType() == QInternal::Widget ) && ( qApp-> focusWidget ( ) == p-> device ( )); |
1516 | bool isMasked = p->device() && p->device()->devType() == QInternal::Widget | 1501 | bool isMasked = p->device() && p->device()->devType() == QInternal::Widget |
1517 | && ((QWidget*)p->device())->autoMask(); | 1502 | && ((QWidget*)p->device())->autoMask(); |
@@ -1525,63 +1510,63 @@ Features: | |||
1525 | - p->drawPixmap(x, y, isHover ? *getPixmap(HTMLCBHover) : | 1510 | - p->drawPixmap(x, y, isHover ? *getPixmap(HTMLCBHover) : |
1526 | + p->drawPixmap(x, y, isActive ? *getPixmap(HTMLCBHover) : | 1511 | + p->drawPixmap(x, y, isActive ? *getPixmap(HTMLCBHover) : |
1527 | *getPixmap(HTMLCB)); | 1512 | *getPixmap(HTMLCB)); |
1528 | 1513 | ||
1529 | } | 1514 | } |
1530 | else{ | 1515 | else{ |
1531 | if(state != QButton::Off){ | 1516 | if(state != QButton::Off){ |
1532 | - p->drawPixmap(x, y, isHover ? *getPixmap(CBDownHover) : | 1517 | - p->drawPixmap(x, y, isHover ? *getPixmap(CBDownHover) : |
1533 | + p->drawPixmap(x, y, isActive ? *getPixmap(CBDownHover) : | 1518 | + p->drawPixmap(x, y, isActive ? *getPixmap(CBDownHover) : |
1534 | *getPixmap(CBDown)); | 1519 | *getPixmap(CBDown)); |
1535 | /* Todo - tristate | 1520 | /* Todo - tristate |
1536 | if(state == QButton::On){ | 1521 | if(state == QButton::On){ |
1537 | @@ -1992,12 +1908,12 @@ | 1522 | @@ -1992,12 +1902,12 @@ |
1538 | }*/ | 1523 | }*/ |
1539 | } | 1524 | } |
1540 | else | 1525 | else |
1541 | - p->drawPixmap(x, y, isHover ? *getPixmap(CBHover) : *getPixmap(CB)); | 1526 | - p->drawPixmap(x, y, isHover ? *getPixmap(CBHover) : *getPixmap(CB)); |
1542 | + p->drawPixmap(x, y, isActive ? *getPixmap(CBHover) : *getPixmap(CB)); | 1527 | + p->drawPixmap(x, y, isActive ? *getPixmap(CBHover) : *getPixmap(CB)); |
1543 | } | 1528 | } |
1544 | } | 1529 | } |
1545 | 1530 | ||
1546 | -void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int w, int h, | 1531 | -void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int w, int h, |
1547 | - int state) | 1532 | - int state) |
1548 | +void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int /*w*/, int /*h*/, | 1533 | +void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int /*w*/, int /*h*/, |
1549 | + int /*state*/) | 1534 | + int /*state*/) |
1550 | { | 1535 | { |
1551 | // needed for some reason by KHtml, even tho it's all filled ;P | 1536 | // needed for some reason by KHtml, even tho it's all filled ;P |
1552 | p->drawPixmap(x, y, *getPixmap(HTMLCB)->mask()); | 1537 | p->drawPixmap(x, y, *getPixmap(HTMLCB)->mask()); |
1553 | @@ -2005,18 +1921,17 @@ | 1538 | @@ -2005,18 +1915,17 @@ |
1554 | } | 1539 | } |
1555 | 1540 | ||
1556 | void LiquidStyle::drawSlider(QPainter *p, int x, int y, int w, int h, | 1541 | void LiquidStyle::drawSlider(QPainter *p, int x, int y, int w, int h, |
1557 | - const QColorGroup &g, Orientation orient, | 1542 | - const QColorGroup &g, Orientation orient, |
1558 | + const QColorGroup &/*g*/, Orientation orient, | 1543 | + const QColorGroup &/*g*/, Orientation orient, |
1559 | bool, bool) | 1544 | bool, bool) |
1560 | { | 1545 | { |
1561 | QWidget *parent = (QWidget *)p->device(); | 1546 | QWidget *parent = (QWidget *)p->device(); |
1562 | p->setBrushOrigin(parent->pos()); | 1547 | p->setBrushOrigin(parent->pos()); |
1563 | - p->fillRect(x, y, w, h, | 1548 | - p->fillRect(x, y, w, h, |
1564 | - QApplication::palette().active().brush(QColorGroup::Background)); | 1549 | - QApplication::palette().active().brush(QColorGroup::Background)); |
1565 | + parent->erase(x, y, w, h); | 1550 | + parent->erase(x, y, w, h); |
1566 | p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider) : | 1551 | p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider) : |
1567 | *getPixmap(VSlider)); | 1552 | *getPixmap(VSlider)); |
1568 | } | 1553 | } |
1569 | 1554 | ||
1570 | -void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int w, int h, | 1555 | -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*/, | 1556 | +void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int /*w*/, int /*h*/, |
1572 | Orientation orient, bool, bool) | 1557 | Orientation orient, bool, bool) |
1573 | { | 1558 | { |
1574 | p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider)->mask() : | 1559 | p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider)->mask() : |
1575 | @@ -2065,243 +1980,76 @@ | 1560 | @@ -2065,243 +1974,76 @@ |
1576 | p->drawLineSegments(a); | 1561 | p->drawLineSegments(a); |
1577 | } | 1562 | } |
1578 | 1563 | ||
1579 | -void LiquidStyle::drawKBarHandle(QPainter *p, int x, int y, int w, int h, | 1564 | -void LiquidStyle::drawKBarHandle(QPainter *p, int x, int y, int w, int h, |
1580 | - const QColorGroup &g, KToolBarPos, | 1565 | - const QColorGroup &g, KToolBarPos, |
1581 | - QBrush *) | 1566 | - QBrush *) |
1582 | -{ | 1567 | -{ |
1583 | - p->setPen(g.button().dark(120)); | 1568 | - p->setPen(g.button().dark(120)); |
1584 | - int x2 = x+w-1; | 1569 | - int x2 = x+w-1; |
1585 | - int y2 = y+h-1; | 1570 | - int y2 = y+h-1; |
1586 | - p->drawLine(x+1, y, x2-1, y); | 1571 | - p->drawLine(x+1, y, x2-1, y); |
1587 | - p->drawLine(x+1, y2, x2-1, y2); | 1572 | - p->drawLine(x+1, y2, x2-1, y2); |
@@ -1624,27 +1609,27 @@ Features: | |||
1624 | - p->drawLine(x+4, y+1, x+6, y+1); | 1609 | - p->drawLine(x+4, y+1, x+6, y+1); |
1625 | - // right | 1610 | - // right |
1626 | - int x2 = x+w-1; | 1611 | - int x2 = x+w-1; |
1627 | - p->drawLine(x2-1, y+1, x2-1, y+5); | 1612 | - p->drawLine(x2-1, y+1, x2-1, y+5); |
1628 | - p->drawLine(x2-2, y+1, x2-2, y+3); | 1613 | - p->drawLine(x2-2, y+1, x2-2, y+3); |
1629 | - p->drawLine(x2-3, y+1, x2-3, y+2); | 1614 | - p->drawLine(x2-3, y+1, x2-3, y+2); |
1630 | - p->drawLine(x2-4, y+1, x2-6, y+1); | 1615 | - p->drawLine(x2-4, y+1, x2-6, y+1); |
1631 | - } | 1616 | - } |
1632 | - else{ | 1617 | - else{ |
1633 | - qDrawShadePanel(p, x, y, w, h, g, false, 1, | 1618 | - qDrawShadePanel(p, x, y, w, h, g, false, 1, |
1634 | - &g.brush(QColorGroup::Background)); | 1619 | - &g.brush(QColorGroup::Background)); |
1635 | - } | 1620 | - } |
1636 | |||
1637 | -} | ||
1638 | - | 1621 | - |
1622 | -} | ||
1623 | |||
1639 | -void LiquidStyle::drawKToolBar(QPainter *p, int x, int y, int w, int h, | 1624 | -void LiquidStyle::drawKToolBar(QPainter *p, int x, int y, int w, int h, |
1640 | - const QColorGroup &g, KToolBarPos, QBrush *) | 1625 | - const QColorGroup &g, KToolBarPos, QBrush *) |
1641 | +void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, | 1626 | +void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, |
1642 | + QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active ) | 1627 | + QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active ) |
1643 | { | 1628 | { |
1644 | - //p->fillRect(x, y, w, h, g.brush(QColorGroup::Background)); | 1629 | - //p->fillRect(x, y, w, h, g.brush(QColorGroup::Background)); |
1645 | -} | 1630 | -} |
1646 | - | 1631 | - |
1647 | -void LiquidStyle::drawKToolBarButton(QPainter *p, int x, int y, int w, int h, | 1632 | -void LiquidStyle::drawKToolBarButton(QPainter *p, int x, int y, int w, int h, |
1648 | - const QColorGroup &g, bool sunken, | 1633 | - const QColorGroup &g, bool sunken, |
1649 | - bool raised, bool enabled, bool popup, | 1634 | - bool raised, bool enabled, bool popup, |
1650 | - KToolButtonType icontext, | 1635 | - KToolButtonType icontext, |
@@ -1836,43 +1821,43 @@ Features: | |||
1836 | -1, &g.text()); | 1821 | -1, &g.text()); |
1837 | } | 1822 | } |
1838 | } | 1823 | } |
1839 | 1824 | ||
1840 | void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h, | 1825 | void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h, |
1841 | - const QColorGroup &g, int lineWidth, | 1826 | - const QColorGroup &g, int lineWidth, |
1842 | - const QBrush * fill) | 1827 | - const QBrush * fill) |
1843 | + const QColorGroup &g, int /*lineWidth*/, | 1828 | + const QColorGroup &g, int /*lineWidth*/, |
1844 | + const QBrush * /*fill*/) | 1829 | + const QBrush * /*fill*/) |
1845 | { | 1830 | { |
1846 | QColor c; | 1831 | QColor c; |
1847 | switch(menuHandler->transType()){ | 1832 | switch(menuHandler->transType()){ |
1848 | @@ -2336,8 +2084,6 @@ | 1833 | @@ -2336,8 +2078,6 @@ |
1849 | 1834 | ||
1850 | maxpmw = QMAX( maxpmw, 20 ); | 1835 | maxpmw = QMAX( maxpmw, 20 ); |
1851 | 1836 | ||
1852 | - if ( p->font() == KGlobalSettings::generalFont() ) | 1837 | - if ( p->font() == KGlobalSettings::generalFont() ) |
1853 | - p->setFont( KGlobalSettings::menuFont() ); | 1838 | - p->setFont( KGlobalSettings::menuFont() ); |
1854 | 1839 | ||
1855 | bool dis = !enabled; | 1840 | bool dis = !enabled; |
1856 | QColorGroup itemg = dis ? pal.disabled() : pal.active(); | 1841 | QColorGroup itemg = dis ? pal.disabled() : pal.active(); |
1857 | @@ -2363,7 +2109,7 @@ | 1842 | @@ -2363,7 +2103,7 @@ |
1858 | p->fillRect(x, y, w, h, menuBrush); | 1843 | p->fillRect(x, y, w, h, menuBrush); |
1859 | } | 1844 | } |
1860 | else{ | 1845 | else{ |
1861 | - KPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); | 1846 | - KPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); |
1862 | + QPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); | 1847 | + QPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); |
1863 | if(pix) | 1848 | if(pix) |
1864 | p->drawPixmap(x, y, *pix, x, y, w, h); | 1849 | p->drawPixmap(x, y, *pix, x, y, w, h); |
1865 | } | 1850 | } |
1866 | @@ -2508,25 +2254,6 @@ | 1851 | @@ -2508,25 +2248,6 @@ |
1867 | return h; | 1852 | return h; |
1868 | } | 1853 | } |
1869 | 1854 | ||
1870 | -void LiquidStyle::drawKProgressBlock(QPainter *p, int x, int y, int w, int h, | 1855 | -void LiquidStyle::drawKProgressBlock(QPainter *p, int x, int y, int w, int h, |
1871 | - const QColorGroup &g, QBrush *fill) | 1856 | - const QColorGroup &g, QBrush *fill) |
1872 | -{ | 1857 | -{ |
1873 | - p->setPen(g.button().dark(130)); | 1858 | - p->setPen(g.button().dark(130)); |
1874 | - p->drawRect(x, y, w, h); | 1859 | - p->drawRect(x, y, w, h); |
1875 | - p->setPen(g.button().light(120)); | 1860 | - p->setPen(g.button().light(120)); |
1876 | - p->drawRect(x+1, y+1, w-2, h-2); | 1861 | - p->drawRect(x+1, y+1, w-2, h-2); |
1877 | - if(w >= 4 && h >= 4){ | 1862 | - if(w >= 4 && h >= 4){ |
1878 | - QPixmap *pix = bevelFillDict.find(g.button().dark(120).rgb()); | 1863 | - QPixmap *pix = bevelFillDict.find(g.button().dark(120).rgb()); |
@@ -1880,25 +1865,25 @@ Features: | |||
1880 | - int h, s, v; | 1865 | - int h, s, v; |
1881 | - g.button().dark(120).hsv(&h, &s, &v); | 1866 | - g.button().dark(120).hsv(&h, &s, &v); |
1882 | - pix = new QPixmap(*bevelFillPix); | 1867 | - pix = new QPixmap(*bevelFillPix); |
1883 | - adjustHSV(*pix, h, s, v); | 1868 | - adjustHSV(*pix, h, s, v); |
1884 | - bevelFillDict.insert(g.button().dark(120).rgb(), pix); | 1869 | - bevelFillDict.insert(g.button().dark(120).rgb(), pix); |
1885 | - } | 1870 | - } |
1886 | - p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix); | 1871 | - p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix); |
1887 | - } | 1872 | - } |
1888 | -} | 1873 | -} |
1889 | 1874 | ||
1890 | void LiquidStyle::drawFocusRect(QPainter *p, const QRect &r, | 1875 | void LiquidStyle::drawFocusRect(QPainter *p, const QRect &r, |
1891 | const QColorGroup &g, const QColor *c, | 1876 | const QColorGroup &g, const QColor *c, |
1892 | @@ -2536,29 +2263,29 @@ | 1877 | @@ -2536,29 +2257,29 @@ |
1893 | if(p->device()->devType() == QInternal::Widget){ | 1878 | if(p->device()->devType() == QInternal::Widget){ |
1894 | // if so does it use a special focus rectangle? | 1879 | // if so does it use a special focus rectangle? |
1895 | QWidget *w = (QWidget *)p->device(); | 1880 | QWidget *w = (QWidget *)p->device(); |
1896 | - if(w->inherits("QPushButton") || w->inherits("QSlider")){ | 1881 | - if(w->inherits("QPushButton") || w->inherits("QSlider")){ |
1897 | + if(w->inherits("QPushButton") || w->inherits("QSlider") || w->inherits("QComboBox") || w->inherits("QToolButton" )){ | 1882 | + if(w->inherits("QPushButton") || w->inherits("QSlider") || w->inherits("QComboBox") || w->inherits("QToolButton" )){ |
1898 | return; | 1883 | return; |
1899 | } | 1884 | } |
1900 | else{ | 1885 | else{ |
1901 | - KStyle::drawFocusRect(p, r, g, c, atBorder); | 1886 | - KStyle::drawFocusRect(p, r, g, c, atBorder); |
1902 | + QWindowsStyle::drawFocusRect(p, r, g, c, atBorder); | 1887 | + QWindowsStyle::drawFocusRect(p, r, g, c, atBorder); |
1903 | } | 1888 | } |
1904 | } | 1889 | } |
@@ -1915,43 +1900,43 @@ Features: | |||
1915 | + QWindowsStyle::polishPopupMenu(mnu); | 1900 | + QWindowsStyle::polishPopupMenu(mnu); |
1916 | } | 1901 | } |
1917 | 1902 | ||
1918 | void LiquidStyle::drawTab(QPainter *p, const QTabBar *tabBar, QTab *tab, | 1903 | void LiquidStyle::drawTab(QPainter *p, const QTabBar *tabBar, QTab *tab, |
1919 | bool selected) | 1904 | bool selected) |
1920 | { | 1905 | { |
1921 | if(tabBar->shape() != QTabBar::RoundedAbove){ | 1906 | if(tabBar->shape() != QTabBar::RoundedAbove){ |
1922 | - KStyle::drawTab(p, tabBar, tab, selected); | 1907 | - KStyle::drawTab(p, tabBar, tab, selected); |
1923 | + QWindowsStyle::drawTab(p, tabBar, tab, selected); | 1908 | + QWindowsStyle::drawTab(p, tabBar, tab, selected); |
1924 | return; | 1909 | return; |
1925 | } | 1910 | } |
1926 | QPixmap tilePix; | 1911 | QPixmap tilePix; |
1927 | @@ -2671,7 +2398,7 @@ | 1912 | @@ -2671,7 +2392,7 @@ |
1928 | vFrame = 8; // was 10 | 1913 | vFrame = 8; // was 10 |
1929 | } | 1914 | } |
1930 | else | 1915 | else |
1931 | - KStyle::tabbarMetrics(t, hFrame, vFrame, overlap); | 1916 | - KStyle::tabbarMetrics(t, hFrame, vFrame, overlap); |
1932 | + QWindowsStyle::tabbarMetrics(t, hFrame, vFrame, overlap); | 1917 | + QWindowsStyle::tabbarMetrics(t, hFrame, vFrame, overlap); |
1933 | } | 1918 | } |
1934 | 1919 | ||
1935 | 1920 | ||
1936 | @@ -2699,7 +2426,7 @@ | 1921 | @@ -2699,7 +2420,7 @@ |
1937 | p->drawLine(x+1, y+1, x+1, y2-1); | 1922 | p->drawLine(x+1, y+1, x+1, y2-1); |
1938 | } | 1923 | } |
1939 | else if(lineWidth != 2 || !sunken) | 1924 | else if(lineWidth != 2 || !sunken) |
1940 | - KStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); | 1925 | - KStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); |
1941 | + QWindowsStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); | 1926 | + QWindowsStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); |
1942 | else{ | 1927 | else{ |
1943 | QPen oldPen = p->pen(); | 1928 | QPen oldPen = p->pen(); |
1944 | int x2 = x+w-1; | 1929 | int x2 = x+w-1; |
1945 | @@ -2726,105 +2453,6 @@ | 1930 | @@ -2726,105 +2447,6 @@ |
1946 | } | 1931 | } |
1947 | } | 1932 | } |
1948 | 1933 | ||
1949 | -void LiquidStyle::drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h, | 1934 | -void LiquidStyle::drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h, |
1950 | - const QColorGroup &g, QBrush *) | 1935 | - const QColorGroup &g, QBrush *) |
1951 | -{ | 1936 | -{ |
1952 | - p->fillRect(x, y, w, h, g.brush(QColorGroup::Background)); | 1937 | - p->fillRect(x, y, w, h, g.brush(QColorGroup::Background)); |
1953 | - drawClearBevel(p, x, y, w, h, highlightWidget == p->device() ? | 1938 | - drawClearBevel(p, x, y, w, h, highlightWidget == p->device() ? |
1954 | - g.button().light(120) : g.button(), g.button()); | 1939 | - g.button().light(120) : g.button(), g.button()); |
1955 | - /* | 1940 | - /* |
1956 | - if(h > w){ | 1941 | - if(h > w){ |
1957 | - int y2 = y+h-1; | 1942 | - int y2 = y+h-1; |
@@ -2039,25 +2024,25 @@ Features: | |||
2039 | - } | 2024 | - } |
2040 | - | 2025 | - |
2041 | - p->setPen(g.buttonText()); | 2026 | - p->setPen(g.buttonText()); |
2042 | - | 2027 | - |
2043 | - p->drawText(br.x()+ textPos, -1, w-textPos, h, | 2028 | - p->drawText(br.x()+ textPos, -1, w-textPos, h, |
2044 | - AlignLeft|AlignVCenter, s); | 2029 | - AlignLeft|AlignVCenter, s); |
2045 | - } | 2030 | - } |
2046 | - | 2031 | - |
2047 | -} | 2032 | -} |
2048 | 2033 | ||
2049 | void LiquidStyle::adjustHSV(QPixmap &pix, int h, int s, int v) | 2034 | void LiquidStyle::adjustHSV(QPixmap &pix, int h, int s, int v) |
2050 | { | 2035 | { |
2051 | @@ -2988,110 +2616,5 @@ | 2036 | @@ -2988,110 +2610,5 @@ |
2052 | } | 2037 | } |
2053 | } | 2038 | } |
2054 | 2039 | ||
2055 | -// I'm debating if to use QValueList or QList here. I like QValueList better, | 2040 | -// I'm debating if to use QValueList or QList here. I like QValueList better, |
2056 | -// but QList handles pointers which is good for a lot of empty icons... | 2041 | -// but QList handles pointers which is good for a lot of empty icons... |
2057 | - | 2042 | - |
2058 | -void LiquidStyle::loadCustomButtons() | 2043 | -void LiquidStyle::loadCustomButtons() |
2059 | -{ | 2044 | -{ |
2060 | - return; // TODO | 2045 | - return; // TODO |
2061 | - customBtnColorList.clear(); | 2046 | - customBtnColorList.clear(); |
2062 | - customBtnIconList.clear(); | 2047 | - customBtnIconList.clear(); |
2063 | - customBtnLabelList.clear(); | 2048 | - customBtnLabelList.clear(); |
@@ -2150,25 +2135,25 @@ Features: | |||
2150 | - } | 2135 | - } |
2151 | - } | 2136 | - } |
2152 | -} | 2137 | -} |
2153 | - | 2138 | - |
2154 | -#include "liquid.moc" | 2139 | -#include "liquid.moc" |
2155 | - | 2140 | - |
2156 | - | 2141 | - |
2157 | - | 2142 | - |
2158 | - | 2143 | - |
2159 | - | 2144 | - |
2160 | 2145 | ||
2161 | /* vim: set noet sw=8 ts=8: */ | 2146 | /* vim: set noet sw=8 ts=8: */ |
2162 | --- -2002-11-21 20:45:47.000000000 +0100 | 2147 | --- -2002-11-29 12:30:35.000000000 +0100 |
2163 | +++ plugin.cpp2002-11-18 18:11:41.000000000 +0100 | 2148 | +++ plugin.cpp2002-11-18 18:11:41.000000000 +0100 |
2164 | @@ -1,29 +1,84 @@ | 2149 | @@ -1,29 +1,84 @@ |
2165 | +#include <qapplication.h> | 2150 | +#include <qapplication.h> |
2166 | + | 2151 | + |
2167 | #include "liquid.h" | 2152 | #include "liquid.h" |
2168 | -#include <klocale.h> | 2153 | -#include <klocale.h> |
2169 | +#include "liquidset.h" | 2154 | +#include "liquidset.h" |
2170 | +#include "plugin.h" | 2155 | +#include "plugin.h" |
2171 | + | 2156 | + |
2172 | + | 2157 | + |
2173 | + | 2158 | + |
2174 | +LiquidInterface::LiquidInterface ( ) : ref ( 0 ) | 2159 | +LiquidInterface::LiquidInterface ( ) : ref ( 0 ) |