summaryrefslogtreecommitdiff
authorsandman <sandman>2002-07-01 09:41:55 (UTC)
committer sandman <sandman>2002-07-01 09:41:55 (UTC)
commit05d74acac3af056bfd784c6f2b7f72d313ea64bc (patch) (side-by-side diff)
tree8138f495cdd08fa249bd429ddefc36df26b12a79
parentd538fa9811906117a3ea68e3d434a1de7f46fc67 (diff)
downloadopie-05d74acac3af056bfd784c6f2b7f72d313ea64bc.zip
opie-05d74acac3af056bfd784c6f2b7f72d313ea64bc.tar.gz
opie-05d74acac3af056bfd784c6f2b7f72d313ea64bc.tar.bz2
- Fix a bug in the original liquid regarding slider handles and bg
pixmaps (volume-applet, reported by Harlekin) - Fix some "unused variable" compiler warnings - Regenerated QPL diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/liquid/liquid.cpp25
-rw-r--r--noncore/styles/liquid/opie-liquid.diff100
2 files changed, 95 insertions, 30 deletions
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp
index 9a7d2dd..313d52c 100644
--- a/noncore/styles/liquid/liquid.cpp
+++ b/noncore/styles/liquid/liquid.cpp
@@ -1822,18 +1822,18 @@ QStyle::ScrollControl LiquidStyle::scrollBarPointOver(const QScrollBar *sb,
#define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2)
QSize LiquidStyle::exclusiveIndicatorSize() const
{
return(QSize(16, 16));
}
-void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int w,
- int h, const QColorGroup &g, bool on,
+void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int /*w*/,
+ int /*h*/, const QColorGroup &/*g*/, bool on,
bool down, bool)
{
bool isHover = highlightWidget == p->device();
bool isMasked = p->device() && p->device()->devType() == QInternal::Widget
&& ((QWidget*)p->device())->autoMask();
if(isMasked){
if(on || down){
@@ -1865,18 +1865,18 @@ void LiquidStyle::drawExclusiveIndicatorMask(QPainter *p, int x, int y, int w,
}
QSize LiquidStyle::indicatorSize() const
{
return(QSize(20, 22));
}
-void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int w, int h,
- const QColorGroup &g, int state, bool down, bool)
+void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int /*w*/, int /*h*/,
+ const QColorGroup &/*g*/, int state, bool /*down*/, bool)
{
bool isHover = highlightWidget == p->device();
bool isMasked = p->device() && p->device()->devType() == QInternal::Widget
&& ((QWidget*)p->device())->autoMask();
if(isMasked){
if(state != QButton::Off){
p->drawPixmap(x, y, isHover ? *getPixmap(HTMLCBDownHover) :
*getPixmap(HTMLCBDown));
@@ -1904,37 +1904,36 @@ void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int w, int h,
p->drawLine(x+3, (y+h)/2+2, x+w-4, (y+h)/2+2);
}*/
}
else
p->drawPixmap(x, y, isHover ? *getPixmap(CBHover) : *getPixmap(CB));
}
}
-void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int w, int h,
- int state)
+void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int /*w*/, int /*h*/,
+ int /*state*/)
{
// needed for some reason by KHtml, even tho it's all filled ;P
p->drawPixmap(x, y, *getPixmap(HTMLCB)->mask());
}
void LiquidStyle::drawSlider(QPainter *p, int x, int y, int w, int h,
- const QColorGroup &g, Orientation orient,
+ const QColorGroup &/*g*/, Orientation orient,
bool, bool)
{
QWidget *parent = (QWidget *)p->device();
p->setBrushOrigin(parent->pos());
- p->fillRect(x, y, w, h,
- QApplication::palette().active().brush(QColorGroup::Background));
+ parent->erase(x, y, w, h);
p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider) :
*getPixmap(VSlider));
}
-void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int w, int h,
+void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int /*w*/, int /*h*/,
Orientation orient, bool, bool)
{
p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider)->mask() :
*getPixmap(VSlider)->mask());
}
int LiquidStyle::sliderLength() const
{
@@ -1975,17 +1974,17 @@ void LiquidStyle::drawArrow(QPainter *p, Qt::ArrowType type, bool on, int x,
}
a.translate(x, y);
p->drawLineSegments(a);
}
void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h,
- QMenuItem *mi, QColorGroup &g, bool enabled, bool active )
+ QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active )
{
x -= 2; // Bug in Qt/E
y -= 2;
w += 2;
h += 2;
p-> fillRect ( x, y, w, h, g.brush(QColorGroup::Background));
@@ -2029,18 +2028,18 @@ 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(),
-1, &g.text());
}
}
void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h,
- const QColorGroup &g, int lineWidth,
- const QBrush * fill)
+ const QColorGroup &g, int /*lineWidth*/,
+ const QBrush * /*fill*/)
{
QColor c;
switch(menuHandler->transType()){
case None:
case StippledBg:
case TransStippleBg:
c = g.background();
break;
diff --git a/noncore/styles/liquid/opie-liquid.diff b/noncore/styles/liquid/opie-liquid.diff
index ef7300d..bcbdc8d 100644
--- a/noncore/styles/liquid/opie-liquid.diff
+++ b/noncore/styles/liquid/opie-liquid.diff
@@ -1,14 +1,14 @@
This is a patch to mosfet's liquid 0.7.
Features:
- Qt-only
- works with Qt/E on QPE/OPIE
---- - Sun Jun 30 22:38:02 2002
+--- - Mon Jul 1 11:38:05 2002
+++ liquid.h Mon Jun 24 19:07:45 2002
@@ -2,7 +2,7 @@
#define LIQUID_STYLE_H
-#include <kstyle.h>
+#include <qwindowsstyle.h>
#include <qpainter.h>
@@ -97,18 +97,18 @@ Features:
- const QColorGroup &g, QBrush *);
- void drawKickerTaskButton(QPainter *p, int x, int y, int w, int h,
- const QColorGroup &g,
- const QString &title, bool active,
- QPixmap *icon, QBrush *fill);
// for repainting toolbuttons when the toolbar is resized
bool eventFilter(QObject *obj, QEvent *ev);
void drawSliderGroove(QPainter * p, int x, int y, int w, int h,
---- - Sun Jun 30 22:38:02 2002
-+++ liquid.cpp Sun Jun 30 22:37:56 2002
+--- - Mon Jul 1 11:38:05 2002
++++ liquid.cpp Mon Jul 1 03:45:28 2002
@@ -10,12 +10,10 @@
#include <qmenudata.h>
#include "liquid.h"
-#include <kapp.h>
-#include <kglobal.h>
-#include <kconfig.h>
-#include <kdrawutil.h>
@@ -647,17 +647,72 @@ Features:
- QColor testColor;
- if(btn->parent() && btn->parent()->isWidgetType()){
- testColor = p->backgroundColor(); // remove me
- }
-
//int dw = buttonDefaultIndicatorWidth();
if(btn->hasFocus() || btn->isDefault()){
QColor c = btn->hasFocus() ? g.button().light(110) : g.background();
-@@ -2065,203 +1978,24 @@
+@@ -1914,8 +1827,8 @@
+ return(QSize(16, 16));
+ }
+
+-void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int w,
+- int h, const QColorGroup &g, bool on,
++void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int /*w*/,
++ int /*h*/, const QColorGroup &/*g*/, bool on,
+ bool down, bool)
+ {
+ bool isHover = highlightWidget == p->device();
+@@ -1957,8 +1870,8 @@
+ return(QSize(20, 22));
+ }
+
+-void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int w, int h,
+- const QColorGroup &g, int state, bool down, bool)
++void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int /*w*/, int /*h*/,
++ const QColorGroup &/*g*/, int state, bool /*down*/, bool)
+ {
+ bool isHover = highlightWidget == p->device();
+ bool isMasked = p->device() && p->device()->devType() == QInternal::Widget
+@@ -1996,8 +1909,8 @@
+ }
+ }
+
+-void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int w, int h,
+- int state)
++void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int /*w*/, int /*h*/,
++ int /*state*/)
+ {
+ // needed for some reason by KHtml, even tho it's all filled ;P
+ p->drawPixmap(x, y, *getPixmap(HTMLCB)->mask());
+@@ -2005,18 +1918,17 @@
+ }
+
+ void LiquidStyle::drawSlider(QPainter *p, int x, int y, int w, int h,
+- const QColorGroup &g, Orientation orient,
++ const QColorGroup &/*g*/, Orientation orient,
+ bool, bool)
+ {
+ QWidget *parent = (QWidget *)p->device();
+ p->setBrushOrigin(parent->pos());
+- p->fillRect(x, y, w, h,
+- QApplication::palette().active().brush(QColorGroup::Background));
++ parent->erase(x, y, w, h);
+ p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider) :
+ *getPixmap(VSlider));
+ }
+
+-void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int w, int h,
++void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int /*w*/, int /*h*/,
+ Orientation orient, bool, bool)
+ {
+ p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider)->mask() :
+@@ -2065,203 +1977,24 @@
p->drawLineSegments(a);
}
-void LiquidStyle::drawKBarHandle(QPainter *p, int x, int y, int w, int h,
- const QColorGroup &g, KToolBarPos,
- QBrush *)
-{
- p->setPen(g.button().dark(120));
@@ -714,17 +769,17 @@ Features:
- &g.brush(QColorGroup::Background));
- }
-
-}
-void LiquidStyle::drawKToolBar(QPainter *p, int x, int y, int w, int h,
- const QColorGroup &g, KToolBarPos, QBrush *)
+void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h,
-+ QMenuItem *mi, QColorGroup &g, bool enabled, bool active )
++ QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active )
{
- //p->fillRect(x, y, w, h, g.brush(QColorGroup::Background));
-}
+ x -= 2; // Bug in Qt/E
+ y -= 2;
+ w += 2;
+ h += 2;
@@ -861,35 +916,46 @@ Features:
if(p->device() && p->device()->devType() == QInternal::Widget &&
- ((QWidget *)p->device())->inherits("KMenuBar")){
- shadow = ((KMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) :
+ ((QWidget *)p->device())->inherits("QMenuBar")){
+ shadow = ((QMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) :
g.background().dark(130);
}
else
-@@ -2336,8 +2070,6 @@
+@@ -2300,8 +2033,8 @@
+ }
+
+ void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h,
+- const QColorGroup &g, int lineWidth,
+- const QBrush * fill)
++ const QColorGroup &g, int /*lineWidth*/,
++ const QBrush * /*fill*/)
+ {
+ QColor c;
+ switch(menuHandler->transType()){
+@@ -2336,8 +2069,6 @@
maxpmw = QMAX( maxpmw, 20 );
- if ( p->font() == KGlobalSettings::generalFont() )
- p->setFont( KGlobalSettings::menuFont() );
bool dis = !enabled;
QColorGroup itemg = dis ? pal.disabled() : pal.active();
-@@ -2363,7 +2095,7 @@
+@@ -2363,7 +2094,7 @@
p->fillRect(x, y, w, h, menuBrush);
}
else{
- KPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId());
+ QPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId());
if(pix)
p->drawPixmap(x, y, *pix, x, y, w, h);
}
-@@ -2508,25 +2240,6 @@
+@@ -2508,25 +2239,6 @@
return h;
}
-void LiquidStyle::drawKProgressBlock(QPainter *p, int x, int y, int w, int h,
- const QColorGroup &g, QBrush *fill)
-{
- p->setPen(g.button().dark(130));
- p->drawRect(x, y, w, h);
@@ -905,17 +971,17 @@ Features:
- bevelFillDict.insert(g.button().dark(120).rgb(), pix);
- }
- p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix);
- }
-}
void LiquidStyle::drawFocusRect(QPainter *p, const QRect &r,
const QColorGroup &g, const QColor *c,
-@@ -2540,25 +2253,25 @@
+@@ -2540,25 +2252,25 @@
return;
}
else{
- KStyle::drawFocusRect(p, r, g, c, atBorder);
+ QWindowsStyle::drawFocusRect(p, r, g, c, atBorder);
}
}
else
@@ -935,35 +1001,35 @@ Features:
bool selected)
{
if(tabBar->shape() != QTabBar::RoundedAbove){
- KStyle::drawTab(p, tabBar, tab, selected);
+ QWindowsStyle::drawTab(p, tabBar, tab, selected);
return;
}
QPixmap tilePix;
-@@ -2671,7 +2384,7 @@
+@@ -2671,7 +2383,7 @@
vFrame = 8; // was 10
}
else
- KStyle::tabbarMetrics(t, hFrame, vFrame, overlap);
+ QWindowsStyle::tabbarMetrics(t, hFrame, vFrame, overlap);
}
-@@ -2699,7 +2412,7 @@
+@@ -2699,7 +2411,7 @@
p->drawLine(x+1, y+1, x+1, y2-1);
}
else if(lineWidth != 2 || !sunken)
- KStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill);
+ QWindowsStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill);
else{
QPen oldPen = p->pen();
int x2 = x+w-1;
-@@ -2726,105 +2439,6 @@
+@@ -2726,105 +2438,6 @@
}
}
-void LiquidStyle::drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h,
- const QColorGroup &g, QBrush *)
-{
- p->fillRect(x, y, w, h, g.brush(QColorGroup::Background));
- drawClearBevel(p, x, y, w, h, highlightWidget == p->device() ?
@@ -1059,17 +1125,17 @@ Features:
- p->drawText(br.x()+ textPos, -1, w-textPos, h,
- AlignLeft|AlignVCenter, s);
- }
-
-}
void LiquidStyle::adjustHSV(QPixmap &pix, int h, int s, int v)
{
-@@ -2998,22 +2612,22 @@
+@@ -2998,22 +2611,22 @@
customBtnIconList.clear();
customBtnLabelList.clear();
- KConfig *config = KGlobal::config();
- QString oldGrp = config->group();
- config->setGroup("MosfetButtons");
+// KConfig *config = KGlobal::config();
+// QString oldGrp = config->group();
@@ -1089,43 +1155,43 @@ Features:
const char *colorStr = colorList.first();
const char *iconStr = iconList.first();
- KIconLoader *ldr = KGlobal::iconLoader();
+// KIconLoader *ldr = KGlobal::iconLoader();
while(labelStr != NULL){
QColor *c = new QColor;
c->setNamedColor(QString(colorStr));
-@@ -3022,7 +2636,7 @@
+@@ -3022,7 +2635,7 @@
QString tmpStr(iconStr);
if(!tmpStr.isEmpty()){
QPixmap *pixmap =
- new QPixmap(ldr->loadIcon(tmpStr, KIcon::Small));
+ new QPixmap();//ldr->loadIcon(tmpStr, KIcon::Small));
if(pixmap->isNull()){
delete pixmap;
customBtnIconList.append(NULL);
-@@ -3037,7 +2651,6 @@
+@@ -3037,7 +2650,6 @@
colorStr = colorList.next();
iconStr = iconList.next();
}
- config->setGroup(oldGrp);
}
void LiquidStyle::applyCustomAttributes(QPushButton *btn)
-@@ -3087,7 +2700,7 @@
+@@ -3087,7 +2699,7 @@
}
}
-#include "liquid.moc"
+// #include "liquid.moc"
---- - Sun Jun 30 22:38:02 2002
+--- - Mon Jul 1 11:38:05 2002
+++ plugin.cpp Fri Jun 28 13:25:25 2002
@@ -1,29 +1,29 @@
#include "liquid.h"
-#include <klocale.h>
+
extern "C" {
- KStyle* allocate();