-rw-r--r-- | noncore/styles/liquid/embeddata.h | 2 | ||||
-rw-r--r-- | noncore/styles/liquid/liquid.cpp | 20 | ||||
-rw-r--r-- | noncore/styles/liquid/opie-liquid.diff | 141 |
3 files changed, 112 insertions, 51 deletions
diff --git a/noncore/styles/liquid/embeddata.h b/noncore/styles/liquid/embeddata.h index e4ccc27..5207fb1 100644 --- a/noncore/styles/liquid/embeddata.h +++ b/noncore/styles/liquid/embeddata.h @@ -974,5 +974,5 @@ static int cmpEmbedImage(const void *a, const void *b) return strcmp(ea->name,eb->name); } -inline const QImage& qembed_findImage(const char* name) +static const QImage& qembed_findImage(const char* name) { EmbedImage key; key.name = name; diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp index ba732aa..c8f8d20 100644 --- a/noncore/styles/liquid/liquid.cpp +++ b/noncore/styles/liquid/liquid.cpp @@ -2006,13 +2006,22 @@ void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, shadow = g.background().dark(130); + QPixmap *dummy = 0; + + if ( mi-> pixmap ( ) && !mi-> pixmap ( )-> isNull ( )) { + dummy = new QPixmap ( mi-> pixmap ( )-> size ( )); + QBitmap dummy_mask ( dummy-> size ( )); + dummy_mask. fill ( color1 ); + dummy-> setMask ( dummy_mask ); + } + if(active){ drawClearBevel(p, x+1, y+1, w-1, h-1, g.button(), g.background()); QApplication::style().drawItem(p, x+1, y+1, w, h, AlignCenter|ShowPrefix|DontClip|SingleLine, - g, mi->isEnabled(), NULL, mi->text(), + g, mi->isEnabled(), dummy, mi->text(), -1, &shadow); QApplication::style().drawItem(p, x, y, w, h, AlignCenter|ShowPrefix|DontClip|SingleLine, - g, mi->isEnabled(), NULL, mi->text(), + g, mi->isEnabled(), mi-> pixmap ( ), mi->text(), -1, &g.text()); } @@ -2020,11 +2029,12 @@ void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, QApplication::style().drawItem(p, x+1, y+1, w, h, AlignCenter|ShowPrefix|DontClip|SingleLine, - g, mi->isEnabled(), NULL, mi->text(), + g, mi->isEnabled(), dummy, mi->text(), -1, &shadow); QApplication::style().drawItem(p, x, y, w, h, AlignCenter|ShowPrefix|DontClip|SingleLine, - g, mi->isEnabled(), NULL, mi->text(), + g, mi->isEnabled(), mi-> pixmap ( ), mi->text(), -1, &g.text()); } + delete dummy; } else{ @@ -2033,5 +2043,5 @@ void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, QApplication::style().drawItem(p, x, y, w, h, AlignCenter|ShowPrefix|DontClip|SingleLine, - g, mi->isEnabled(), NULL, mi->text(), + g, mi->isEnabled(), mi-> pixmap ( ), mi->text(), -1, &g.text()); } diff --git a/noncore/styles/liquid/opie-liquid.diff b/noncore/styles/liquid/opie-liquid.diff index 29ae6f3..d90433c 100644 --- a/noncore/styles/liquid/opie-liquid.diff +++ b/noncore/styles/liquid/opie-liquid.diff @@ -4,5 +4,5 @@ Features: - works with Qt/E on QPE/OPIE ---- - 2002-11-18 04:47:41.000000000 +0100 +--- - 2002-11-21 20:45:47.000000000 +0100 +++ liquid.h 2002-11-18 03:32:40.000000000 +0100 @@ -2,7 +2,7 @@ @@ -142,6 +142,6 @@ Features: TransMenuHandler *menuHandler; QPixmap *pixmaps[BITMAP_ITEMS]; ---- - 2002-11-18 04:47:41.000000000 +0100 -+++ liquid.cpp 2002-11-18 04:46:13.000000000 +0100 +--- - 2002-11-21 20:45:47.000000000 +0100 ++++ liquid.cpp 2002-11-21 20:27:48.000000000 +0100 @@ -2,6 +2,9 @@ * Copyright (C)QPL 2001 Daniel M. Duley. All rights reserved. @@ -342,7 +342,8 @@ Features: - if(w->inherits("QMenuBar")){ - w->repaint(); -- } -- } + wid-> setBackgroundMode( QWidget::PaletteBackground ); + } ++ delete ol; + } } - } @@ -365,7 +366,6 @@ Features: - if(w->inherits("QPushButton")){ - ((LiquidStyle*)parent())->applyCustomAttributes((QPushButton *)w); -+ delete ol; - } - } +- } +- } + return(false); +} @@ -495,8 +495,8 @@ Features: + case CBDown: + pixmaps[CBDown] = processEmbedded("checkboxdown", btnH, btnS, btnV /*, true*/); - break; ++ break; + case CBDownHover: + pixmaps[CBDownHover] = processEmbedded("checkboxdown", btnHoverH, btnHoverS, btnHoverV /*, true*/); -+ break; + break; + case VSlider: @@ -1573,5 +1573,5 @@ Features: { p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider)->mask() : -@@ -2065,203 +1980,26 @@ +@@ -2065,243 +1980,76 @@ p->drawLineSegments(a); } @@ -1634,7 +1634,7 @@ Features: - &g.brush(QColorGroup::Background)); - } -- --} +-} +- -void LiquidStyle::drawKToolBar(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, KToolBarPos, QBrush *) @@ -1789,5 +1789,51 @@ Features: } else -@@ -2300,8 +2038,8 @@ + shadow = g.background().dark(130); + ++ QPixmap *dummy = 0; ++ ++ if ( mi-> pixmap ( ) && !mi-> pixmap ( )-> isNull ( )) { ++ dummy = new QPixmap ( mi-> pixmap ( )-> size ( )); ++ QBitmap dummy_mask ( dummy-> size ( )); ++ dummy_mask. fill ( color1 ); ++ dummy-> setMask ( dummy_mask ); ++ } ++ + if(active){ + drawClearBevel(p, x+1, y+1, w-1, h-1, g.button(), g.background()); + QApplication::style().drawItem(p, x+1, y+1, w, h, + AlignCenter|ShowPrefix|DontClip|SingleLine, +- g, mi->isEnabled(), NULL, mi->text(), ++ g, mi->isEnabled(), dummy, mi->text(), + -1, &shadow); + QApplication::style().drawItem(p, x, y, w, h, + AlignCenter|ShowPrefix|DontClip|SingleLine, +- g, mi->isEnabled(), NULL, mi->text(), ++ g, mi->isEnabled(), mi-> pixmap ( ), mi->text(), + -1, &g.text()); + } + else{ + QApplication::style().drawItem(p, x+1, y+1, w, h, + AlignCenter|ShowPrefix|DontClip|SingleLine, +- g, mi->isEnabled(), NULL, mi->text(), ++ g, mi->isEnabled(), dummy, mi->text(), + -1, &shadow); + QApplication::style().drawItem(p, x, y, w, h, + AlignCenter|ShowPrefix|DontClip|SingleLine, +- g, mi->isEnabled(), NULL, mi->text(), ++ g, mi->isEnabled(), mi-> pixmap ( ), mi->text(), + -1, &g.text()); + } ++ delete dummy; + } + else{ + if(active) + drawClearBevel(p, x+1, y+1, w-1, h-1, g.button(), g.background()); + QApplication::style().drawItem(p, x, y, w, h, + AlignCenter|ShowPrefix|DontClip|SingleLine, +- g, mi->isEnabled(), NULL, mi->text(), ++ g, mi->isEnabled(), mi-> pixmap ( ), mi->text(), + -1, &g.text()); + } } @@ -1800,5 +1846,5 @@ Features: QColor c; switch(menuHandler->transType()){ -@@ -2336,8 +2074,6 @@ +@@ -2336,8 +2084,6 @@ maxpmw = QMAX( maxpmw, 20 ); @@ -1809,5 +1855,5 @@ Features: bool dis = !enabled; QColorGroup itemg = dis ? pal.disabled() : pal.active(); -@@ -2363,7 +2099,7 @@ +@@ -2363,7 +2109,7 @@ p->fillRect(x, y, w, h, menuBrush); } @@ -1818,5 +1864,5 @@ Features: p->drawPixmap(x, y, *pix, x, y, w, h); } -@@ -2508,25 +2244,6 @@ +@@ -2508,25 +2254,6 @@ return h; } @@ -1844,5 +1890,5 @@ Features: void LiquidStyle::drawFocusRect(QPainter *p, const QRect &r, const QColorGroup &g, const QColor *c, -@@ -2536,29 +2253,29 @@ +@@ -2536,29 +2263,29 @@ if(p->device()->devType() == QInternal::Widget){ // if so does it use a special focus rectangle? @@ -1879,5 +1925,5 @@ Features: } QPixmap tilePix; -@@ -2671,7 +2388,7 @@ +@@ -2671,7 +2398,7 @@ vFrame = 8; // was 10 } @@ -1888,5 +1934,5 @@ Features: -@@ -2699,7 +2416,7 @@ +@@ -2699,7 +2426,7 @@ p->drawLine(x+1, y+1, x+1, y2-1); } @@ -1897,5 +1943,5 @@ Features: QPen oldPen = p->pen(); int x2 = x+w-1; -@@ -2726,105 +2443,6 @@ +@@ -2726,105 +2453,6 @@ } } @@ -2003,5 +2049,5 @@ Features: void LiquidStyle::adjustHSV(QPixmap &pix, int h, int s, int v) { -@@ -2988,110 +2606,5 @@ +@@ -2988,110 +2616,5 @@ } } @@ -2114,7 +2160,7 @@ Features: /* vim: set noet sw=8 ts=8: */ ---- - 2002-11-18 04:47:41.000000000 +0100 -+++ plugin.cpp 2002-11-18 03:54:56.000000000 +0100 -@@ -1,29 +1,79 @@ +--- - 2002-11-21 20:45:47.000000000 +0100 ++++ plugin.cpp 2002-11-18 18:11:41.000000000 +0100 +@@ -1,29 +1,84 @@ +#include <qapplication.h> + @@ -2130,4 +2176,13 @@ Features: + m_widget = 0; +} ++ ++LiquidInterface::~LiquidInterface ( ) ++{ ++} ++ ++QStyle *LiquidInterface::style ( ) ++{ ++ return new LiquidStyle ( ); ++} -extern "C" { @@ -2136,45 +2191,36 @@ Features: - int major_version(); - const char *description(); -+LiquidInterface::~LiquidInterface ( ) ++QString LiquidInterface::name ( ) const +{ ++ return qApp-> translate ( "Styles", "Liquid" ); } -KStyle* allocate() -+QStyle *LiquidInterface::style ( ) ++QString LiquidInterface::description ( ) const { - return(new LiquidStyle); -+ return new LiquidStyle ( ); ++ return qApp-> translate ( "Styles", "High Performance Liquid style by Mosfet" ); } -int minor_version() -+QString LiquidInterface::name ( ) const ++bool LiquidInterface::hasSettings ( ) const { - return(0); -+ return qApp-> translate ( "Styles", "Liquid" ); ++ return true; } -int major_version() -+QString LiquidInterface::description ( ) const ++QWidget *LiquidInterface::create ( QWidget *parent, const char *name ) { - return(1); -+ return qApp-> translate ( "Styles", "High Performance Liquid style by Mosfet" ); ++ m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" ); ++ ++ return m_widget; } -const char *description() -+bool LiquidInterface::hasSettings ( ) const ++bool LiquidInterface::accept ( ) { - return(i18n("High performance liquid plugin").utf8()); -+ return true; -+} -+ -+QWidget *LiquidInterface::create ( QWidget *parent, const char *name ) -+{ -+ m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" ); -+ -+ return m_widget; -+} -+ -+bool LiquidInterface::accept ( ) -+{ + if ( !m_widget ) + return false; @@ -2210,2 +2256,7 @@ Features: +} + ++ ++// For Sharp ROM ++ ++extern "C" { QStyle *allocate ( ) { return new LiquidStyle ( ); } } ++extern "C" { void drawmenubaritem ( QStyle *sty, QPainter *p, int x, int y, int w, int h, QMenuItem *mi, QColorGroup &g, bool enabled, bool active ) { return ((LiquidStyle *) sty )-> drawMenuBarItem ( p, x, y, w, h, mi, g, enabled, active ); } } |