summaryrefslogtreecommitdiff
path: root/noncore/styles/theme/othemestyle.cpp
authordrw <drw>2005-04-14 18:30:23 (UTC)
committer drw <drw>2005-04-14 18:30:23 (UTC)
commit5fd266a3a5a6d9a1acb9c38e4802ff06ba38beaf (patch) (side-by-side diff)
treed4ba8a948d876db9bbff10cbd282fd16aab91feb /noncore/styles/theme/othemestyle.cpp
parent7a3b813cc3bfbb2f7c31f347c35405851e82aecf (diff)
downloadopie-5fd266a3a5a6d9a1acb9c38e4802ff06ba38beaf.zip
opie-5fd266a3a5a6d9a1acb9c38e4802ff06ba38beaf.tar.gz
opie-5fd266a3a5a6d9a1acb9c38e4802ff06ba38beaf.tar.bz2
More icon sizing updates
Diffstat (limited to 'noncore/styles/theme/othemestyle.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/theme/othemestyle.cpp53
1 files changed, 28 insertions, 25 deletions
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);
/* !! HACK !! Beware
- *
+ *
* TT forgot to make the QProgressBar widget styleable in Qt 2.x
- * So the only way to customize the drawing, is to intercept the
+ * So the only way to customize the drawing, is to intercept the
* paint event - since we have to use protected functions, we need
@@ -45,3 +45,3 @@ QDrawMenuBarItemImpl qt_set_draw_menu_bar_impl(QDrawMenuBarItemImpl impl);
* in there.
- *
+ *
* - sandman
@@ -52,3 +52,3 @@ public:
HackProgressBar ( );
-
+
void paint ( QPaintEvent *event, OThemeStyle *style )
@@ -77,5 +77,5 @@ public:
- style-> drawProgressBar ( &p, x, y, w, h, colorGroup ( ), perc );
+ style-> drawProgressBar ( &p, x, y, w, h, colorGroup ( ), perc );
- if ( progress ( ) >= 0 && totalSteps ( ) > 0 ) {
+ if ( progress ( ) >= 0 && totalSteps ( ) > 0 ) {
QString pstr;
@@ -111,3 +111,3 @@ void OThemeStyle::polish( QPalette &p )
oldPalette = p;
-
+
QColor bg = oldPalette. color ( QPalette::Normal, QColorGroup::Background );
@@ -117,3 +117,3 @@ void OThemeStyle::polish( QPalette &p )
- if ( isColor ( Background ))
+ if ( isColor ( Background ))
bg = colorGroup ( oldPalette. active ( ), Background )-> background ( );
@@ -126,3 +126,3 @@ void OThemeStyle::polish( QPalette &p )
if ( fgcolor. isValid ( )) {
- p. setColor ( QColorGroup::Foreground, fgcolor );
+ p. setColor ( QColorGroup::Foreground, fgcolor );
p. setColor ( QColorGroup::ButtonText, fgcolor );
@@ -130,10 +130,10 @@ void OThemeStyle::polish( QPalette &p )
if ( selfgcolor. isValid ( ))
- p. setColor ( QColorGroup::HighlightedText, selfgcolor );
+ p. setColor ( QColorGroup::HighlightedText, selfgcolor );
if ( selbgcolor. isValid ( ))
- p. setColor ( QColorGroup::Highlight, selbgcolor );
- if ( winfgcolor. isValid ( ))
- p. setColor ( QColorGroup::Text, winfgcolor );
+ p. setColor ( QColorGroup::Highlight, selbgcolor );
+ if ( winfgcolor. isValid ( ))
+ p. setColor ( QColorGroup::Text, winfgcolor );
if ( winbgcolor. isValid ( ))
- p. setColor ( QColorGroup::Base, winbgcolor );
-
+ p. setColor ( QColorGroup::Base, winbgcolor );
+
}
@@ -1185,3 +1185,3 @@ void OThemeStyle::drawPushButtonLabel( QPushButton *btn, QPainter *p )
mode = QIconSet::Active;
- QPixmap pixmap = btn->iconSet() ->pixmap( QIconSet::Small, mode );
+ QPixmap pixmap = btn->iconSet() ->pixmap( QIconSet::Automatic, mode );
int pixw = pixmap.width();
@@ -1248,4 +1248,3 @@ int OThemeStyle::popupMenuItemHeight( bool /*checkable*/, QMenuItem *mi,
if ( mi->iconSet() ) {
- h2 = mi->iconSet() ->
- pixmap( QIconSet::Small, QIconSet::Normal ).height() + offset;
+ h2 = mi->iconSet() ->pixmap().height() + offset;
h = h2 > h ? h2 : h;
@@ -1327,3 +1326,7 @@ void OThemeStyle::drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw,
mode = QIconSet::Active;
- QPixmap pixmap = mi->iconSet() ->pixmap( QIconSet::Small, mode );
+ QPixmap pixmap;
+ if ( mode == QIconSet::Disabled )
+ pixmap = mi->iconSet()->pixmap( QIconSet::Automatic, mode );
+ else
+ pixmap = mi->iconSet()->pixmap();
int pixw = pixmap.width();
@@ -1436,3 +1439,3 @@ void OThemeStyle::drawKMenuBar( QPainter *p, int x, int y, int w, int h,
void OThemeStyle::drawMenuBarItem( QPainter *p, int x, int y, int w, int h,
- QMenuItem *mi, const QColorGroup &g,
+ QMenuItem *mi, const QColorGroup &g,
bool /*enabled*/, bool active )
@@ -1440,3 +1443,3 @@ void OThemeStyle::drawMenuBarItem( QPainter *p, int x, int y, int w, int h,
if(active){
- x -= 2; // Bug in Qt/E
+ x -= 2; // Bug in Qt/E
y -= 2;
@@ -1466,7 +1469,7 @@ void OThemeStyle::drawProgressBar ( QPainter *p, int x, int y, int w, int h, con
bg.setPixmap( *uncached( ProgressBg ) );
-
+
int pw = w * percent / 100;
-
- p-> fillRect ( x + pw, y, w - pw, h, bg ); // ### TODO
-
+
+ p-> fillRect ( x + pw, y, w - pw, h, bg ); // ### TODO
+
drawBaseButton( p, x, y, pw, h, *cg, false, false, ProgressBar );