summaryrefslogtreecommitdiff
path: root/noncore/styles/liquid
Unidiff
Diffstat (limited to 'noncore/styles/liquid') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/liquid/opie-liquid.diff167
1 files changed, 110 insertions, 57 deletions
diff --git a/noncore/styles/liquid/opie-liquid.diff b/noncore/styles/liquid/opie-liquid.diff
index f902cb8..ef7300d 100644
--- a/noncore/styles/liquid/opie-liquid.diff
+++ b/noncore/styles/liquid/opie-liquid.diff
@@ -1,13 +1,13 @@
1This is a patch to mosfet's liquid 0.7. 1This is a patch to mosfet's liquid 0.7.
2Features: 2Features:
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 --- -Mon Jun 24 19:05:49 2002 6 --- -Sun Jun 30 22:38:02 2002
7 +++ liquid.hFri Jun 21 14:48:21 2002 7 +++ liquid.hMon Jun 24 19:07:45 2002
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>
@@ -99,31 +99,32 @@ Features:
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 --- -Mon Jun 24 19:05:49 2002 105 --- -Sun Jun 30 22:38:02 2002
106 +++ liquid.cppFri Jun 21 22:02:55 2002 106 +++ liquid.cppSun Jun 30 22:37:56 2002
107@@ -10,12 +10,9 @@ 107@@ -10,12 +10,10 @@
108 108
109 #include <qmenudata.h> 109 #include <qmenudata.h>
110 #include "liquid.h" 110 #include "liquid.h"
111-#include <kapp.h> 111-#include <kapp.h>
112-#include <kglobal.h> 112-#include <kglobal.h>
113-#include <kconfig.h> 113-#include <kconfig.h>
114-#include <kdrawutil.h> 114-#include <kdrawutil.h>
115-#include <kglobalsettings.h> 115-#include <kglobalsettings.h>
116-#include <kpixmapeffect.h> 116-#include <kpixmapeffect.h>
117+#include "liquiddeco.h"
117+#include <qapplication.h> 118+#include <qapplication.h>
118+#include <qpe/config.h> 119+#include <qpe/config.h>
119+#include "effects.h" 120+#include "effects.h"
120 #include <qpalette.h> 121 #include <qpalette.h>
121 #include <qbitmap.h> 122 #include <qbitmap.h>
122 #include <qtabbar.h> 123 #include <qtabbar.h>
123@@ -25,28 +22,29 @@ 124@@ -25,28 +23,29 @@
124 #include <qtimer.h> 125 #include <qtimer.h>
125 #include <qpixmapcache.h> 126 #include <qpixmapcache.h>
126 #include <qradiobutton.h> 127 #include <qradiobutton.h>
127-#include <kimageeffect.h> 128-#include <kimageeffect.h>
128-#include <ktoolbar.h> 129-#include <ktoolbar.h>
129+#include <qcombobox.h> 130+#include <qcombobox.h>
@@ -157,13 +158,13 @@ Features:
157 QImage img(pix.convertToImage()); 158 QImage img(pix.convertToImage());
158- KImageEffect::fade(img, 0.9, color); 159- KImageEffect::fade(img, 0.9, color);
159+ QImageEffect::fade(img, 0.9, color); 160+ QImageEffect::fade(img, 0.9, color);
160 int x, y; 161 int x, y;
161 int r, g, b; 162 int r, g, b;
162 for(y=0; y < img.height(); y+=3){ 163 for(y=0; y < img.height(); y+=3){
163@@ -71,24 +69,21 @@ 164@@ -71,35 +70,37 @@
164 : QObject(parent) 165 : QObject(parent)
165 { 166 {
166 pixDict.setAutoDelete(true); 167 pixDict.setAutoDelete(true);
167- connect(kapp, SIGNAL(kipcMessage(int, int)), this, 168- connect(kapp, SIGNAL(kipcMessage(int, int)), this,
168- SLOT(slotKIPCMessage(int, int))); 169- SLOT(slotKIPCMessage(int, int)));
169 reloadSettings(); 170 reloadSettings();
@@ -186,54 +187,77 @@ Features:
186+ config. setGroup ( "MosfetMenus" ); 187+ config. setGroup ( "MosfetMenus" );
187+ 188+
188+ type = config. readNumEntry("Type", TransStippleBg); 189+ type = config. readNumEntry("Type", TransStippleBg);
189+ color = QColor ( config. readEntry("Color", QApplication::palette().active().button().name())); 190+ color = QColor ( config. readEntry("Color", QApplication::palette().active().button().name()));
190+ fgColor = QColor ( config. readEntry("TextColor", QApplication::palette().active().text().name())); 191+ fgColor = QColor ( config. readEntry("TextColor", QApplication::palette().active().text().name()));
191+ opacity = config. readNumEntry("Opacity", 10); 192+ opacity = config. readNumEntry("Opacity", 10);
193+ if ( opacity < -20 )
194 + opacity = 20;
195+ else if ( opacity > 20 )
196 + opacity = 20;
197+
192+ shadowText = config. readBoolEntry("ShadowText", true); 198+ shadowText = config. readBoolEntry("ShadowText", true);
193 } 199 }
194 200
195 bool TransMenuHandler::eventFilter(QObject *obj, QEvent *ev) 201 bool TransMenuHandler::eventFilter(QObject *obj, QEvent *ev)
196@@ -99,7 +94,7 @@ 202 {
203- QPopupMenu *p = (QPopupMenu *)obj;
204+ QWidget *p = (QWidget *)obj;
205
206 if(ev->type() == QEvent::Show){
197 if(type == TransStippleBg || type == TransStippleBtn || 207 if(type == TransStippleBg || type == TransStippleBtn ||
198 type == Custom){ 208 type == Custom){
199 QApplication::syncX(); 209 QApplication::syncX();
200- KPixmap *pix = new KPixmap; 210- KPixmap *pix = new KPixmap;
201+ QPixmap *pix = new QPixmap; 211+ QPixmap *pix = new QPixmap;
202 if(p->testWFlags(Qt::WType_Popup)){ 212 if(p->testWFlags(Qt::WType_Popup)){
203 QRect r(p->x(), p->y(), p->width(), p->height()); 213 QRect r(p->x(), p->y(), p->width(), p->height());
204 QRect deskR = QApplication::desktop()->rect(); 214 QRect deskR = QApplication::desktop()->rect();
205@@ -107,7 +102,7 @@ 215@@ -107,7 +108,7 @@
206 r.setBottom(deskR.bottom()); 216 r.setBottom(deskR.bottom());
207 r.setRight(deskR.right()); 217 r.setRight(deskR.right());
208 } 218 }
209- *pix = QPixmap::grabWindow(qt_xrootwin(), r.x(), r.y(), 219- *pix = QPixmap::grabWindow(qt_xrootwin(), r.x(), r.y(),
210+ *pix = QPixmap::grabWindow(QApplication::desktop()-> winId(), r.x(), r.y(), 220+ *pix = QPixmap::grabWindow(QApplication::desktop()-> winId(), r.x(), r.y(),
211 r.width(), r.height()); 221 r.width(), r.height());
212 } 222 }
213 else{ // tear off menu 223 else{ // tear off menu
214@@ -121,7 +116,7 @@ 224@@ -121,82 +122,54 @@
215 stripePixmap(*pix, p->colorGroup().button()); 225 stripePixmap(*pix, p->colorGroup().button());
216 } 226 }
217 else{ 227 else{
218- KPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color); 228- KPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color);
219+ QPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color); 229+ QPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color);
220 } 230 }
231+
232+ if (p->inherits("QPopupMenu"))
221 pixDict.insert(p->winId(), pix); 233 pixDict.insert(p->winId(), pix);
234+ else {
235 + p->setBackgroundPixmap(*pix);
236 +
237 + QObjectList *ol = p-> queryList("QWidget");
238 + for ( QObjectListIt it( *ol ); it. current ( ); ++it ) {
239 + QWidget *wid = (QWidget *) it.current ( );
240 +
241 + wid-> setBackgroundPixmap(*pix);
242 + wid-> setBackgroundOrigin(QWidget::ParentOrigin);
243+ }
244 + delete ol;
245 + }
222 } 246 }
223@@ -129,74 +124,19 @@ 247 }
224 else if(ev->type() == QEvent::Hide){ 248 else if(ev->type() == QEvent::Hide){
225 if(type == TransStippleBg || type == TransStippleBtn || 249 if(type == TransStippleBg || type == TransStippleBtn ||
226 type == Custom){ 250 type == Custom){
227- qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width()); 251- qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width());
252- pixDict.remove(p->winId());
253- }
254- }
255- return(false);
256-}
228+// qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width()); 257+// qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width());
229 pixDict.remove(p->winId());
230 }
231 }
232 return(false);
233 }
234 258
235-void TransMenuHandler::slotKIPCMessage(int id, int) 259-void TransMenuHandler::slotKIPCMessage(int id, int)
236-{ 260-{
237- if(id == LIQUID_MENU_CHANGE){ 261- if(id == LIQUID_MENU_CHANGE){
238- bool oldShadow = shadowText; 262- bool oldShadow = shadowText;
239- 263-
@@ -249,15 +273,22 @@ Features:
249- while ((w=it.current()) != 0 ){ 273- while ((w=it.current()) != 0 ){
250- ++it; 274- ++it;
251- if(w->inherits("QPopupMenu")){ 275- if(w->inherits("QPopupMenu")){
252- w->close(); 276- w->close();
253- } 277- }
254- } 278- }
255- 279+ if (p->inherits("QPopupMenu"))
280+ pixDict.remove(p->winId());
281+ else {
282 + p->setBackgroundMode(QWidget::PaletteBackground);
283
256- reloadSettings(); 284- reloadSettings();
257- 285 + QObjectList *ol = p-> queryList("QWidget");
286 + for ( QObjectListIt it( *ol ); it. current ( ); ++it ) {
287 + QWidget *wid = (QWidget *) it.current ( );
288
258- // Now repaint menubar if needed 289- // Now repaint menubar if needed
259- if(shadowText != oldShadow){ 290- if(shadowText != oldShadow){
260- it.toFirst(); 291- it.toFirst();
261- while ((w=it.current()) != 0 ){ 292- while ((w=it.current()) != 0 ){
262- ++it; 293- ++it;
263- if(w->inherits("QMenuBar")){ 294- if(w->inherits("QMenuBar")){
@@ -273,36 +304,40 @@ Features:
273- QWidgetListIt it( *list ); 304- QWidgetListIt it( *list );
274- QWidget *w; 305- QWidget *w;
275- while ((w=it.current()) != 0 ){ 306- while ((w=it.current()) != 0 ){
276- ++it; 307- ++it;
277- if(w->inherits("QPushButton")){ 308- if(w->inherits("QPushButton")){
278- ((LiquidStyle*)parent())->unapplyCustomAttributes((QPushButton *)w); 309- ((LiquidStyle*)parent())->unapplyCustomAttributes((QPushButton *)w);
279- } 310 + wid-> setBackgroundMode( QWidget::PaletteBackground );
311 }
280- } 312- }
281- ((LiquidStyle*)parent())->loadCustomButtons(); 313- ((LiquidStyle*)parent())->loadCustomButtons();
282- it.toFirst(); 314- it.toFirst();
283- while ((w=it.current()) != 0 ){ 315- while ((w=it.current()) != 0 ){
284- ++it; 316- ++it;
285- if(w->inherits("QPushButton")){ 317- if(w->inherits("QPushButton")){
286- ((LiquidStyle*)parent())->applyCustomAttributes((QPushButton *)w); 318- ((LiquidStyle*)parent())->applyCustomAttributes((QPushButton *)w);
287- } 319 + delete ol;
288- } 320 }
321 }
289- 322-
290- } 323 }
291-} 324+ return(false);
325 }
292 326
327+
293 LiquidStyle::LiquidStyle() 328 LiquidStyle::LiquidStyle()
294- :KStyle() 329- :KStyle()
295+ :QWindowsStyle() 330+ :QWindowsStyle()
296 { 331 {
297+ setName ( "LiquidStyle" ); 332+ setName ( "LiquidStyle" );
298+ 333+
299 btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true); 334 btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true);
300 btnMaskBmp.setMask(btnMaskBmp); 335 btnMaskBmp.setMask(btnMaskBmp);
301 htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true); 336 htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true);
302@@ -730,20 +670,19 @@ 337@@ -730,20 +703,19 @@
303 } 338 }
304 339
305 loadCustomButtons(); 340 loadCustomButtons();
306- lowLightVal = 100 + (2*KGlobalSettings::contrast()+4)*10; 341- lowLightVal = 100 + (2*KGlobalSettings::contrast()+4)*10;
307+ lowLightVal = 100 + (2* /*KGlobalSettings::contrast()*/ 3 +4)*10; 342+ lowLightVal = 100 + (2* /*KGlobalSettings::contrast()*/ 3 +4)*10;
308 btnDict.clear(); 343 btnDict.clear();
@@ -322,13 +357,13 @@ Features:
322+ config. setGroup ( "Appearance" ); 357+ config. setGroup ( "Appearance" );
323 + QColor c = QColor ( config. readEntry("Button", ( Qt::lightGray ). name ( ))); 358 + QColor c = QColor ( config. readEntry("Button", ( Qt::lightGray ). name ( )));
324+ if ( c == QColor ( config. readEntry ( "background", ( Qt::lightGray ). name ( )))) { 359+ if ( c == QColor ( config. readEntry ( "background", ( Qt::lightGray ). name ( )))) {
325 // force button color to be different from background 360 // force button color to be different from background
326 QBrush btnBrush(QColor(200, 202, 228)); 361 QBrush btnBrush(QColor(200, 202, 228));
327 appPal.setBrush(QColorGroup::Button, btnBrush); 362 appPal.setBrush(QColorGroup::Button, btnBrush);
328@@ -794,15 +733,7 @@ 363@@ -794,15 +766,7 @@
329 pagerBrush.setPixmap(*pix); 364 pagerBrush.setPixmap(*pix);
330 365
331 // background color stuff 366 // background color stuff
332- c = config->readColorEntry("background", &Qt::lightGray); 367- c = config->readColorEntry("background", &Qt::lightGray);
333- if(qstrcmp(kapp->argv()[0], "kicker") == 0){ 368- if(qstrcmp(kapp->argv()[0], "kicker") == 0){
334- appPal.setColor(QColorGroup::Mid, menuBrush.color().dark(110)); 369- appPal.setColor(QColorGroup::Mid, menuBrush.color().dark(110));
@@ -339,13 +374,13 @@ Features:
339- appPal.setBrush(QColorGroup::Background, menuBrush); 374- appPal.setBrush(QColorGroup::Background, menuBrush);
340- } 375- }
341+ c = QColor ( config. readEntry ( "Background", ( Qt::lightGray ).name ( ))); 376+ c = QColor ( config. readEntry ( "Background", ( Qt::lightGray ).name ( )));
342 c.hsv(&bH, &bS, &bV); 377 c.hsv(&bH, &bS, &bV);
343 c.light(120).hsv(&bHoverH, &bHoverS, &bHoverV); 378 c.light(120).hsv(&bHoverH, &bHoverS, &bHoverV);
344 379
345@@ -825,13 +756,10 @@ 380@@ -825,13 +789,10 @@
346 painter.end(); 381 painter.end();
347 bgBrush.setColor(c); 382 bgBrush.setColor(c);
348 bgBrush.setPixmap(wallPaper); 383 bgBrush.setPixmap(wallPaper);
349- if(qstrcmp(kapp->argv()[0], "kicker") != 0 && 384- if(qstrcmp(kapp->argv()[0], "kicker") != 0 &&
350- qstrcmp(kapp->argv()[0], "ksplash") != 0){ 385- qstrcmp(kapp->argv()[0], "ksplash") != 0){
351 appPal.setBrush(QColorGroup::Background, bgBrush); 386 appPal.setBrush(QColorGroup::Background, bgBrush);
@@ -354,13 +389,13 @@ Features:
354 // lineedits 389 // lineedits
355- c = config->readColorEntry("windowBackground", &Qt::white); 390- c = config->readColorEntry("windowBackground", &Qt::white);
356+ c = QColor ( config. readEntry("Base", ( Qt::white). name ( ))); 391+ c = QColor ( config. readEntry("Base", ( Qt::white). name ( )));
357 QPixmap basePix; 392 QPixmap basePix;
358 basePix.resize(32, 32); 393 basePix.resize(32, 32);
359 basePix.fill(c.rgb()); 394 basePix.fill(c.rgb());
360@@ -857,51 +785,27 @@ 395@@ -857,51 +818,31 @@
361 } 396 }
362 } 397 }
363 398
364- config->setGroup(oldGrp); 399- config->setGroup(oldGrp);
365 } 400 }
366 401
@@ -372,12 +407,15 @@ Features:
372+ //((QFrame*)w)->setLineWidth(0); 407+ //((QFrame*)w)->setLineWidth(0);
373+ w->setBackgroundMode(QWidget::PaletteBackground); 408+ w->setBackgroundMode(QWidget::PaletteBackground);
374 return; 409 return;
375 } 410 }
376 if(w->inherits("QPopupMenu")) 411 if(w->inherits("QPopupMenu"))
377 w->setBackgroundMode(QWidget::NoBackground); 412 w->setBackgroundMode(QWidget::NoBackground);
413+ else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) {
414 + w->installEventFilter(menuHandler);
415+ }
378 416
379 if(w->isTopLevel()){ 417 if(w->isTopLevel()){
380- if(!w->inherits("QPopupMenu") && 418- if(!w->inherits("QPopupMenu") &&
381- qstrcmp(kapp->argv()[0], "kicker") == 0){ 419- qstrcmp(kapp->argv()[0], "kicker") == 0){
382- qWarning("Got panel toplevel %s", w->className()); 420- qWarning("Got panel toplevel %s", w->className());
383- // force extensions and child panels to use proper palette. 421- // force extensions and child panels to use proper palette.
@@ -399,35 +437,36 @@ Features:
399 return; 437 return;
400 } 438 }
401- if(qstrcmp(kapp->argv()[0], "kicker") == 0 && 439- if(qstrcmp(kapp->argv()[0], "kicker") == 0 &&
402- w->inherits("KPanelExtension")){ // FIXME - doesn't work 440- w->inherits("KPanelExtension")){ // FIXME - doesn't work
403- w->setPalette(kapp->palette()); 441- w->setPalette(kapp->palette());
404- } 442- }
443+
405+ 444+
406+ w-> setBackgroundOrigin ( QWidget::ParentOrigin ); 445+ w-> setBackgroundOrigin ( QWidget::ParentOrigin );
407 446
408 if(w->inherits("QComboBox") || 447 if(w->inherits("QComboBox") ||
409 w->inherits("QLineEdit") || w->inherits("QRadioButton") || 448 w->inherits("QLineEdit") || w->inherits("QRadioButton") ||
410- w->inherits("QCheckBox") || w->inherits("QScrollBar") || 449- w->inherits("QCheckBox") || w->inherits("QScrollBar") ||
411- w->isA("AppletHandle") || w->inherits("KMiniPagerButton") || 450- w->isA("AppletHandle") || w->inherits("KMiniPagerButton") ||
412- w->inherits("TaskContainer")){ 451- w->inherits("TaskContainer")){
413+ w->inherits("QCheckBox") || w->inherits("QScrollBar")) { 452+ w->inherits("QCheckBox") || w->inherits("QScrollBar")) {
414 w->installEventFilter(this); 453 w->installEventFilter(this);
415 } 454 }
416 if(w->inherits("QLineEdit")){ 455 if(w->inherits("QLineEdit")){
417@@ -913,6 +817,9 @@ 456@@ -913,6 +854,9 @@
418 applyCustomAttributes((QPushButton *)w); 457 applyCustomAttributes((QPushButton *)w);
419 w->installEventFilter(this); 458 w->installEventFilter(this);
420 } 459 }
421+ if(w->inherits("QButton") || w-> inherits("QComboBox")){ 460+ if(w->inherits("QButton") || w-> inherits("QComboBox")){
422 + w-> setBackgroundMode ( QWidget::PaletteBackground ); 461 + w-> setBackgroundMode ( QWidget::PaletteBackground );
423+ } 462+ }
424 463
425 bool isViewport = qstrcmp(w->name(), "qt_viewport") == 0 || 464 bool isViewport = qstrcmp(w->name(), "qt_viewport") == 0 ||
426 qstrcmp(w->name(), "qt_clipped_viewport") == 0; 465 qstrcmp(w->name(), "qt_clipped_viewport") == 0;
427@@ -942,11 +849,12 @@ 466@@ -942,11 +886,12 @@
428 w->setMouseTracking(true); 467 w->setMouseTracking(true);
429 w->installEventFilter(this); 468 w->installEventFilter(this);
430 } 469 }
431+ if(w-> inherits("QToolButton")) { 470+ if(w-> inherits("QToolButton")) {
432 + ((QToolButton*)w)->setAutoRaise (false); 471 + ((QToolButton*)w)->setAutoRaise (false);
433+ } 472+ }
@@ -436,13 +475,13 @@ Features:
436 } 475 }
437- if(w->inherits("PanelButtonBase")) 476- if(w->inherits("PanelButtonBase"))
438- return; 477- return;
439 478
440 if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())-> 479 if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())->
441 palette().active().brush(QColorGroup::Background).pixmap()){ 480 palette().active().brush(QColorGroup::Background).pixmap()){
442@@ -954,17 +862,18 @@ 481@@ -954,17 +899,18 @@
443 return; 482 return;
444 } 483 }
445 if(!isViewport && !isViewportChild && !w->testWFlags(WType_Popup) && 484 if(!isViewport && !isViewportChild && !w->testWFlags(WType_Popup) &&
446- !w->inherits("KDesktop") && !w->inherits("PasswordDlg")){ 485- !w->inherits("KDesktop") && !w->inherits("PasswordDlg")){
447 + !( !w-> inherits("QLineEdit") && w-> parent() && w-> parent()-> isWidgetType ( ) && w-> parent()-> inherits ( "QMultiLineEdit" ))) { 486 + !( !w-> inherits("QLineEdit") && w-> parent() && w-> parent()-> isWidgetType ( ) && w-> parent()-> inherits ( "QMultiLineEdit" ))) {
448 if(w->backgroundMode() == QWidget::PaletteBackground || 487 if(w->backgroundMode() == QWidget::PaletteBackground ||
@@ -458,13 +497,23 @@ Features:
458 return; 497 return;
459 } 498 }
460+ 499+
461 } 500 }
462 501
463 void LiquidStyle::unPolish(QWidget *w) 502 void LiquidStyle::unPolish(QWidget *w)
464@@ -1001,12 +910,14 @@ 503@@ -977,6 +923,9 @@
504
505 if(w->inherits("QPopupMenu"))
506 w->setBackgroundMode(QWidget::PaletteButton);
507+ else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) {
508 + w->removeEventFilter(menuHandler);
509+ }
510
511 if(w->isTopLevel())
512 return;
513@@ -1001,12 +950,14 @@
465 unapplyCustomAttributes((QPushButton *)w); 514 unapplyCustomAttributes((QPushButton *)w);
466 w->removeEventFilter(this); 515 w->removeEventFilter(this);
467 } 516 }
468- 517-
469+/* 518+/*
470+ if(w->inherits("QPushButton") || w-> inherits("QComboBox")){ 519+ if(w->inherits("QPushButton") || w-> inherits("QComboBox")){
@@ -477,25 +526,25 @@ Features:
477- w->isA("AppletHandle") || w->inherits("KMiniPagerButton") || 526- w->isA("AppletHandle") || w->inherits("KMiniPagerButton") ||
478- w->inherits("TaskContainer")){ 527- w->inherits("TaskContainer")){
479+ w->inherits("QCheckBox") || w->inherits("QScrollBar")) { 528+ w->inherits("QCheckBox") || w->inherits("QScrollBar")) {
480 w->removeEventFilter(this); 529 w->removeEventFilter(this);
481 } 530 }
482 if(w->inherits("QButton") || w->inherits("QComboBox")){ 531 if(w->inherits("QButton") || w->inherits("QComboBox")){
483@@ -1014,9 +925,9 @@ 532@@ -1014,9 +965,9 @@
484 w->setAutoMask(false); 533 w->setAutoMask(false);
485 } 534 }
486 } 535 }
487- if(w->inherits("KToolBar")){ 536- if(w->inherits("KToolBar")){
488+ if(w->inherits("QToolBar")){ 537+ if(w->inherits("QToolBar")){
489 w->removeEventFilter(this); 538 w->removeEventFilter(this);
490- //w->setBackgroundMode(QWidget::PaletteBackground); 539- //w->setBackgroundMode(QWidget::PaletteBackground);
491+ w->setBackgroundMode(QWidget::PaletteBackground); 540+ w->setBackgroundMode(QWidget::PaletteBackground);
492 return; 541 return;
493 } 542 }
494 if(w->inherits("QHeader")){ 543 if(w->inherits("QHeader")){
495@@ -1028,20 +939,24 @@ 544@@ -1028,20 +979,28 @@
496 void LiquidStyle::polish(QApplication *app) 545 void LiquidStyle::polish(QApplication *app)
497 { 546 {
498 547
499- KStyle::polish(app); 548- KStyle::polish(app);
500+ QWindowsStyle::polish(app); 549+ QWindowsStyle::polish(app);
501 menuAni = app->isEffectEnabled(UI_AnimateMenu); 550 menuAni = app->isEffectEnabled(UI_AnimateMenu);
@@ -503,35 +552,39 @@ Features:
503 if(menuAni) 552 if(menuAni)
504 app->setEffectEnabled(UI_AnimateMenu, false); 553 app->setEffectEnabled(UI_AnimateMenu, false);
505 if(menuFade) 554 if(menuFade)
506 app->setEffectEnabled(UI_FadeMenu, false); 555 app->setEffectEnabled(UI_FadeMenu, false);
507 + 556 +
508+ qt_set_draw_menu_bar_impl((QDrawMenuBarItemImpl) &LiquidStyle::drawMenuBarItem); 557+ qt_set_draw_menu_bar_impl((QDrawMenuBarItemImpl) &LiquidStyle::drawMenuBarItem);
558+
559+ QApplication::qwsSetDecoration ( new LiquidDecoration ( ));
509 } 560 }
510 561
511 void LiquidStyle::unPolish(QApplication *app) 562 void LiquidStyle::unPolish(QApplication *app)
512 { 563 {
513- KStyle::unPolish(app); 564- KStyle::unPolish(app);
514+ QWindowsStyle::unPolish(app); 565+ QWindowsStyle::unPolish(app);
515 app->setEffectEnabled(UI_AnimateMenu, menuAni); 566 app->setEffectEnabled(UI_AnimateMenu, menuAni);
516 app->setEffectEnabled(UI_FadeMenu, menuFade); 567 app->setEffectEnabled(UI_FadeMenu, menuFade);
517+ 568+
518+ qt_set_draw_menu_bar_impl ( 0 ); 569+ qt_set_draw_menu_bar_impl ( 0 );
570+
571+ QApplication::qwsSetDecoration ( new QPEDecoration ( ));
519 } 572 }
520 573
521 /* 574 /*
522@@ -1063,7 +978,7 @@ 575@@ -1063,7 +1022,7 @@
523 */ 576 */
524 bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev) 577 bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev)
525 { 578 {
526- if(obj->inherits("KToolBar")){ 579- if(obj->inherits("KToolBar")){
527+ if(obj->inherits("QToolBar")){ 580+ if(obj->inherits("QToolBar")){
528 if(ev->type() == QEvent::Resize){ 581 if(ev->type() == QEvent::Resize){
529 const QObjectList *tbChildList = obj->children(); 582 const QObjectList *tbChildList = obj->children();
530 QObjectListIt it(*tbChildList); 583 QObjectListIt it(*tbChildList);
531@@ -1076,35 +991,7 @@ 584@@ -1076,35 +1035,7 @@
532 585
533 } 586 }
534 } 587 }
535- else if(obj->inherits("KMiniPagerButton")){ 588- else if(obj->inherits("KMiniPagerButton")){
536- QButton *btn = (QButton *)obj; 589- QButton *btn = (QButton *)obj;
537- if(ev->type() == QEvent::Paint){ 590- if(ev->type() == QEvent::Paint){
@@ -562,13 +615,13 @@ Features:
562- else if(obj->inherits("QPushButton") || obj->inherits("QComboBox") || 615- else if(obj->inherits("QPushButton") || obj->inherits("QComboBox") ||
563- obj->isA("AppletHandle")){ 616- obj->isA("AppletHandle")){
564+ else if(obj->inherits("QPushButton") || obj->inherits("QComboBox")){ 617+ else if(obj->inherits("QPushButton") || obj->inherits("QComboBox")){
565 QWidget *btn = (QWidget *)obj; 618 QWidget *btn = (QWidget *)obj;
566 if(ev->type() == QEvent::Enter){ 619 if(ev->type() == QEvent::Enter){
567 if(btn->isEnabled()){ 620 if(btn->isEnabled()){
568@@ -1119,20 +1006,7 @@ 621@@ -1119,20 +1050,7 @@
569 } 622 }
570 } 623 }
571 } 624 }
572- else if(obj->inherits("TaskContainer")){ 625- else if(obj->inherits("TaskContainer")){
573- QButton *btn = (QButton *)obj; 626- QButton *btn = (QButton *)obj;
574- QPalette pal = btn->palette(); 627- QPalette pal = btn->palette();
@@ -584,25 +637,25 @@ Features:
584- } 637- }
585- else if(obj->inherits("QToolButton") && !obj->inherits("KToolBarButton")){ 638- else if(obj->inherits("QToolButton") && !obj->inherits("KToolBarButton")){
586+ else if(obj->inherits("QToolButton")){ 639+ else if(obj->inherits("QToolButton")){
587 QToolButton *btn = (QToolButton *)btn; 640 QToolButton *btn = (QToolButton *)btn;
588 if(!btn->autoRaise()){ 641 if(!btn->autoRaise()){
589 if(btn->isEnabled()){ 642 if(btn->isEnabled()){
590@@ -1340,11 +1214,6 @@ 643@@ -1340,11 +1258,6 @@
591 QColorGroup g = btn->colorGroup(); 644 QColorGroup g = btn->colorGroup();
592 645
593 646
594- QColor testColor; 647- QColor testColor;
595- if(btn->parent() && btn->parent()->isWidgetType()){ 648- if(btn->parent() && btn->parent()->isWidgetType()){
596- testColor = p->backgroundColor(); // remove me 649- testColor = p->backgroundColor(); // remove me
597- } 650- }
598- 651-
599 //int dw = buttonDefaultIndicatorWidth(); 652 //int dw = buttonDefaultIndicatorWidth();
600 if(btn->hasFocus() || btn->isDefault()){ 653 if(btn->hasFocus() || btn->isDefault()){
601 QColor c = btn->hasFocus() ? g.button().light(110) : g.background(); 654 QColor c = btn->hasFocus() ? g.button().light(110) : g.background();
602@@ -2065,203 +1934,24 @@ 655@@ -2065,203 +1978,24 @@
603 p->drawLineSegments(a); 656 p->drawLineSegments(a);
604 } 657 }
605 658
606-void LiquidStyle::drawKBarHandle(QPainter *p, int x, int y, int w, int h, 659-void LiquidStyle::drawKBarHandle(QPainter *p, int x, int y, int w, int h,
607- const QColorGroup &g, KToolBarPos, 660- const QColorGroup &g, KToolBarPos,
608- QBrush *) 661- QBrush *)
@@ -657,15 +710,15 @@ Features:
657- p->drawLine(x2-4, y+1, x2-6, y+1); 710- p->drawLine(x2-4, y+1, x2-6, y+1);
658- } 711- }
659- else{ 712- else{
660- qDrawShadePanel(p, x, y, w, h, g, false, 1, 713- qDrawShadePanel(p, x, y, w, h, g, false, 1,
661- &g.brush(QColorGroup::Background)); 714- &g.brush(QColorGroup::Background));
662- } 715- }
663
664-}
665- 716-
717-}
718
666-void LiquidStyle::drawKToolBar(QPainter *p, int x, int y, int w, int h, 719-void LiquidStyle::drawKToolBar(QPainter *p, int x, int y, int w, int h,
667- const QColorGroup &g, KToolBarPos, QBrush *) 720- const QColorGroup &g, KToolBarPos, QBrush *)
668+void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, 721+void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h,
669+ QMenuItem *mi, QColorGroup &g, bool enabled, bool active ) 722+ QMenuItem *mi, QColorGroup &g, bool enabled, bool active )
670 { 723 {
671- //p->fillRect(x, y, w, h, g.brush(QColorGroup::Background)); 724- //p->fillRect(x, y, w, h, g.brush(QColorGroup::Background));
@@ -690,14 +743,13 @@ Features:
690- if(btn->parent() && btn->parent()->isWidgetType() && btn->parent()->inherits("QToolBar")) 743- if(btn->parent() && btn->parent()->isWidgetType() && btn->parent()->inherits("QToolBar"))
691- toolbar = static_cast<QToolBar*>(btn->parent()); 744- toolbar = static_cast<QToolBar*>(btn->parent());
692- 745-
693- --w, --h; 746- --w, --h;
694- if(sunken) 747- if(sunken)
695- ++x, ++y; 748- ++x, ++y;
696+ p-> fillRect ( x, y, w, h, g.brush(QColorGroup::Background)); 749-
697
698- QColor btnColor(sunken ? g.button() : raised ? g.button().light(110) : 750- QColor btnColor(sunken ? g.button() : raised ? g.button().light(110) :
699- g.background()); 751- g.background());
700- drawClearBevel(p, x, y, w, h, btnColor, g.background()); 752- drawClearBevel(p, x, y, w, h, btnColor, g.background());
701- 753-
702- p->setPen(g.text()); 754- p->setPen(g.text());
703- 755-
@@ -790,13 +842,14 @@ Features:
790- g, true); 842- g, true);
791- else 843- else
792- qDrawArrow (p, Qt::DownArrow, Qt::WindowsStyle, false, w-5, h-5, 844- qDrawArrow (p, Qt::DownArrow, Qt::WindowsStyle, false, w-5, h-5,
793- 0, 0, g, false); 845- 0, 0, g, false);
794- } 846- }
795-} 847-}
796- 848+ p-> fillRect ( x, y, w, h, g.brush(QColorGroup::Background));
849
797- 850-
798-void LiquidStyle::drawKMenuItem(QPainter *p, int x, int y, int w, int h, 851-void LiquidStyle::drawKMenuItem(QPainter *p, int x, int y, int w, int h,
799- const QColorGroup &g, bool active, QMenuItem *mi, 852- const QColorGroup &g, bool active, QMenuItem *mi,
800- QBrush *) 853- QBrush *)
801-{ 854-{
802- if ( p->font() == KGlobalSettings::generalFont() ) 855- if ( p->font() == KGlobalSettings::generalFont() )
@@ -810,31 +863,31 @@ Features:
810- shadow = ((KMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) : 863- shadow = ((KMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) :
811+ ((QWidget *)p->device())->inherits("QMenuBar")){ 864+ ((QWidget *)p->device())->inherits("QMenuBar")){
812+ shadow = ((QMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) : 865+ shadow = ((QMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) :
813 g.background().dark(130); 866 g.background().dark(130);
814 } 867 }
815 else 868 else
816@@ -2336,8 +2026,6 @@ 869@@ -2336,8 +2070,6 @@
817 870
818 maxpmw = QMAX( maxpmw, 20 ); 871 maxpmw = QMAX( maxpmw, 20 );
819 872
820- if ( p->font() == KGlobalSettings::generalFont() ) 873- if ( p->font() == KGlobalSettings::generalFont() )
821- p->setFont( KGlobalSettings::menuFont() ); 874- p->setFont( KGlobalSettings::menuFont() );
822 875
823 bool dis = !enabled; 876 bool dis = !enabled;
824 QColorGroup itemg = dis ? pal.disabled() : pal.active(); 877 QColorGroup itemg = dis ? pal.disabled() : pal.active();
825@@ -2363,7 +2051,7 @@ 878@@ -2363,7 +2095,7 @@
826 p->fillRect(x, y, w, h, menuBrush); 879 p->fillRect(x, y, w, h, menuBrush);
827 } 880 }
828 else{ 881 else{
829- KPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); 882- KPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId());
830+ QPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); 883+ QPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId());
831 if(pix) 884 if(pix)
832 p->drawPixmap(x, y, *pix, x, y, w, h); 885 p->drawPixmap(x, y, *pix, x, y, w, h);
833 } 886 }
834@@ -2508,25 +2196,6 @@ 887@@ -2508,25 +2240,6 @@
835 return h; 888 return h;
836 } 889 }
837 890
838-void LiquidStyle::drawKProgressBlock(QPainter *p, int x, int y, int w, int h, 891-void LiquidStyle::drawKProgressBlock(QPainter *p, int x, int y, int w, int h,
839- const QColorGroup &g, QBrush *fill) 892- const QColorGroup &g, QBrush *fill)
840-{ 893-{
@@ -854,13 +907,13 @@ Features:
854- p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix); 907- p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix);
855- } 908- }
856-} 909-}
857 910
858 void LiquidStyle::drawFocusRect(QPainter *p, const QRect &r, 911 void LiquidStyle::drawFocusRect(QPainter *p, const QRect &r,
859 const QColorGroup &g, const QColor *c, 912 const QColorGroup &g, const QColor *c,
860@@ -2540,25 +2209,25 @@ 913@@ -2540,25 +2253,25 @@
861 return; 914 return;
862 } 915 }
863 else{ 916 else{
864- KStyle::drawFocusRect(p, r, g, c, atBorder); 917- KStyle::drawFocusRect(p, r, g, c, atBorder);
865+ QWindowsStyle::drawFocusRect(p, r, g, c, atBorder); 918+ QWindowsStyle::drawFocusRect(p, r, g, c, atBorder);
866 } 919 }
@@ -884,31 +937,31 @@ Features:
884 if(tabBar->shape() != QTabBar::RoundedAbove){ 937 if(tabBar->shape() != QTabBar::RoundedAbove){
885- KStyle::drawTab(p, tabBar, tab, selected); 938- KStyle::drawTab(p, tabBar, tab, selected);
886+ QWindowsStyle::drawTab(p, tabBar, tab, selected); 939+ QWindowsStyle::drawTab(p, tabBar, tab, selected);
887 return; 940 return;
888 } 941 }
889 QPixmap tilePix; 942 QPixmap tilePix;
890@@ -2671,7 +2340,7 @@ 943@@ -2671,7 +2384,7 @@
891 vFrame = 8; // was 10 944 vFrame = 8; // was 10
892 } 945 }
893 else 946 else
894- KStyle::tabbarMetrics(t, hFrame, vFrame, overlap); 947- KStyle::tabbarMetrics(t, hFrame, vFrame, overlap);
895+ QWindowsStyle::tabbarMetrics(t, hFrame, vFrame, overlap); 948+ QWindowsStyle::tabbarMetrics(t, hFrame, vFrame, overlap);
896 } 949 }
897 950
898 951
899@@ -2699,7 +2368,7 @@ 952@@ -2699,7 +2412,7 @@
900 p->drawLine(x+1, y+1, x+1, y2-1); 953 p->drawLine(x+1, y+1, x+1, y2-1);
901 } 954 }
902 else if(lineWidth != 2 || !sunken) 955 else if(lineWidth != 2 || !sunken)
903- KStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); 956- KStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill);
904+ QWindowsStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); 957+ QWindowsStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill);
905 else{ 958 else{
906 QPen oldPen = p->pen(); 959 QPen oldPen = p->pen();
907 int x2 = x+w-1; 960 int x2 = x+w-1;
908@@ -2726,105 +2395,6 @@ 961@@ -2726,105 +2439,6 @@
909 } 962 }
910 } 963 }
911 964
912-void LiquidStyle::drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h, 965-void LiquidStyle::drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h,
913- const QColorGroup &g, QBrush *) 966- const QColorGroup &g, QBrush *)
914-{ 967-{
@@ -1008,13 +1061,13 @@ Features:
1008- } 1061- }
1009- 1062-
1010-} 1063-}
1011 1064
1012 void LiquidStyle::adjustHSV(QPixmap &pix, int h, int s, int v) 1065 void LiquidStyle::adjustHSV(QPixmap &pix, int h, int s, int v)
1013 { 1066 {
1014@@ -2998,22 +2568,22 @@ 1067@@ -2998,22 +2612,22 @@
1015 customBtnIconList.clear(); 1068 customBtnIconList.clear();
1016 customBtnLabelList.clear(); 1069 customBtnLabelList.clear();
1017 1070
1018- KConfig *config = KGlobal::config(); 1071- KConfig *config = KGlobal::config();
1019- QString oldGrp = config->group(); 1072- QString oldGrp = config->group();
1020- config->setGroup("MosfetButtons"); 1073- config->setGroup("MosfetButtons");
@@ -1038,40 +1091,40 @@ Features:
1038 1091
1039- KIconLoader *ldr = KGlobal::iconLoader(); 1092- KIconLoader *ldr = KGlobal::iconLoader();
1040+// KIconLoader *ldr = KGlobal::iconLoader(); 1093+// KIconLoader *ldr = KGlobal::iconLoader();
1041 while(labelStr != NULL){ 1094 while(labelStr != NULL){
1042 QColor *c = new QColor; 1095 QColor *c = new QColor;
1043 c->setNamedColor(QString(colorStr)); 1096 c->setNamedColor(QString(colorStr));
1044@@ -3022,7 +2592,7 @@ 1097@@ -3022,7 +2636,7 @@
1045 QString tmpStr(iconStr); 1098 QString tmpStr(iconStr);
1046 if(!tmpStr.isEmpty()){ 1099 if(!tmpStr.isEmpty()){
1047 QPixmap *pixmap = 1100 QPixmap *pixmap =
1048- new QPixmap(ldr->loadIcon(tmpStr, KIcon::Small)); 1101- new QPixmap(ldr->loadIcon(tmpStr, KIcon::Small));
1049+ new QPixmap();//ldr->loadIcon(tmpStr, KIcon::Small)); 1102+ new QPixmap();//ldr->loadIcon(tmpStr, KIcon::Small));
1050 if(pixmap->isNull()){ 1103 if(pixmap->isNull()){
1051 delete pixmap; 1104 delete pixmap;
1052 customBtnIconList.append(NULL); 1105 customBtnIconList.append(NULL);
1053@@ -3037,7 +2607,6 @@ 1106@@ -3037,7 +2651,6 @@
1054 colorStr = colorList.next(); 1107 colorStr = colorList.next();
1055 iconStr = iconList.next(); 1108 iconStr = iconList.next();
1056 } 1109 }
1057- config->setGroup(oldGrp); 1110- config->setGroup(oldGrp);
1058 } 1111 }
1059 1112
1060 void LiquidStyle::applyCustomAttributes(QPushButton *btn) 1113 void LiquidStyle::applyCustomAttributes(QPushButton *btn)
1061@@ -3087,7 +2656,7 @@ 1114@@ -3087,7 +2700,7 @@
1062 } 1115 }
1063 } 1116 }
1064 1117
1065-#include "liquid.moc" 1118-#include "liquid.moc"
1066+// #include "liquid.moc" 1119+// #include "liquid.moc"
1067 1120
1068 1121
1069 1122
1070 --- -Mon Jun 24 19:05:49 2002 1123 --- -Sun Jun 30 22:38:02 2002
1071 +++ plugin.cppThu Jun 20 20:01:37 2002 1124 +++ plugin.cppFri Jun 28 13:25:25 2002
1072@@ -1,29 +1,29 @@ 1125@@ -1,29 +1,29 @@
1073 #include "liquid.h" 1126 #include "liquid.h"
1074-#include <klocale.h> 1127-#include <klocale.h>
1075+ 1128+
1076 1129
1077 extern "C" { 1130 extern "C" {
@@ -1107,8 +1160,8 @@ Features:
1107 } 1160 }
1108 1161
1109-const char *description() 1162-const char *description()
1110+const char *description ( ) 1163+const char *description ( )
1111 { 1164 {
1112- return(i18n("High performance liquid plugin").utf8()); 1165- return(i18n("High performance liquid plugin").utf8());
1113+ return "High performance liquid plugin"; 1166+ return "High Performance Liquid";
1114 } 1167 }