-rw-r--r-- | core/launcher/launchertab.cpp | 24 | ||||
-rw-r--r-- | core/settings/launcher/menusettings.cpp | 44 | ||||
-rw-r--r-- | libopie2/opieui/otabbar.cpp | 50 | ||||
-rw-r--r-- | libopie2/opieui/otabbar.h | 46 | ||||
-rw-r--r-- | libopie2/opieui/otabwidget.cpp | 1 | ||||
-rw-r--r-- | noncore/styles/flat/flat.cpp | 18 | ||||
-rw-r--r-- | noncore/styles/fresh/fresh.cpp | 18 | ||||
-rw-r--r-- | noncore/styles/liquid/liquid.cpp | 129 | ||||
-rw-r--r-- | noncore/styles/phase/phasestyle.cpp | 14 | ||||
-rw-r--r-- | noncore/styles/theme/othemestyle.cpp | 53 | ||||
-rw-r--r-- | noncore/styles/web/webstyle.cpp | 126 | ||||
-rw-r--r-- | noncore/styles/web/webstyle.h | 2 |
12 files changed, 338 insertions, 187 deletions
diff --git a/core/launcher/launchertab.cpp b/core/launcher/launchertab.cpp index 710f259..72ebf59 100644 --- a/core/launcher/launchertab.cpp +++ b/core/launcher/launchertab.cpp | |||
@@ -99,6 +99,6 @@ void LauncherTabBar::layoutTabs() | |||
99 | if ( t->iconSet() != 0 ) | 99 | if ( t->iconSet() != 0 ) |
100 | available -= t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); | 100 | available -= t->iconSet()->pixmap().width(); |
101 | } | 101 | } |
102 | if ( t->iconSet() != 0 ) | 102 | if ( t->iconSet() != 0 ) |
103 | iw += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); | 103 | iw += t->iconSet()->pixmap().width(); |
104 | required += iw; | 104 | required += iw; |
@@ -118,4 +118,4 @@ void LauncherTabBar::layoutTabs() | |||
118 | if ( t->iconSet() != 0 ) { | 118 | if ( t->iconSet() != 0 ) { |
119 | w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); | 119 | w += t->iconSet()->pixmap().width(); |
120 | ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); | 120 | ih = t->iconSet()->pixmap().height(); |
121 | } | 121 | } |
@@ -136,4 +136,4 @@ void LauncherTabBar::layoutTabs() | |||
136 | if ( t->iconSet() != 0 ) { | 136 | if ( t->iconSet() != 0 ) { |
137 | w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); | 137 | w += t->iconSet()->pixmap().width(); |
138 | ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); | 138 | ih = t->iconSet()->pixmap().height(); |
139 | } | 139 | } |
@@ -151,3 +151,3 @@ void LauncherTabBar::layoutTabs() | |||
151 | if ( t->iconSet() != 0 ) { | 151 | if ( t->iconSet() != 0 ) { |
152 | ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); | 152 | ih = t->iconSet()->pixmap().height(); |
153 | } | 153 | } |
@@ -222,4 +222,4 @@ void LauncherTabBar::paint( QPainter * p, QTab * t, bool selected ) const | |||
222 | if ( t->iconSet() != 0 ) { | 222 | if ( t->iconSet() != 0 ) { |
223 | iw = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width() + 2; | 223 | iw = t->iconSet()->pixmap().width() + 2; |
224 | ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); | 224 | ih = t->iconSet()->pixmap().height(); |
225 | } | 225 | } |
@@ -253,3 +253,7 @@ void LauncherTabBar::paintLabel( QPainter* p, const QRect&, | |||
253 | mode = QIconSet::Active; | 253 | mode = QIconSet::Active; |
254 | QPixmap pixmap = t->iconSet()->pixmap( QIconSet::Small, mode ); | 254 | QPixmap pixmap; |
255 | if ( mode == QIconSet::Disabled ) | ||
256 | pixmap = t->iconSet()->pixmap( QIconSet::Automatic, mode ); | ||
257 | else | ||
258 | pixmap = t->iconSet()->pixmap(); | ||
255 | int pixw = pixmap.width(); | 259 | int pixw = pixmap.width(); |
diff --git a/core/settings/launcher/menusettings.cpp b/core/settings/launcher/menusettings.cpp index 55bf358..29ce841 100644 --- a/core/settings/launcher/menusettings.cpp +++ b/core/settings/launcher/menusettings.cpp | |||
@@ -1,24 +1,24 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> | 3 | =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> |
4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
5 | .>+-= | 5 | .>+-= |
6 | _;:, .> :=|. This file is free software; you can | 6 | _;:, .> :=|. This file is free software; you can |
7 | .> <`_, > . <= redistribute it and/or modify it under | 7 | .> <`_, > . <= redistribute it and/or modify it under |
8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
9 | .="- .-=="i, .._ License as published by the Free Software | 9 | .="- .-=="i, .._ License as published by the Free Software |
10 | - . .-<_> .<> Foundation; either version 2 of the License, | 10 | - . .-<_> .<> Foundation; either version 2 of the License, |
11 | ._= =} : or (at your option) any later version. | 11 | ._= =} : or (at your option) any later version. |
12 | .%`+i> _;_. | 12 | .%`+i> _;_. |
13 | .i_,=:_. -<s. This file is distributed in the hope that | 13 | .i_,=:_. -<s. This file is distributed in the hope that |
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
15 | : .. .:, . . . without even the implied warranty of | 15 | : .. .:, . . . without even the implied warranty of |
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
18 | ..}^=.= = ; Public License for more details. | 18 | ..}^=.= = ; Public License for more details. |
19 | ++= -. .` .: | 19 | ++= -. .` .: |
20 | : = ...= . :.=- You should have received a copy of the GNU | 20 | : = ...= . :.=- You should have received a copy of the GNU |
21 | -. .:....=;==+<; General Public License along with this file; | 21 | -. .:....=;==+<; General Public License along with this file; |
22 | -_. . . )=. = see the file COPYING. If not, write to the | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
23 | -- :-=` Free Software Foundation, Inc., | 23 | -- :-=` Free Software Foundation, Inc., |
24 | 59 Temple Place - Suite 330, | 24 | 59 Temple Place - Suite 330, |
@@ -107,3 +107,3 @@ void MenuSettings::init ( ) | |||
107 | name = iface-> name ( ); | 107 | name = iface-> name ( ); |
108 | icon = iface-> icon ( ). pixmap ( QIconSet::Small, QIconSet::Normal ); | 108 | icon = iface-> icon ( ). pixmap (); |
109 | iface-> release ( ); | 109 | iface-> release ( ); |
diff --git a/libopie2/opieui/otabbar.cpp b/libopie2/opieui/otabbar.cpp index a62e18b..dc5df42 100644 --- a/libopie2/opieui/otabbar.cpp +++ b/libopie2/opieui/otabbar.cpp | |||
@@ -1,26 +1,26 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (c) 2002 Dan Williams <williamsdr@acm.org> | 4 | Copyright (c) 2002 Dan Williams <williamsdr@acm.org> |
5 | =. | 5 | =. |
6 | .=l. | 6 | .=l. |
7 | .>+-= | 7 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 8 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 13 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 14 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 17 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
@@ -33,2 +33,6 @@ | |||
33 | 33 | ||
34 | #include <qpe/applnk.h> | ||
35 | |||
36 | #include <stdio.h> | ||
37 | |||
34 | using namespace Opie::Ui; | 38 | using namespace Opie::Ui; |
@@ -50,3 +54,3 @@ void OTabBar::paintLabel( QPainter* p, const QRect& br, QTab* t, bool has_focus | |||
50 | } | 54 | } |
51 | QPixmap pixmap = t->iconset->pixmap( QIconSet::Small, mode ); | 55 | QPixmap pixmap = t->iconset->pixmap(); |
52 | int pixw = pixmap.width(); | 56 | int pixw = pixmap.width(); |
diff --git a/libopie2/opieui/otabbar.h b/libopie2/opieui/otabbar.h index 925ae96..1044bdd 100644 --- a/libopie2/opieui/otabbar.h +++ b/libopie2/opieui/otabbar.h | |||
@@ -1,26 +1,26 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (c) 2002 Dan Williams <williamsdr@acm.org> | 4 | Copyright (c) 2002 Dan Williams <williamsdr@acm.org> |
5 | =. | 5 | =. |
6 | .=l. | 6 | .=l. |
7 | .>+-= | 7 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 8 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 13 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 14 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 17 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
@@ -28,3 +28,3 @@ | |||
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | 29 | ||
30 | */ | 30 | */ |
diff --git a/libopie2/opieui/otabwidget.cpp b/libopie2/opieui/otabwidget.cpp index 7333f5e..d617a9c 100644 --- a/libopie2/opieui/otabwidget.cpp +++ b/libopie2/opieui/otabwidget.cpp | |||
@@ -36,3 +36,2 @@ | |||
36 | 36 | ||
37 | #include <qpe/applnk.h> | ||
38 | #include <qpe/config.h> | 37 | #include <qpe/config.h> |
diff --git a/noncore/styles/flat/flat.cpp b/noncore/styles/flat/flat.cpp index f3bacf9..c164ecc 100644 --- a/noncore/styles/flat/flat.cpp +++ b/noncore/styles/flat/flat.cpp | |||
@@ -375,3 +375,3 @@ void FlatStyle::drawPushButtonLabel( QPushButton *btn, QPainter *p ) | |||
375 | mode = QIconSet::Active; | 375 | mode = QIconSet::Active; |
376 | QPixmap pixmap = btn->iconSet()->pixmap( QIconSet::Small, mode ); | 376 | QPixmap pixmap = btn->iconSet()->pixmap( QIconSet::Automatic, mode ); |
377 | int pixw = pixmap.width(); | 377 | int pixw = pixmap.width(); |
@@ -393,4 +393,4 @@ QRect FlatStyle::comboButtonRect( int x, int y, int w, int h) | |||
393 | } | 393 | } |
394 | 394 | ||
395 | 395 | ||
396 | QRect FlatStyle::comboButtonFocusRect( int x, int y, int w, int h) | 396 | QRect FlatStyle::comboButtonFocusRect( int x, int y, int w, int h) |
@@ -894,3 +894,3 @@ int FlatStyle::popupMenuItemHeight( bool /*checkable*/, QMenuItem* mi, const QFo | |||
894 | { | 894 | { |
895 | #ifndef QT_NO_MENUDATA | 895 | #ifndef QT_NO_MENUDATA |
896 | int h = 0; | 896 | int h = 0; |
@@ -904,3 +904,3 @@ int FlatStyle::popupMenuItemHeight( bool /*checkable*/, QMenuItem* mi, const QFo | |||
904 | if ( !mi->isSeparator() && mi->iconSet() != 0 ) { | 904 | if ( !mi->isSeparator() && mi->iconSet() != 0 ) { |
905 | h = QMAX( h, mi->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height() + 2*motifItemFrame ); | 905 | h = QMAX( h, mi->iconSet()->pixmap().height() + 2*motifItemFrame ); |
906 | } | 906 | } |
@@ -916,3 +916,3 @@ void FlatStyle::drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, int | |||
916 | { | 916 | { |
917 | #ifndef QT_NO_MENUDATA | 917 | #ifndef QT_NO_MENUDATA |
918 | const QColorGroup & g = pal.active(); | 918 | const QColorGroup & g = pal.active(); |
@@ -956,3 +956,7 @@ void FlatStyle::drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, int | |||
956 | mode = QIconSet::Active; | 956 | mode = QIconSet::Active; |
957 | QPixmap pixmap = mi->iconSet()->pixmap( QIconSet::Small, mode ); | 957 | QPixmap pixmap; |
958 | if ( mode == QIconSet::Disabled ) | ||
959 | pixmap = mi->iconSet()->pixmap( QIconSet::Automatic, mode ); | ||
960 | else | ||
961 | pixmap = mi->iconSet()->pixmap(); | ||
958 | int pixw = pixmap.width(); | 962 | int pixw = pixmap.width(); |
diff --git a/noncore/styles/fresh/fresh.cpp b/noncore/styles/fresh/fresh.cpp index 831b620..856f68b 100644 --- a/noncore/styles/fresh/fresh.cpp +++ b/noncore/styles/fresh/fresh.cpp | |||
@@ -149,4 +149,4 @@ QRect FreshStyle::comboButtonRect( int x, int y, int w, int h) | |||
149 | } | 149 | } |
150 | 150 | ||
151 | 151 | ||
152 | QRect FreshStyle::comboButtonFocusRect( int x, int y, int w, int h) | 152 | QRect FreshStyle::comboButtonFocusRect( int x, int y, int w, int h) |
@@ -530,3 +530,3 @@ void FreshStyle::drawTab( QPainter *p, const QTabBar *tb, QTab *t, bool selected | |||
530 | //do shading; will not work for pixmap brushes | 530 | //do shading; will not work for pixmap brushes |
531 | QColor bg = tb->colorGroup().button(); | 531 | QColor bg = tb->colorGroup().button(); |
532 | // int h,s,v; | 532 | // int h,s,v; |
@@ -640,3 +640,3 @@ int FreshStyle::popupMenuItemHeight( bool /*checkable*/, QMenuItem* mi, const QF | |||
640 | { | 640 | { |
641 | #ifndef QT_NO_MENUDATA | 641 | #ifndef QT_NO_MENUDATA |
642 | int h = 0; | 642 | int h = 0; |
@@ -650,3 +650,3 @@ int FreshStyle::popupMenuItemHeight( bool /*checkable*/, QMenuItem* mi, const QF | |||
650 | if ( !mi->isSeparator() && mi->iconSet() != 0 ) { | 650 | if ( !mi->isSeparator() && mi->iconSet() != 0 ) { |
651 | h = QMAX( h, mi->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height() + 2*motifItemFrame ); | 651 | h = QMAX( h, mi->iconSet()->pixmap().height() + 2*motifItemFrame ); |
652 | } | 652 | } |
@@ -662,3 +662,3 @@ void FreshStyle::drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, int | |||
662 | { | 662 | { |
663 | #ifndef QT_NO_MENUDATA | 663 | #ifndef QT_NO_MENUDATA |
664 | const QColorGroup & g = pal.active(); | 664 | const QColorGroup & g = pal.active(); |
@@ -704,3 +704,7 @@ void FreshStyle::drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, int | |||
704 | mode = QIconSet::Active; | 704 | mode = QIconSet::Active; |
705 | QPixmap pixmap = mi->iconSet()->pixmap( QIconSet::Small, mode ); | 705 | QPixmap pixmap; |
706 | if ( mode == QIconSet::Disabled ) | ||
707 | pixmap = mi->iconSet()->pixmap( QIconSet::Automatic, mode ); | ||
708 | else | ||
709 | pixmap = mi->iconSet()->pixmap(); | ||
706 | int pixw = pixmap.width(); | 710 | int pixw = pixmap.width(); |
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp index 51814e7..77cf198 100644 --- a/noncore/styles/liquid/liquid.cpp +++ b/noncore/styles/liquid/liquid.cpp | |||
@@ -5,3 +5,3 @@ | |||
5 | // | 5 | // |
6 | // (c) 2002 Robert 'sandman' Griebl | 6 | // (c) 2002 Robert 'sandman' Griebl |
7 | // | 7 | // |
@@ -14,3 +14,3 @@ | |||
14 | #include "liquid.h" | 14 | #include "liquid.h" |
15 | #include "effects.h" | 15 | #include "effects.h" |
16 | #include "htmlmasks.h" | 16 | #include "htmlmasks.h" |
@@ -101,3 +101,3 @@ void TransMenuHandler::reloadSettings() | |||
101 | opacity = 20; | 101 | opacity = 20; |
102 | 102 | ||
103 | shadowText = config. readBoolEntry("ShadowText", true); | 103 | shadowText = config. readBoolEntry("ShadowText", true); |
@@ -139,6 +139,6 @@ bool TransMenuHandler::eventFilter(QObject *obj, QEvent *ev) | |||
139 | pixDict.insert(p->winId(), pix); | 139 | pixDict.insert(p->winId(), pix); |
140 | 140 | ||
141 | if ( !p->inherits("QPopupMenu")) | 141 | if ( !p->inherits("QPopupMenu")) |
142 | p->setBackgroundPixmap(*pix); | 142 | p->setBackgroundPixmap(*pix); |
143 | 143 | ||
144 | QObjectList *ol = p-> queryList("QWidget"); | 144 | QObjectList *ol = p-> queryList("QWidget"); |
@@ -146,5 +146,5 @@ bool TransMenuHandler::eventFilter(QObject *obj, QEvent *ev) | |||
146 | QWidget *wid = (QWidget *) it.current ( ); | 146 | QWidget *wid = (QWidget *) it.current ( ); |
147 | 147 | ||
148 | wid-> setBackgroundPixmap(*pix); | 148 | wid-> setBackgroundPixmap(*pix); |
149 | wid-> setBackgroundOrigin(QWidget::ParentOrigin); | 149 | wid-> setBackgroundOrigin(QWidget::ParentOrigin); |
150 | } | 150 | } |
@@ -156,6 +156,6 @@ bool TransMenuHandler::eventFilter(QObject *obj, QEvent *ev) | |||
156 | type == Custom){ | 156 | type == Custom){ |
157 | // owarn << "Deleting menu pixmap, width " << pixDict.find(p->winId())->width() << "" << oendl; | 157 | // owarn << "Deleting menu pixmap, width " << pixDict.find(p->winId())->width() << "" << oendl; |
158 | 158 | ||
159 | pixDict.remove(p->winId()); | 159 | pixDict.remove(p->winId()); |
160 | if ( !p->inherits("QPopupMenu")) | 160 | if ( !p->inherits("QPopupMenu")) |
161 | p->setBackgroundMode(QWidget::PaletteBackground); | 161 | p->setBackgroundMode(QWidget::PaletteBackground); |
@@ -165,3 +165,3 @@ bool TransMenuHandler::eventFilter(QObject *obj, QEvent *ev) | |||
165 | QWidget *wid = (QWidget *) it.current ( ); | 165 | QWidget *wid = (QWidget *) it.current ( ); |
166 | 166 | ||
167 | wid-> setBackgroundMode( QWidget::PaletteBackground ); | 167 | wid-> setBackgroundMode( QWidget::PaletteBackground ); |
@@ -175,3 +175,3 @@ bool TransMenuHandler::eventFilter(QObject *obj, QEvent *ev) | |||
175 | 175 | ||
176 | 176 | ||
177 | 177 | ||
@@ -501,3 +501,3 @@ QPixmap* LiquidStyle::processEmbedded(const char *label, int h, int s, int v, | |||
501 | if(img.isNull()){ // shouldn't happen, been tested | 501 | if(img.isNull()){ // shouldn't happen, been tested |
502 | owarn << "Invalid embedded label " << label << "" << oendl; | 502 | owarn << "Invalid embedded label " << label << "" << oendl; |
503 | return(NULL); | 503 | return(NULL); |
@@ -601,6 +601,6 @@ QPixmap* LiquidStyle::getPixmap(BitmapData item) | |||
601 | pixmaps[TabDown] = processEmbedded("tab", btnH, btnS, btnV /*, true*/); | 601 | pixmaps[TabDown] = processEmbedded("tab", btnH, btnS, btnV /*, true*/); |
602 | break; | 602 | break; |
603 | case TabFocus: | 603 | case TabFocus: |
604 | pixmaps[TabFocus] = processEmbedded("tab", btnHoverH, btnHoverS, btnHoverV /*, true*/); | 604 | pixmaps[TabFocus] = processEmbedded("tab", btnHoverH, btnHoverS, btnHoverV /*, true*/); |
605 | break; | 605 | break; |
606 | 606 | ||
@@ -803,4 +803,4 @@ void LiquidStyle::polish(QWidget *w) | |||
803 | w->setBackgroundMode(QWidget::NoBackground); | 803 | w->setBackgroundMode(QWidget::NoBackground); |
804 | else if(w-> testWFlags(Qt::WType_Popup) && | 804 | else if(w-> testWFlags(Qt::WType_Popup) && |
805 | !w->inherits("QListBox") && | 805 | !w->inherits("QListBox") && |
806 | ( qstrcmp ( w-> name(), "automatic what's this? widget" ) != 0 )) { | 806 | ( qstrcmp ( w-> name(), "automatic what's this? widget" ) != 0 )) { |
@@ -808,3 +808,3 @@ void LiquidStyle::polish(QWidget *w) | |||
808 | } | 808 | } |
809 | 809 | ||
810 | if(w->isTopLevel()){ | 810 | if(w->isTopLevel()){ |
@@ -812,3 +812,3 @@ void LiquidStyle::polish(QWidget *w) | |||
812 | } | 812 | } |
813 | 813 | ||
814 | if(w->inherits("QRadioButton") || w->inherits("QCheckBox") || w->inherits("QProgressBar")) { | 814 | if(w->inherits("QRadioButton") || w->inherits("QCheckBox") || w->inherits("QProgressBar")) { |
@@ -867,3 +867,3 @@ void LiquidStyle::polish(QWidget *w) | |||
867 | palette().active().brush(QColorGroup::Background).pixmap()){ | 867 | palette().active().brush(QColorGroup::Background).pixmap()){ |
868 | owarn << "No parent pixmap for child widget " << w->className() << "" << oendl; | 868 | owarn << "No parent pixmap for child widget " << w->className() << "" << oendl; |
869 | return; | 869 | return; |
@@ -880,3 +880,3 @@ void LiquidStyle::polish(QWidget *w) | |||
880 | if ( !w-> inherits("QFrame") || (((QFrame*) w)-> frameShape () == QFrame::NoFrame )) | 880 | if ( !w-> inherits("QFrame") || (((QFrame*) w)-> frameShape () == QFrame::NoFrame )) |
881 | w-> setBackgroundOrigin ( QWidget::ParentOrigin ); | 881 | w-> setBackgroundOrigin ( QWidget::ParentOrigin ); |
882 | else if ( w-> inherits("QFrame") ) | 882 | else if ( w-> inherits("QFrame") ) |
@@ -899,3 +899,3 @@ void LiquidStyle::unPolish(QWidget *w) | |||
899 | w->setBackgroundMode(QWidget::PaletteButton); | 899 | w->setBackgroundMode(QWidget::PaletteButton); |
900 | else if(w-> testWFlags(Qt::WType_Popup) && | 900 | else if(w-> testWFlags(Qt::WType_Popup) && |
901 | !w->inherits("QListBox") && | 901 | !w->inherits("QListBox") && |
@@ -961,11 +961,11 @@ void LiquidStyle::polish(QApplication *app) | |||
961 | app->setEffectEnabled(UI_FadeMenu, false); | 961 | app->setEffectEnabled(UI_FadeMenu, false); |
962 | 962 | ||
963 | qt_set_draw_menu_bar_impl((QDrawMenuBarItemImpl) &LiquidStyle::drawMenuBarItem); | 963 | qt_set_draw_menu_bar_impl((QDrawMenuBarItemImpl) &LiquidStyle::drawMenuBarItem); |
964 | 964 | ||
965 | Config config ( "qpe" ); | 965 | Config config ( "qpe" ); |
966 | config. setGroup ( "Liquid-Style" ); | 966 | config. setGroup ( "Liquid-Style" ); |
967 | 967 | ||
968 | // if ( config. readBoolEntry ( "WinDecoration", true )) | 968 | // if ( config. readBoolEntry ( "WinDecoration", true )) |
969 | // QApplication::qwsSetDecoration ( new LiquidDecoration ( )); | 969 | // QApplication::qwsSetDecoration ( new LiquidDecoration ( )); |
970 | 970 | ||
971 | flatTBButtons = config. readBoolEntry ( "FlatToolButtons", false ); | 971 | flatTBButtons = config. readBoolEntry ( "FlatToolButtons", false ); |
@@ -980,3 +980,3 @@ void LiquidStyle::unPolish(QApplication *app) | |||
980 | qt_set_draw_menu_bar_impl ( 0 ); | 980 | qt_set_draw_menu_bar_impl ( 0 ); |
981 | 981 | ||
982 | // QApplication::qwsSetDecoration ( new QPEDecoration ( )); | 982 | // QApplication::qwsSetDecoration ( new QPEDecoration ( )); |
@@ -986,5 +986,5 @@ void LiquidStyle::unPolish(QApplication *app) | |||
986 | /* !! HACK !! Beware | 986 | /* !! HACK !! Beware |
987 | * | 987 | * |
988 | * TT forgot to make the QProgressBar widget styleable in Qt 2.x | 988 | * TT forgot to make the QProgressBar widget styleable in Qt 2.x |
989 | * So the only way to customize the drawing, is to intercept the | 989 | * So the only way to customize the drawing, is to intercept the |
990 | * paint event - since we have to use protected functions, we need | 990 | * paint event - since we have to use protected functions, we need |
@@ -992,3 +992,3 @@ void LiquidStyle::unPolish(QApplication *app) | |||
992 | * in there. | 992 | * in there. |
993 | * | 993 | * |
994 | * - sandman | 994 | * - sandman |
@@ -999,3 +999,3 @@ public: | |||
999 | HackProgressBar ( ); | 999 | HackProgressBar ( ); |
1000 | 1000 | ||
1001 | void paint ( QPaintEvent *event, const QColorGroup &g, QPixmap *pix ) | 1001 | void paint ( QPaintEvent *event, const QColorGroup &g, QPixmap *pix ) |
@@ -1033,4 +1033,4 @@ public: | |||
1033 | p.drawTiledPixmap(x+2, y+2, bw-4, h-4, *pix); | 1033 | p.drawTiledPixmap(x+2, y+2, bw-4, h-4, *pix); |
1034 | 1034 | ||
1035 | if ( progress ( )>= 0 && totalSteps ( ) > 0 ) { | 1035 | if ( progress ( )>= 0 && totalSteps ( ) > 0 ) { |
1036 | QString pstr; | 1036 | QString pstr; |
@@ -1056,3 +1056,3 @@ public: | |||
1056 | HackToolButton ( ); | 1056 | HackToolButton ( ); |
1057 | 1057 | ||
1058 | void paint ( QPaintEvent *ev ) | 1058 | void paint ( QPaintEvent *ev ) |
@@ -1100,3 +1100,3 @@ bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev) | |||
1100 | QToolButton *btn = (QToolButton *)obj; | 1100 | QToolButton *btn = (QToolButton *)obj; |
1101 | if(ev->type() == QEvent::FocusIn ){ // && !btn-> autoRaise () | 1101 | if(ev->type() == QEvent::FocusIn ){ // && !btn-> autoRaise () |
1102 | if(btn->isEnabled()){ | 1102 | if(btn->isEnabled()){ |
@@ -1140,3 +1140,3 @@ bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev) | |||
1140 | */ | 1140 | */ |
1141 | int x = 0; | 1141 | int x = 0; |
1142 | int y = (btn->height()-lsz.height()+fm.height()-sz.height())/2; | 1142 | int y = (btn->height()-lsz.height()+fm.height()-sz.height())/2; |
@@ -1195,3 +1195,3 @@ bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev) | |||
1195 | const QColorGroup &g = p-> colorGroup ( ); | 1195 | const QColorGroup &g = p-> colorGroup ( ); |
1196 | 1196 | ||
1197 | QPixmap *pix = bevelFillDict.find(g.button().dark(120).rgb()); | 1197 | QPixmap *pix = bevelFillDict.find(g.button().dark(120).rgb()); |
@@ -1205,5 +1205,5 @@ bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev) | |||
1205 | p-> paint ((QPaintEvent *) ev, g, pix ); | 1205 | p-> paint ((QPaintEvent *) ev, g, pix ); |
1206 | return true; | 1206 | return true; |
1207 | } | 1207 | } |
1208 | } | 1208 | } |
1209 | return false ; | 1209 | return false ; |
@@ -1305,3 +1305,7 @@ void LiquidStyle::drawPushButtonLabel(QPushButton *btn, QPainter *p) | |||
1305 | mode = QIconSet::Active; | 1305 | mode = QIconSet::Active; |
1306 | QPixmap pixmap = btn->iconSet()->pixmap( QIconSet::Small, mode ); | 1306 | QPixmap pixmap; |
1307 | if ( mode == QIconSet::Disabled ) | ||
1308 | pixmap = btn->iconSet()->pixmap( QIconSet::Automatic, mode ); | ||
1309 | else | ||
1310 | pixmap = btn->iconSet()->pixmap(); | ||
1307 | int pixw = pixmap.width(); | 1311 | int pixw = pixmap.width(); |
@@ -1313,3 +1317,3 @@ void LiquidStyle::drawPushButtonLabel(QPushButton *btn, QPainter *p) | |||
1313 | } | 1317 | } |
1314 | 1318 | ||
1315 | if(act){ | 1319 | if(act){ |
@@ -1407,3 +1411,3 @@ void LiquidStyle::drawComboButton(QPainter *painter, int x, int y, int w, int h, | |||
1407 | edit && | 1411 | edit && |
1408 | ((QWidget *) painter-> device ( ))-> inherits ( "QComboBox" ) && | 1412 | ((QWidget *) painter-> device ( ))-> inherits ( "QComboBox" ) && |
1409 | ( qApp-> focusWidget ( ) == ((QComboBox *) painter->device())->lineEdit ( ) || | 1413 | ( qApp-> focusWidget ( ) == ((QComboBox *) painter->device())->lineEdit ( ) || |
@@ -1415,3 +1419,3 @@ void LiquidStyle::drawComboButton(QPainter *painter, int x, int y, int w, int h, | |||
1415 | } | 1419 | } |
1416 | 1420 | ||
1417 | bool isMasked = false; | 1421 | bool isMasked = false; |
@@ -1419,3 +1423,3 @@ void LiquidStyle::drawComboButton(QPainter *painter, int x, int y, int w, int h, | |||
1419 | isMasked = ((QWidget*)painter->device())->autoMask(); | 1423 | isMasked = ((QWidget*)painter->device())->autoMask(); |
1420 | // TODO: Do custom code, don't just call drawRoundButton into a pixmap | 1424 | // TODO: Do custom code, don't just call drawRoundButton into a pixmap |
1421 | QPixmap tmpPix(w, h); | 1425 | QPixmap tmpPix(w, h); |
@@ -1480,3 +1484,3 @@ QRect LiquidStyle::comboButtonFocusRect(int /*x*/, int /*y*/, int /*w*/, int /*h | |||
1480 | return QRect ( ); | 1484 | return QRect ( ); |
1481 | 1485 | ||
1482 | // return(QRect(x+5, y+3, w-(h/3)-13, h-5)); | 1486 | // return(QRect(x+5, y+3, w-(h/3)-13, h-5)); |
@@ -1635,3 +1639,3 @@ void LiquidStyle::drawScrollBarControls(QPainter *p, const QScrollBar *sb, | |||
1635 | 13, *getPixmap(HSBSliderMid)); | 1639 | 13, *getPixmap(HSBSliderMid)); |
1636 | painter.drawPixmap(sliderR.right()-8, sliderR.y()+1, | 1640 | painter.drawPixmap(sliderR.right()-8, sliderR.y()+1, |
1637 | *getPixmap(HSBSliderBtm)); | 1641 | *getPixmap(HSBSliderBtm)); |
@@ -1642,3 +1646,3 @@ void LiquidStyle::drawScrollBarControls(QPainter *p, const QScrollBar *sb, | |||
1642 | *getPixmap(HSBSliderTop), 0, 0, m, 13); | 1646 | *getPixmap(HSBSliderTop), 0, 0, m, 13); |
1643 | painter.drawPixmap(sliderR.right()-8, sliderR.y()+1, | 1647 | painter.drawPixmap(sliderR.right()-8, sliderR.y()+1, |
1644 | *getPixmap(HSBSliderBtm), 8-m, 0, m, 13); | 1648 | *getPixmap(HSBSliderBtm), 8-m, 0, m, 13); |
@@ -1650,3 +1654,3 @@ void LiquidStyle::drawScrollBarControls(QPainter *p, const QScrollBar *sb, | |||
1650 | painter.drawTiledPixmap(sliderR.x()+1, sliderR.y()+2, | 1654 | painter.drawTiledPixmap(sliderR.x()+1, sliderR.y()+2, |
1651 | sliderR.width()-2, 11, | 1655 | sliderR.width()-2, 11, |
1652 | *getPixmap(HSBSliderMid), 0, 1); | 1656 | *getPixmap(HSBSliderMid), 0, 1); |
@@ -1978,5 +1982,5 @@ void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, | |||
1978 | QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active ) | 1982 | QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active ) |
1979 | { | 1983 | { |
1980 | if(active){ | 1984 | if(active){ |
1981 | x -= 2; // Bug in Qt/E | 1985 | x -= 2; // Bug in Qt/E |
1982 | y -= 2; | 1986 | y -= 2; |
@@ -1985,3 +1989,3 @@ void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, | |||
1985 | } | 1989 | } |
1986 | 1990 | ||
1987 | QWidget *parent = (QWidget *)p->device(); | 1991 | QWidget *parent = (QWidget *)p->device(); |
@@ -1989,3 +1993,3 @@ void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, | |||
1989 | parent->erase(x, y, w, h); | 1993 | parent->erase(x, y, w, h); |
1990 | 1994 | ||
1991 | if(menuHandler->useShadowText()){ | 1995 | if(menuHandler->useShadowText()){ |
@@ -2001,3 +2005,3 @@ void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, | |||
2001 | QPixmap *dummy = 0; | 2005 | QPixmap *dummy = 0; |
2002 | 2006 | ||
2003 | if ( mi-> pixmap ( ) && !mi-> pixmap ( )-> isNull ( )) { | 2007 | if ( mi-> pixmap ( ) && !mi-> pixmap ( )-> isNull ( )) { |
@@ -2157,3 +2161,7 @@ static const int windowsRightBorder = 12; | |||
2157 | mode = QIconSet::Active; | 2161 | mode = QIconSet::Active; |
2158 | QPixmap pixmap = mi->iconSet()->pixmap(QIconSet::Small, mode); | 2162 | QPixmap pixmap; |
2163 | if ( mode == QIconSet::Disabled ) | ||
2164 | pixmap = mi->iconSet()->pixmap( QIconSet::Automatic, mode ); | ||
2165 | else | ||
2166 | pixmap = mi->iconSet()->pixmap(); | ||
2159 | int pixw = pixmap.width(); | 2167 | int pixw = pixmap.width(); |
@@ -2238,4 +2246,3 @@ int LiquidStyle::popupMenuItemHeight(bool /*checkable*/, QMenuItem *mi, | |||
2238 | if (mi->iconSet()) | 2246 | if (mi->iconSet()) |
2239 | h = QMAX(mi->iconSet()-> | 2247 | h = QMAX(mi->iconSet()->pixmap().height(), h); |
2240 | pixmap(QIconSet::Small, QIconSet::Normal).height(), h); | ||
2241 | 2248 | ||
@@ -2432,3 +2439,3 @@ void LiquidStyle::drawPanel(QPainter *p, int x, int y, int w, int h, | |||
2432 | p->drawLine(x, y, x, y2); | 2439 | p->drawLine(x, y, x, y2); |
2433 | 2440 | ||
2434 | p->setPen(g.midlight()); | 2441 | p->setPen(g.midlight()); |
@@ -2490,3 +2497,3 @@ void LiquidStyle::intensity(QPixmap &pix, float percent) | |||
2490 | (unsigned int *)image.colorTable(); | 2497 | (unsigned int *)image.colorTable(); |
2491 | 2498 | ||
2492 | bool brighten = (percent >= 0); | 2499 | bool brighten = (percent >= 0); |
@@ -2494,3 +2501,3 @@ void LiquidStyle::intensity(QPixmap &pix, float percent) | |||
2494 | percent = -percent; | 2501 | percent = -percent; |
2495 | 2502 | ||
2496 | if(brighten){ // keep overflow check out of loops | 2503 | if(brighten){ // keep overflow check out of loops |
@@ -2511,3 +2518,3 @@ void LiquidStyle::intensity(QPixmap &pix, float percent) | |||
2511 | } | 2518 | } |
2512 | 2519 | ||
2513 | if(brighten){ // same here | 2520 | if(brighten){ // same here |
diff --git a/noncore/styles/phase/phasestyle.cpp b/noncore/styles/phase/phasestyle.cpp index 746354e..c2b9de8 100644 --- a/noncore/styles/phase/phasestyle.cpp +++ b/noncore/styles/phase/phasestyle.cpp | |||
@@ -392,3 +392,6 @@ void PhaseStyle::drawPushButtonLabel (QPushButton *button, QPainter *painter) { | |||
392 | 392 | ||
393 | pixmap = button->iconSet()->pixmap(QIconSet::Small, mode); | 393 | if ( mode == QIconSet::Disabled ) |
394 | pixmap = button->iconSet()->pixmap( QIconSet::Automatic, mode ); | ||
395 | else | ||
396 | pixmap = button->iconSet()->pixmap(); | ||
394 | if (button->text().isEmpty() && !button->pixmap()) { | 397 | if (button->text().isEmpty() && !button->pixmap()) { |
@@ -571,4 +574,3 @@ int PhaseStyle::popupMenuItemHeight ( bool , | |||
571 | if ( mi->iconSet() ) | 574 | if ( mi->iconSet() ) |
572 | h = QMAX(h, mi->iconSet()-> | 575 | h = QMAX(h, mi->iconSet()->pixmap().height() |
573 | pixmap(QIconSet::Small, QIconSet::Normal ).height() | ||
574 | + ITEMFRAME*2 ); | 576 | + ITEMFRAME*2 ); |
@@ -663,3 +665,7 @@ void PhaseStyle::drawPopupMenuItem ( QPainter * p, bool checkable, | |||
663 | mode = enabled ? QIconSet::Normal : QIconSet::Disabled; | 665 | mode = enabled ? QIconSet::Normal : QIconSet::Disabled; |
664 | QPixmap pixmap = mi->iconSet()->pixmap(QIconSet::Small, mode ); | 666 | QPixmap pixmap; |
667 | if ( mode == QIconSet::Disabled ) | ||
668 | pixmap = mi->iconSet()->pixmap( QIconSet::Automatic, mode ); | ||
669 | else | ||
670 | pixmap = mi->iconSet()->pixmap(); | ||
665 | QRect pmrect(0, 0, pixmap.width(), pixmap.height() ); | 671 | QRect pmrect(0, 0, pixmap.width(), pixmap.height() ); |
diff --git a/noncore/styles/theme/othemestyle.cpp b/noncore/styles/theme/othemestyle.cpp index 98e7253..106d206 100644 --- a/noncore/styles/theme/othemestyle.cpp +++ b/noncore/styles/theme/othemestyle.cpp | |||
@@ -39,5 +39,5 @@ QDrawMenuBarItemImpl qt_set_draw_menu_bar_impl(QDrawMenuBarItemImpl impl); | |||
39 | /* !! HACK !! Beware | 39 | /* !! HACK !! Beware |
40 | * | 40 | * |
41 | * TT forgot to make the QProgressBar widget styleable in Qt 2.x | 41 | * TT forgot to make the QProgressBar widget styleable in Qt 2.x |
42 | * So the only way to customize the drawing, is to intercept the | 42 | * So the only way to customize the drawing, is to intercept the |
43 | * paint event - since we have to use protected functions, we need | 43 | * paint event - since we have to use protected functions, we need |
@@ -45,3 +45,3 @@ QDrawMenuBarItemImpl qt_set_draw_menu_bar_impl(QDrawMenuBarItemImpl impl); | |||
45 | * in there. | 45 | * in there. |
46 | * | 46 | * |
47 | * - sandman | 47 | * - sandman |
@@ -52,3 +52,3 @@ public: | |||
52 | HackProgressBar ( ); | 52 | HackProgressBar ( ); |
53 | 53 | ||
54 | void paint ( QPaintEvent *event, OThemeStyle *style ) | 54 | void paint ( QPaintEvent *event, OThemeStyle *style ) |
@@ -77,5 +77,5 @@ public: | |||
77 | 77 | ||
78 | style-> drawProgressBar ( &p, x, y, w, h, colorGroup ( ), perc ); | 78 | style-> drawProgressBar ( &p, x, y, w, h, colorGroup ( ), perc ); |
79 | 79 | ||
80 | if ( progress ( ) >= 0 && totalSteps ( ) > 0 ) { | 80 | if ( progress ( ) >= 0 && totalSteps ( ) > 0 ) { |
81 | QString pstr; | 81 | QString pstr; |
@@ -111,3 +111,3 @@ void OThemeStyle::polish( QPalette &p ) | |||
111 | oldPalette = p; | 111 | oldPalette = p; |
112 | 112 | ||
113 | QColor bg = oldPalette. color ( QPalette::Normal, QColorGroup::Background ); | 113 | QColor bg = oldPalette. color ( QPalette::Normal, QColorGroup::Background ); |
@@ -117,3 +117,3 @@ void OThemeStyle::polish( QPalette &p ) | |||
117 | 117 | ||
118 | if ( isColor ( Background )) | 118 | if ( isColor ( Background )) |
119 | bg = colorGroup ( oldPalette. active ( ), Background )-> background ( ); | 119 | bg = colorGroup ( oldPalette. active ( ), Background )-> background ( ); |
@@ -126,3 +126,3 @@ void OThemeStyle::polish( QPalette &p ) | |||
126 | if ( fgcolor. isValid ( )) { | 126 | if ( fgcolor. isValid ( )) { |
127 | p. setColor ( QColorGroup::Foreground, fgcolor ); | 127 | p. setColor ( QColorGroup::Foreground, fgcolor ); |
128 | p. setColor ( QColorGroup::ButtonText, fgcolor ); | 128 | p. setColor ( QColorGroup::ButtonText, fgcolor ); |
@@ -130,10 +130,10 @@ void OThemeStyle::polish( QPalette &p ) | |||
130 | if ( selfgcolor. isValid ( )) | 130 | if ( selfgcolor. isValid ( )) |
131 | p. setColor ( QColorGroup::HighlightedText, selfgcolor ); | 131 | p. setColor ( QColorGroup::HighlightedText, selfgcolor ); |
132 | if ( selbgcolor. isValid ( )) | 132 | if ( selbgcolor. isValid ( )) |
133 | p. setColor ( QColorGroup::Highlight, selbgcolor ); | 133 | p. setColor ( QColorGroup::Highlight, selbgcolor ); |
134 | if ( winfgcolor. isValid ( )) | 134 | if ( winfgcolor. isValid ( )) |
135 | p. setColor ( QColorGroup::Text, winfgcolor ); | 135 | p. setColor ( QColorGroup::Text, winfgcolor ); |
136 | if ( winbgcolor. isValid ( )) | 136 | if ( winbgcolor. isValid ( )) |
137 | p. setColor ( QColorGroup::Base, winbgcolor ); | 137 | p. setColor ( QColorGroup::Base, winbgcolor ); |
138 | 138 | ||
139 | } | 139 | } |
@@ -1185,3 +1185,3 @@ void OThemeStyle::drawPushButtonLabel( QPushButton *btn, QPainter *p ) | |||
1185 | mode = QIconSet::Active; | 1185 | mode = QIconSet::Active; |
1186 | QPixmap pixmap = btn->iconSet() ->pixmap( QIconSet::Small, mode ); | 1186 | QPixmap pixmap = btn->iconSet() ->pixmap( QIconSet::Automatic, mode ); |
1187 | int pixw = pixmap.width(); | 1187 | int pixw = pixmap.width(); |
@@ -1248,4 +1248,3 @@ int OThemeStyle::popupMenuItemHeight( bool /*checkable*/, QMenuItem *mi, | |||
1248 | if ( mi->iconSet() ) { | 1248 | if ( mi->iconSet() ) { |
1249 | h2 = mi->iconSet() -> | 1249 | h2 = mi->iconSet() ->pixmap().height() + offset; |
1250 | pixmap( QIconSet::Small, QIconSet::Normal ).height() + offset; | ||
1251 | h = h2 > h ? h2 : h; | 1250 | h = h2 > h ? h2 : h; |
@@ -1327,3 +1326,7 @@ void OThemeStyle::drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, | |||
1327 | mode = QIconSet::Active; | 1326 | mode = QIconSet::Active; |
1328 | QPixmap pixmap = mi->iconSet() ->pixmap( QIconSet::Small, mode ); | 1327 | QPixmap pixmap; |
1328 | if ( mode == QIconSet::Disabled ) | ||
1329 | pixmap = mi->iconSet()->pixmap( QIconSet::Automatic, mode ); | ||
1330 | else | ||
1331 | pixmap = mi->iconSet()->pixmap(); | ||
1329 | int pixw = pixmap.width(); | 1332 | int pixw = pixmap.width(); |
@@ -1436,3 +1439,3 @@ void OThemeStyle::drawKMenuBar( QPainter *p, int x, int y, int w, int h, | |||
1436 | void OThemeStyle::drawMenuBarItem( QPainter *p, int x, int y, int w, int h, | 1439 | void OThemeStyle::drawMenuBarItem( QPainter *p, int x, int y, int w, int h, |
1437 | QMenuItem *mi, const QColorGroup &g, | 1440 | QMenuItem *mi, const QColorGroup &g, |
1438 | bool /*enabled*/, bool active ) | 1441 | bool /*enabled*/, bool active ) |
@@ -1440,3 +1443,3 @@ void OThemeStyle::drawMenuBarItem( QPainter *p, int x, int y, int w, int h, | |||
1440 | if(active){ | 1443 | if(active){ |
1441 | x -= 2; // Bug in Qt/E | 1444 | x -= 2; // Bug in Qt/E |
1442 | y -= 2; | 1445 | y -= 2; |
@@ -1466,7 +1469,7 @@ void OThemeStyle::drawProgressBar ( QPainter *p, int x, int y, int w, int h, con | |||
1466 | bg.setPixmap( *uncached( ProgressBg ) ); | 1469 | bg.setPixmap( *uncached( ProgressBg ) ); |
1467 | 1470 | ||
1468 | int pw = w * percent / 100; | 1471 | int pw = w * percent / 100; |
1469 | 1472 | ||
1470 | p-> fillRect ( x + pw, y, w - pw, h, bg ); // ### TODO | 1473 | p-> fillRect ( x + pw, y, w - pw, h, bg ); // ### TODO |
1471 | 1474 | ||
1472 | drawBaseButton( p, x, y, pw, h, *cg, false, false, ProgressBar ); | 1475 | drawBaseButton( p, x, y, pw, h, *cg, false, false, ProgressBar ); |
diff --git a/noncore/styles/web/webstyle.cpp b/noncore/styles/web/webstyle.cpp index cd3cf08..7b58d89 100644 --- a/noncore/styles/web/webstyle.cpp +++ b/noncore/styles/web/webstyle.cpp | |||
@@ -45,2 +45,11 @@ static ulong _savedFrameStyle; | |||
45 | 45 | ||
46 | static const int ITEMFRAME = 1; // menu stuff | ||
47 | static const int ITEMHMARGIN = 3; | ||
48 | static const int ITEMVMARGIN = 0; | ||
49 | |||
50 | static const int ARROWMARGIN = 6; | ||
51 | static const int RIGHTBORDER = 10; | ||
52 | static const int MINICONSIZE = 12; | ||
53 | |||
54 | |||
46 | static QColor contrastingForeground(const QColor & fg, const QColor & bg) | 55 | static QColor contrastingForeground(const QColor & fg, const QColor & bg) |
@@ -971,3 +980,3 @@ WebStyle::drawPopupMenuItem | |||
971 | int maxpmw, | 980 | int maxpmw, |
972 | int tab, | 981 | int tabwidth, |
973 | QMenuItem * mi, | 982 | QMenuItem * mi, |
@@ -983,3 +992,114 @@ WebStyle::drawPopupMenuItem | |||
983 | // TODO | 992 | // TODO |
984 | QWindowsStyle::drawPopupMenuItem(p, checkable, maxpmw, tab, mi, pal, act, enabled, x, y, w, h); | 993 | //QWindowsStyle::drawPopupMenuItem(p, checkable, maxpmw, tab, mi, pal, act, enabled, x, y, w, h); |
994 | if ( !mi ) | ||
995 | return; | ||
996 | |||
997 | QRect rect(x, y, w, h ); | ||
998 | int x2, y2; | ||
999 | x2 = rect.right(); | ||
1000 | y2 = rect.bottom(); | ||
1001 | const QColorGroup& g = pal.active(); | ||
1002 | QColorGroup itemg = !enabled ? pal.disabled() : pal.active(); | ||
1003 | |||
1004 | if ( checkable || maxpmw ) maxpmw = QMAX(maxpmw, 20); | ||
1005 | |||
1006 | if (act && enabled ) | ||
1007 | p->fillRect(x, y, w, h, g.highlight() ); | ||
1008 | else | ||
1009 | p->fillRect(x, y, w, h, g.background() ); | ||
1010 | |||
1011 | // draw seperator | ||
1012 | if (mi->isSeparator() ) { | ||
1013 | p->setPen( g.dark() ); | ||
1014 | p->drawLine( x+8, y+1, x+w-8, y+1 ); | ||
1015 | |||
1016 | p->setPen( g.mid() ); | ||
1017 | p->drawLine( x+8, y, x+w-8, y ); | ||
1018 | p->drawPoint(x+w,y+1); | ||
1019 | |||
1020 | p->setPen( g.midlight() ); | ||
1021 | p->drawLine( x+8, y-1, x+w-8, y-1 ); | ||
1022 | p->drawPoint(x+8, y ); | ||
1023 | return; | ||
1024 | } | ||
1025 | |||
1026 | // draw icon | ||
1027 | QIconSet::Mode mode; | ||
1028 | if ( mi->iconSet() && !mi->isChecked() ) { | ||
1029 | if ( act ) | ||
1030 | mode = enabled ? QIconSet::Active : QIconSet::Disabled; | ||
1031 | else | ||
1032 | mode = enabled ? QIconSet::Normal : QIconSet::Disabled; | ||
1033 | QPixmap pixmap; | ||
1034 | if ( mode == QIconSet::Disabled ) | ||
1035 | pixmap = mi->iconSet()->pixmap( QIconSet::Automatic, mode ); | ||
1036 | else | ||
1037 | pixmap = mi->iconSet()->pixmap(); | ||
1038 | QRect pmrect(0, 0, pixmap.width(), pixmap.height() ); | ||
1039 | QRect cr(x, y, maxpmw, h ); | ||
1040 | pmrect.moveCenter( cr.center() ); | ||
1041 | p->drawPixmap(pmrect.topLeft(), pixmap); | ||
1042 | } | ||
1043 | |||
1044 | // draw check | ||
1045 | if(mi->isChecked() ) { | ||
1046 | drawCheckMark(p, x, y, maxpmw, h, itemg, act, !enabled ); | ||
1047 | } | ||
1048 | |||
1049 | |||
1050 | // draw text | ||
1051 | int xm = maxpmw + 2; | ||
1052 | int xp = x + xm; | ||
1053 | int tw = w -xm - 2; | ||
1054 | |||
1055 | p->setPen( enabled ? ( act ? g.highlightedText() : g.buttonText() ) : | ||
1056 | g.mid() ); | ||
1057 | |||
1058 | |||
1059 | if ( mi->custom() ) { | ||
1060 | p->save(); | ||
1061 | mi->custom()->paint(p, g, act, enabled, | ||
1062 | xp, y+1, tw, h-2 ); | ||
1063 | p->restore(); | ||
1064 | }else { // draw label | ||
1065 | QString text = mi->text(); | ||
1066 | if (!text.isNull() ) { | ||
1067 | int t = text.find('\t'); | ||
1068 | const int tflags = AlignVCenter | DontClip | | ||
1069 | ShowPrefix | SingleLine | | ||
1070 | AlignLeft; | ||
1071 | |||
1072 | if (t >= 0) { | ||
1073 | int tabx = x + w - tabwidth - RIGHTBORDER - | ||
1074 | ITEMHMARGIN - ITEMFRAME; | ||
1075 | p->drawText(tabx, y+ITEMVMARGIN, tabwidth, | ||
1076 | h-2*ITEMVMARGIN, tflags, | ||
1077 | text.mid(t+1) ); | ||
1078 | text = text.left(t ); | ||
1079 | } | ||
1080 | |||
1081 | // draw left label | ||
1082 | p->drawText(xp, y+ITEMVMARGIN, | ||
1083 | tw, h-2*ITEMVMARGIN, | ||
1084 | tflags, text, t); | ||
1085 | }else if ( mi->pixmap() ) { // pixmap as label | ||
1086 | QPixmap pixmap = *mi->pixmap(); | ||
1087 | if ( pixmap.depth() == 1 ) | ||
1088 | p->setBackgroundMode( OpaqueMode ); | ||
1089 | |||
1090 | int dx = ((w-pixmap.width() ) /2 ) + | ||
1091 | ((w - pixmap.width()) %2 ); | ||
1092 | p->drawPixmap(x+dx, y+ITEMFRAME, pixmap ); | ||
1093 | |||
1094 | if ( pixmap.depth() == 1 ) | ||
1095 | p->setBackgroundMode( TransparentMode ); | ||
1096 | } | ||
1097 | } | ||
1098 | |||
1099 | if ( mi->popup() ) { // draw submenu arrow | ||
1100 | int dim = (h-2*ITEMFRAME) / 2; | ||
1101 | drawArrow( p, RightArrow, false, | ||
1102 | x+w-ARROWMARGIN-ITEMFRAME-dim, | ||
1103 | y+h/2-dim/2, dim, dim, g, enabled ); | ||
1104 | } | ||
985 | } | 1105 | } |
@@ -1170,3 +1290,3 @@ WebStyle::popupMenuItemHeight(bool, QMenuItem * i, const QFontMetrics & fm) | |||
1170 | ( | 1290 | ( |
1171 | i->iconSet()->pixmap(QIconSet::Small, QIconSet::Normal).height(), | 1291 | i->iconSet()->pixmap().height(), |
1172 | h | 1292 | h |
diff --git a/noncore/styles/web/webstyle.h b/noncore/styles/web/webstyle.h index 83ab784..d6f153b 100644 --- a/noncore/styles/web/webstyle.h +++ b/noncore/styles/web/webstyle.h | |||
@@ -217,3 +217,3 @@ class WebStyle : public QWindowsStyle { | |||
217 | int maxpmw, | 217 | int maxpmw, |
218 | int tab, | 218 | int tabwidth, |
219 | QMenuItem *, | 219 | QMenuItem *, |