author | drw <drw> | 2005-04-14 18:30:23 (UTC) |
---|---|---|
committer | drw <drw> | 2005-04-14 18:30:23 (UTC) |
commit | 5fd266a3a5a6d9a1acb9c38e4802ff06ba38beaf (patch) (unidiff) | |
tree | d4ba8a948d876db9bbff10cbd282fd16aab91feb /noncore/styles/theme | |
parent | 7a3b813cc3bfbb2f7c31f347c35405851e82aecf (diff) | |
download | opie-5fd266a3a5a6d9a1acb9c38e4802ff06ba38beaf.zip opie-5fd266a3a5a6d9a1acb9c38e4802ff06ba38beaf.tar.gz opie-5fd266a3a5a6d9a1acb9c38e4802ff06ba38beaf.tar.bz2 |
More icon sizing updates
-rw-r--r-- | noncore/styles/theme/othemestyle.cpp | 53 |
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); | |||
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 ); |