summaryrefslogtreecommitdiff
authorsandman <sandman>2002-11-29 11:35:14 (UTC)
committer sandman <sandman>2002-11-29 11:35:14 (UTC)
commit3abc1725d255b507f42bcf060018d3ce0b461f4d (patch) (side-by-side diff)
treeaf6b2ca73fbc570f104f44223ba7d7d201553cc6
parent96d75cae7e5f270a543b0eb6138c6967577f2b11 (diff)
downloadopie-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 ;)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/liquid/liquid.cpp7
-rw-r--r--noncore/styles/liquid/opie-liquid.diff137
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
@@ -1101,22 +1101,18 @@ bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev)
else if(obj->inherits("QToolButton")){
QToolButton *btn = (QToolButton *)obj;
if(ev->type() == QEvent::FocusIn ){ // && !btn-> autoRaise ()
if(btn->isEnabled()){
highlightWidget = btn;
btn->repaint(false);
-
- qDebug ( "TB FOCUS IN [%p]", btn );
}
}
else if(ev->type() == QEvent::FocusOut ){
if(btn == highlightWidget){
highlightWidget = NULL;
btn->repaint(false);
-
- qDebug ( "TB FOCUS OUT [%p]", btn );
}
}
else if(ev->type() == QEvent::Paint) {
(( HackToolButton *) btn )-> paint ((QPaintEvent *) ev );
return true;
}
@@ -1244,17 +1240,14 @@ void LiquidStyle::drawToolButton(QPainter *p, int x, int y, int w, int h,
pix = new QPixmap(*bevelFillPix);
adjustHSV(*pix, h, s, v);
bevelFillDict.insert(c.rgb(), pix);
}
p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix);
- qDebug ( "DRAW TOOLBUTTON IN PIXMAP" );
}
else{
- qDebug ( "DRAW TOOLBUTTON sunken=%d/high=%p/device=%p", sunken, highlightWidget,p->device() );
-
drawClearBevel(p, x, y, w, h, sunken ? g.button() :
highlightWidget == p->device() ? g.button().light(110) :
g.background(), g.background());
}
}
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,12 +1,12 @@
This is a patch to mosfet's liquid 0.7.
Features:
- Qt-only
- works with Qt/E on QPE/OPIE
---- - 2002-11-21 20:45:47.000000000 +0100
+--- - 2002-11-29 12:30:34.000000000 +0100
+++ liquid.h 2002-11-18 03:32:40.000000000 +0100
@@ -2,7 +2,7 @@
#define LIQUID_STYLE_H
-#include <kstyle.h>
@@ -138,14 +138,14 @@ Features:
- QList<QColor>customBtnColorList;
- QList<QPixmap>customBtnIconList;
- QStrList customBtnLabelList;
QPixmap *vsbSliderFillPix;
TransMenuHandler *menuHandler;
QPixmap *pixmaps[BITMAP_ITEMS];
---- - 2002-11-21 20:45:47.000000000 +0100
-+++ liquid.cpp 2002-11-21 20:27:48.000000000 +0100
+--- - 2002-11-29 12:30:34.000000000 +0100
++++ liquid.cpp 2002-11-29 12:30:24.000000000 +0100
@@ -2,6 +2,9 @@
* Copyright (C)QPL 2001 Daniel M. Duley. All rights reserved.
*/
+//
+// (c) 2002 Robert 'sandman' Griebl
@@ -268,13 +268,13 @@ Features:
}
- *pix = QPixmap::grabWindow(qt_xrootwin(), r.x(), r.y(),
+ *pix = QPixmap::grabWindow(QApplication::desktop()-> winId(), r.x(), r.y(),
r.width(), r.height());
}
else{ // tear off menu
-@@ -121,82 +126,61 @@
+@@ -121,82 +126,62 @@
stripePixmap(*pix, p->colorGroup().button());
}
else{
- KPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color);
+ QPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color);
}
@@ -338,16 +338,15 @@ Features:
- if(shadowText != oldShadow){
- it.toFirst();
- while ((w=it.current()) != 0 ){
- ++it;
- if(w->inherits("QMenuBar")){
- w->repaint();
+- }
+- }
+ wid-> setBackgroundMode( QWidget::PaletteBackground );
- }
-+ delete ol;
- }
}
- }
- else if(id == MOSFET_BUTTON_CHANGE){
- qWarning("In mosfet button change");
- // really, this should be in LiquidStyle, but what the hell? ;-)
- QWidgetList *list = QApplication::allWidgets();
@@ -362,14 +361,15 @@ Features:
- ((LiquidStyle*)parent())->loadCustomButtons();
- it.toFirst();
- while ((w=it.current()) != 0 ){
- ++it;
- if(w->inherits("QPushButton")){
- ((LiquidStyle*)parent())->applyCustomAttributes((QPushButton *)w);
-- }
-- }
++ delete ol;
+ }
+ }
+ return(false);
+}
- }
+
+static int qt_version ( )
@@ -384,30 +384,31 @@ Features:
+ :QWindowsStyle()
{
+ setName ( "LiquidStyle" );
+
+ oldqte = ( qt_version ( ) < 234 );
+ flatTBButtons = false;
++ currentHeader = 0;
+
btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true);
btnMaskBmp.setMask(btnMaskBmp);
htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true);
-@@ -207,12 +191,8 @@
+@@ -207,12 +192,8 @@
btnDict.setAutoDelete(true);
bevelFillDict.setAutoDelete(true);
smallBevelFillDict.setAutoDelete(true);
- customBtnColorList.setAutoDelete(true);
- customBtnIconList.setAutoDelete(true);
- customBtnLabelList.setAutoDelete(true);
rMatrix.rotate(270.0);
- highcolor = QPixmap::defaultDepth() > 8;
btnBorderPix = new QPixmap;
btnBorderPix->convertFromImage(qembed_findImage("buttonfill"));
btnBlendPix = new QPixmap;
-@@ -572,131 +552,119 @@
+@@ -572,131 +553,119 @@
case HTMLBtnBorderDown:
pixmaps[HTMLBtnBorderDown] = processEmbedded("htmlbtnborder", btnHoverH, btnHoverS, btnHoverV);
break;
+
case HTMLCB:
pixmaps[HTMLCB] = processEmbedded("htmlcheckbox", bH, bS, bV);
@@ -491,16 +492,16 @@ Features:
+ pixmaps[CBHover] = processEmbedded("checkbox", btnHoverH, btnHoverS, btnHoverV /*, true*/);
break;
- case HSlider:
- pixmaps[HSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true);
+ 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:
- pixmaps[VSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true);
+ pixmaps[VSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true );
*pixmaps[VSlider] = pixmaps[VSlider]->xForm(rMatrix);
break;
@@ -596,21 +597,21 @@ Features:
case HSBSliderBtmBg:
- pixmaps[HSBSliderBtmBg] = processEmbedded("sbslider_btm", bH, bS, bV, true);
+ pixmaps[HSBSliderBtmBg] = processEmbedded("sbslider_btm", bH, bS, bV, true );
*pixmaps[HSBSliderBtmBg] = pixmaps[HSBSliderBtmBg]->xForm(rMatrix);
break;
case HSBSliderMidBg:
-@@ -711,7 +679,6 @@
+@@ -711,7 +680,6 @@
void LiquidStyle::polish(QPalette &appPal)
{
-
int i;
for(i=0; i < BITMAP_ITEMS; ++i){
if(pixmaps[i]){
-@@ -719,31 +686,28 @@
+@@ -719,31 +687,28 @@
pixmaps[i] = NULL;
}
}
- QWidgetList *list = QApplication::allWidgets();
- QWidgetListIt it( *list );
- QWidget *w;
@@ -651,24 +652,24 @@ Features:
+ : appPal. color ( QPalette::Active, QColorGroup::Button );
+ if ( c == ( oldqte ? QColor ( config. readEntry ( "background", ( Qt::lightGray ). name ( )))
+ : appPal. color ( QPalette::Active, QColorGroup::Background ))) {
// force button color to be different from background
QBrush btnBrush(QColor(200, 202, 228));
appPal.setBrush(QColorGroup::Button, btnBrush);
-@@ -778,8 +742,8 @@
+@@ -778,8 +743,8 @@
adjustHSV(*pix, h, s, v);
smallBevelFillDict.insert(c.rgb(), pix);
}
- pagerHoverBrush.setColor(c);
- pagerHoverBrush.setPixmap(*pix);
+// pagerHoverBrush.setColor(c);
+// pagerHoverBrush.setPixmap(*pix);
c = c.dark(120);
pix = smallBevelFillDict.find(c.rgb()); // better be NULL ;-)
-@@ -790,19 +754,13 @@
+@@ -790,19 +755,13 @@
adjustHSV(*pix, h, s, v);
smallBevelFillDict.insert(c.rgb(), pix);
}
- pagerBrush.setColor(c);
- pagerBrush.setPixmap(*pix);
+// pagerBrush.setColor(c);
@@ -687,13 +688,13 @@ Features:
+ c = oldqte ? QColor ( config. readEntry ( "Background", ( Qt::lightGray ).name ( )))
+ : appPal. color ( QPalette::Active, QColorGroup::Background );
+
c.hsv(&bH, &bS, &bV);
c.light(120).hsv(&bHoverH, &bHoverS, &bHoverV);
-@@ -817,101 +775,50 @@
+@@ -817,101 +776,50 @@
wallPaper.fill(c.rgb());
painter.begin(&wallPaper);
for(i=0; i < 32; i+=4){
- painter.setPen(c.dark(105));
+ painter.setPen(c.dark(100 + contrast));
painter.drawLine(0, i, 32, i);
@@ -810,13 +811,13 @@ Features:
+ if(w->inherits("QButton") || w-> inherits("QComboBox")){
+ w-> setBackgroundMode ( QWidget::PaletteBackground );
+ w->setBackgroundOrigin ( QWidget::ParentOrigin);
}
bool isViewport = qstrcmp(w->name(), "qt_viewport") == 0 ||
-@@ -942,11 +849,20 @@
+@@ -942,11 +850,20 @@
w->setMouseTracking(true);
w->installEventFilter(this);
}
+ if(w-> inherits("QToolButton")) {
+ if (w->parent()->inherits("QToolBar")) {
+ ((QToolButton*)w)->setAutoRaise (flatTBButtons);
@@ -833,13 +834,13 @@ Features:
}
- if(w->inherits("PanelButtonBase"))
- return;
if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())->
palette().active().brush(QColorGroup::Background).pixmap()){
-@@ -954,16 +870,21 @@
+@@ -954,16 +871,21 @@
return;
}
if(!isViewport && !isViewportChild && !w->testWFlags(WType_Popup) &&
- !w->inherits("KDesktop") && !w->inherits("PasswordDlg")){
+ !( !w-> inherits("QLineEdit") && w-> parent() && w-> parent()-> isWidgetType ( ) && w-> parent()-> inherits ( "QMultiLineEdit" ))) {
if(w->backgroundMode() == QWidget::PaletteBackground ||
@@ -861,34 +862,34 @@ Features:
+
+ if ( w->parentWidget()->inherits ( "QWidgetStack" )) {
+ w->setBackgroundOrigin ( QWidget::WidgetOrigin );
}
}
-@@ -977,6 +898,11 @@
+@@ -977,6 +899,11 @@
if(w->inherits("QPopupMenu"))
w->setBackgroundMode(QWidget::PaletteButton);
+ else if(w-> testWFlags(Qt::WType_Popup) &&
+ !w->inherits("QListBox") &&
+ ( qstrcmp ( w-> name(), "automatic what's this? widget" ) != 0 )) {
+ w->removeEventFilter(menuHandler);
+ }
if(w->isTopLevel())
return;
-@@ -986,7 +912,7 @@
+@@ -986,7 +913,7 @@
((qstrcmp(w->parent()->name(), "qt_viewport") == 0) ||
(qstrcmp(w->parent()->name(), "qt_clipped_viewport") == 0));
- w->setPalette(QApplication::palette());
+ w->unsetPalette();
if(w->backgroundMode() == QWidget::X11ParentRelative || isViewportChild){
if(w->inherits("QPushButton"))
w->setBackgroundMode(QWidget::PaletteButton);
-@@ -997,16 +923,12 @@
+@@ -997,16 +924,12 @@
if(isViewportChild)
w->setAutoMask(false);
- if(w->inherits("QPushButton")){
- unapplyCustomAttributes((QPushButton *)w);
- w->removeEventFilter(this);
@@ -904,13 +905,13 @@ Features:
- w->inherits("TaskContainer")){
+*/
+ if( w->inherits("QRadioButton") || w->inherits("QCheckBox") || w->inherits("QProgressBar")) {
w->removeEventFilter(this);
}
if(w->inherits("QButton") || w->inherits("QComboBox")){
-@@ -1014,9 +936,12 @@
+@@ -1014,9 +937,12 @@
w->setAutoMask(false);
}
}
- if(w->inherits("KToolBar")){
+ if(w-> inherits("QToolButton")) {
+ w-> removeEventFilter ( this );
@@ -919,13 +920,13 @@ Features:
w->removeEventFilter(this);
- //w->setBackgroundMode(QWidget::PaletteBackground);
+ w->setBackgroundMode(QWidget::PaletteBackground);
return;
}
if(w->inherits("QHeader")){
-@@ -1028,22 +953,118 @@
+@@ -1028,22 +954,118 @@
void LiquidStyle::polish(QApplication *app)
{
- KStyle::polish(app);
+ QWindowsStyle::polish(app);
menuAni = app->isEffectEnabled(UI_AnimateMenu);
@@ -1040,22 +1041,22 @@ Features:
+ }
+};
+
/*
* This is a fun method ;-) Here's an overview. KToolBar grabs resize to
* force everything to erase and repaint on resize. This is going away, I'm
-@@ -1063,7 +1084,7 @@
+@@ -1063,7 +1085,7 @@
*/
bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev)
{
- if(obj->inherits("KToolBar")){
+ if(obj->inherits("QToolBar")){
if(ev->type() == QEvent::Resize){
const QObjectList *tbChildList = obj->children();
QObjectListIt it(*tbChildList);
-@@ -1076,116 +1097,27 @@
+@@ -1076,116 +1098,23 @@
}
}
- else if(obj->inherits("KMiniPagerButton")){
- QButton *btn = (QButton *)obj;
- if(ev->type() == QEvent::Paint){
@@ -1118,24 +1119,20 @@ Features:
+ else if(obj->inherits("QToolButton")){
+ QToolButton *btn = (QToolButton *)obj;
+ if(ev->type() == QEvent::FocusIn ){ // && !btn-> autoRaise ()
if(btn->isEnabled()){
highlightWidget = btn;
btn->repaint(false);
-+
-+ qDebug ( "TB FOCUS IN [%p]", btn );
}
}
- else if(ev->type() == QEvent::Leave){
- QWidget *btn = (QWidget *)obj;
+ else if(ev->type() == QEvent::FocusOut ){
if(btn == highlightWidget){
highlightWidget = NULL;
btn->repaint(false);
-+
-+ qDebug ( "TB FOCUS OUT [%p]", btn );
}
}
- else
- highlightWidget = NULL;
- }
- else if(obj->inherits("QScrollBar")){
@@ -1177,29 +1174,29 @@ Features:
+ else if(ev->type() == QEvent::Paint) {
+ (( HackToolButton *) btn )-> paint ((QPaintEvent *) ev );
+ return true;
}
}
else if(obj->inherits("QRadioButton") || obj->inherits("QCheckBox")){
-@@ -1201,6 +1133,7 @@
+@@ -1201,6 +1130,7 @@
QSize sz = isRadio ? exclusiveIndicatorSize()
: indicatorSize();
+/*
if(btn->hasFocus()){
QRect r = QRect(0, 0, btn->width(), btn->height());
p.setPen(btn->colorGroup().button().dark(140));
-@@ -1209,6 +1142,7 @@
+@@ -1209,6 +1139,7 @@
p.drawLine(r.right(), r.y()+1, r.right(), r.bottom()-1);
p.drawLine(r.x()+1, r.bottom(), r.right()-1, r.bottom());
}
+*/
int x = 0;
int y = (btn->height()-lsz.height()+fm.height()-sz.height())/2;
if(isRadio)
-@@ -1228,36 +1162,6 @@
+@@ -1228,36 +1159,6 @@
p.end();
return(true);
}
- // for hover, just redraw the indicator (not the text)
- else if((ev->type() == QEvent::Enter && btn->isEnabled()) ||
- (ev->type() == QEvent::Leave && btn == highlightWidget)){
@@ -1230,13 +1227,13 @@ Features:
- btn->isEnabled());
- p.end();
- }
}
else if(obj->inherits("QHeader")){
QHeader *hw = (QHeader *)obj;
-@@ -1290,7 +1194,24 @@
+@@ -1290,7 +1191,24 @@
}
}
}
- return(false);
+ else if (obj-> inherits( "QProgressBar" )) {
+ if ( ev->type() == QEvent::Paint ) {
@@ -1256,37 +1253,25 @@ Features:
+ }
+ }
+ return false ;
}
void LiquidStyle::drawButton(QPainter *p, int x, int y, int w, int h,
-@@ -1325,8 +1246,11 @@
- }
-
- p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix);
-+ qDebug ( "DRAW TOOLBUTTON IN PIXMAP" );
- }
- else{
-+ qDebug ( "DRAW TOOLBUTTON sunken=%d/high=%p/device=%p", sunken, highlightWidget,p->device() );
-+
- drawClearBevel(p, x, y, w, h, sunken ? g.button() :
- highlightWidget == p->device() ? g.button().light(110) :
- g.background(), g.background());
-@@ -1340,11 +1264,6 @@
+@@ -1340,11 +1258,6 @@
QColorGroup g = btn->colorGroup();
- 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();
-@@ -1488,7 +1407,20 @@
+@@ -1488,7 +1401,20 @@
const QColorGroup &g, bool sunken,
bool edit, bool, const QBrush *)
{
- bool isHover = highlightWidget == painter->device();
+ bool isActive = false;
+ if (( painter->device()->devType() == QInternal::Widget ) &&
@@ -1302,22 +1287,22 @@ Features:
+ isActive = true;
+ }
+
bool isMasked = false;
if(painter->device()->devType() == QInternal::Widget)
isMasked = ((QWidget*)painter->device())->autoMask();
-@@ -1498,7 +1430,7 @@
+@@ -1498,7 +1424,7 @@
drawRoundButton(&p, g.button(), g.background(), 0, 0, w, h, false,
sunken, false, isMasked);
- if(!isHover){
+ if(!isActive){
p.setClipRect(0, 0, w-17, h);
drawRoundButton(&p, g.background(), g.background(), 0, 0, w, h, false,
sunken, false, isMasked);
-@@ -1550,16 +1482,17 @@
+@@ -1550,16 +1476,17 @@
return(QRect(x+9, y+3, w - (h / 3) - 20, h-6));
}
-QRect LiquidStyle::comboButtonFocusRect(int x, int y, int w, int h)
+QRect LiquidStyle::comboButtonFocusRect(int /*x*/, int /*y*/, int /*w*/, int /*h*/)
{
@@ -1332,31 +1317,31 @@ Features:
uint activeControl)
{
- bool isHover = highlightWidget == p->device();
int sliderMin, sliderMax, sliderLength, buttonDim;
scrollBarMetrics( sb, sliderMin, sliderMax, sliderLength, buttonDim );
-@@ -1596,7 +1529,7 @@
+@@ -1596,7 +1523,7 @@
if(sbBuffer.size() != sb->size())
sbBuffer.resize(sb->size());
}
- subB.setRect( subX,subY,buttonDim,buttonDim );
+ subB.setRect( subX,subY,0,0); // buttonDim,buttonDim );
addB.setRect( addX,addY,buttonDim,buttonDim );
if(horiz)
subHC.setRect(addX-buttonDim,addY,buttonDim,buttonDim );
-@@ -1624,7 +1557,7 @@
+@@ -1624,7 +1551,7 @@
QPainter painter;
if(!horiz){
painter.begin(&sbBuffer);
- QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*3))+1);
+ QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*2))+1);
if(sliderR.height() >= 8){
painter.drawPixmap(bgR.x()+1, bgR.y(), *vsbSliderFillPix, 0, 0,
13, 8);
-@@ -1648,25 +1581,15 @@
+@@ -1648,25 +1575,15 @@
}
if(controls & Slider){
if(sliderR.height() >= 16){
- painter.drawPixmap(sliderR.x()+1, sliderR.y(),
- isHover ? *getPixmap(VSBSliderTopHover):
- *getPixmap(VSBSliderTop));
@@ -1381,30 +1366,30 @@ Features:
- *getPixmap(VSBSliderBtm), 0, 8-m, 13, m);
+ painter.drawPixmap(sliderR.x()+1, sliderR.y(), *getPixmap(VSBSliderTop), 0, 0, 13, m);
+ painter.drawPixmap(sliderR.x()+1, sliderR.y()+m, *getPixmap(VSBSliderBtm), 0, 8-m, 13, m);
}
else{
painter.setPen(g.button().dark(210));
-@@ -1674,7 +1597,6 @@
+@@ -1674,7 +1591,6 @@
13, sliderR.height());
painter.drawTiledPixmap(sliderR.x()+2, sliderR.y()+1,
11, sliderR.height()-2,
- isHover ? *getPixmap(VSBSliderMidHover) :
*getPixmap(VSBSliderMid), 1, 0);
}
}
-@@ -1690,7 +1612,7 @@
+@@ -1690,7 +1606,7 @@
}
else{
painter.begin(&sbBuffer);
- QRect bgR(subB.right()+1, 0, (len-(buttonDim*3))+1, sb->height());
+ QRect bgR(subB.right()+1, 0, (len-(buttonDim*2))+1, sb->height());
if(sliderR.width() >= 8){
painter.drawPixmap(bgR.x(), bgR.y()+1, *vsbSliderFillPix, 0, 0,
8, 13);
-@@ -1715,22 +1637,17 @@
+@@ -1715,22 +1631,17 @@
if(controls & Slider){
if(sliderR.width() >= 16){
painter.drawPixmap(sliderR.x(), sliderR.y()+1,
- isHover ? *getPixmap(HSBSliderTopHover) :
*getPixmap(HSBSliderTop));
painter.drawTiledPixmap(sliderR.x()+8, sliderR.y()+1, sliderR.width()-16,
@@ -1424,23 +1409,23 @@ Features:
- painter.drawPixmap(sliderR.right()-8, sliderR.y()+1, isHover ?
- *getPixmap(HSBSliderBtmHover) :
+ painter.drawPixmap(sliderR.right()-8, sliderR.y()+1,
*getPixmap(HSBSliderBtm), 8-m, 0, m, 13);
}
else{
-@@ -1738,8 +1655,7 @@
+@@ -1738,8 +1649,7 @@
drawRoundRect(&painter, sliderR.x(), sliderR.y()+1,
sliderR.width(), 13);
painter.drawTiledPixmap(sliderR.x()+1, sliderR.y()+2,
- sliderR.width()-2, 11, isHover ?
- *getPixmap(HSBSliderMidHover) :
+ sliderR.width()-2, 11,
*getPixmap(HSBSliderMid), 0, 1);
}
}
-@@ -1761,10 +1677,10 @@
+@@ -1761,10 +1671,10 @@
addB.width()-8, addB.height()-8, g, !maxed);
}
if ( controls & SubLine ) {
- drawSBButton(p, subB, g, activeControl == SubLine);
- drawArrow( p, horiz ? LeftArrow : UpArrow,
- false, subB.x()+4, subB.y()+4,
@@ -1449,24 +1434,24 @@ Features:
+ // drawArrow( p, horiz ? LeftArrow : UpArrow,
+ // false, subB.x()+4, subB.y()+4,
+ // subB.width()-8, subB.height()-8, g, !maxed);
drawSBButton(p, subHC, g, activeControl == SubLine);
drawArrow( p, horiz ? LeftArrow : UpArrow,
false, subHC.x()+4, subHC.y()+4,
-@@ -1865,8 +1781,8 @@
+@@ -1865,8 +1775,8 @@
else
buttonDim = ( length - b*2 )/2 - 1;
- sliderMin = b + buttonDim;
- maxLength = length - b*2 - buttonDim*3;
+ sliderMin = b + 0; // buttonDim;
+ maxLength = length - b*2 - buttonDim*2; // 3;
if ( sb->maxValue() == sb->minValue() ) {
sliderLength = maxLength;
-@@ -1914,31 +1830,31 @@
+@@ -1914,31 +1824,31 @@
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*/,
@@ -1499,13 +1484,13 @@ Features:
else
- p->drawPixmap(x, y, isHover ? *getPixmap(RadioOffHover) :
+ p->drawPixmap(x, y, isActive ? *getPixmap(RadioOffHover) :
*getPixmap(RadioOff));
}
}
-@@ -1957,25 +1873,25 @@
+@@ -1957,25 +1867,25 @@
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*/,
@@ -1531,13 +1516,13 @@ Features:
if(state != QButton::Off){
- p->drawPixmap(x, y, isHover ? *getPixmap(CBDownHover) :
+ p->drawPixmap(x, y, isActive ? *getPixmap(CBDownHover) :
*getPixmap(CBDown));
/* Todo - tristate
if(state == QButton::On){
-@@ -1992,12 +1908,12 @@
+@@ -1992,12 +1902,12 @@
}*/
}
else
- p->drawPixmap(x, y, isHover ? *getPixmap(CBHover) : *getPixmap(CB));
+ p->drawPixmap(x, y, isActive ? *getPixmap(CBHover) : *getPixmap(CB));
}
@@ -1547,13 +1532,13 @@ Features:
- 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 +1921,17 @@
+@@ -2005,18 +1915,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)
@@ -1569,13 +1554,13 @@ Features:
-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,243 +1980,76 @@
+@@ -2065,243 +1974,76 @@
p->drawLineSegments(a);
}
-void LiquidStyle::drawKBarHandle(QPainter *p, int x, int y, int w, int h,
- const QColorGroup &g, KToolBarPos,
- QBrush *)
@@ -1630,15 +1615,15 @@ Features:
- p->drawLine(x2-4, y+1, x2-6, y+1);
- }
- else{
- qDrawShadePanel(p, x, y, w, h, g, false, 1,
- &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 )
{
- //p->fillRect(x, y, w, h, g.brush(QColorGroup::Background));
@@ -1842,31 +1827,31 @@ Features:
- const QBrush * fill)
+ const QColorGroup &g, int /*lineWidth*/,
+ const QBrush * /*fill*/)
{
QColor c;
switch(menuHandler->transType()){
-@@ -2336,8 +2084,6 @@
+@@ -2336,8 +2078,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 +2109,7 @@
+@@ -2363,7 +2103,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 +2254,6 @@
+@@ -2508,25 +2248,6 @@
return h;
}
-void LiquidStyle::drawKProgressBlock(QPainter *p, int x, int y, int w, int h,
- const QColorGroup &g, QBrush *fill)
-{
@@ -1886,13 +1871,13 @@ Features:
- 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,
-@@ -2536,29 +2263,29 @@
+@@ -2536,29 +2257,29 @@
if(p->device()->devType() == QInternal::Widget){
// if so does it use a special focus rectangle?
QWidget *w = (QWidget *)p->device();
- if(w->inherits("QPushButton") || w->inherits("QSlider")){
+ if(w->inherits("QPushButton") || w->inherits("QSlider") || w->inherits("QComboBox") || w->inherits("QToolButton" )){
return;
@@ -1921,31 +1906,31 @@ Features:
if(tabBar->shape() != QTabBar::RoundedAbove){
- KStyle::drawTab(p, tabBar, tab, selected);
+ QWindowsStyle::drawTab(p, tabBar, tab, selected);
return;
}
QPixmap tilePix;
-@@ -2671,7 +2398,7 @@
+@@ -2671,7 +2392,7 @@
vFrame = 8; // was 10
}
else
- KStyle::tabbarMetrics(t, hFrame, vFrame, overlap);
+ QWindowsStyle::tabbarMetrics(t, hFrame, vFrame, overlap);
}
-@@ -2699,7 +2426,7 @@
+@@ -2699,7 +2420,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 +2453,6 @@
+@@ -2726,105 +2447,6 @@
}
}
-void LiquidStyle::drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h,
- const QColorGroup &g, QBrush *)
-{
@@ -2045,13 +2030,13 @@ Features:
- }
-
-}
void LiquidStyle::adjustHSV(QPixmap &pix, int h, int s, int v)
{
-@@ -2988,110 +2616,5 @@
+@@ -2988,110 +2610,5 @@
}
}
-// I'm debating if to use QValueList or QList here. I like QValueList better,
-// but QList handles pointers which is good for a lot of empty icons...
-
@@ -2156,13 +2141,13 @@ Features:
-
-
-
-
/* vim: set noet sw=8 ts=8: */
---- - 2002-11-21 20:45:47.000000000 +0100
+--- - 2002-11-29 12:30:35.000000000 +0100
+++ plugin.cpp 2002-11-18 18:11:41.000000000 +0100
@@ -1,29 +1,84 @@
+#include <qapplication.h>
+
#include "liquid.h"
-#include <klocale.h>