author | leseb <leseb> | 2002-07-02 21:23:40 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-07-02 21:23:40 (UTC) |
commit | d83f58a1a4a314a3ef8b25dd78432488922a9e31 (patch) (side-by-side diff) | |
tree | 353b815ff13bb34594fa8db4d15233ed6b8c27e4 | |
parent | 2481ac4013794f95c53580f99b4b761142e4ee8f (diff) | |
download | opie-d83f58a1a4a314a3ef8b25dd78432488922a9e31.zip opie-d83f58a1a4a314a3ef8b25dd78432488922a9e31.tar.gz opie-d83f58a1a4a314a3ef8b25dd78432488922a9e31.tar.bz2 |
Fix QToolButton drawing
-rw-r--r-- | noncore/styles/theme/othemestyle.cpp | 8 | ||||
-rw-r--r-- | noncore/styles/theme/othemestyle.h | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/noncore/styles/theme/othemestyle.cpp b/noncore/styles/theme/othemestyle.cpp index 61127b8..d97b026 100644 --- a/noncore/styles/theme/othemestyle.cpp +++ b/noncore/styles/theme/othemestyle.cpp @@ -296,32 +296,40 @@ void OThemeStyle::drawButtonMask( QPainter *p, int x, int y, int w, int h ) drawBaseMask( p, x, y, w, h, roundButton() ); } void OThemeStyle::drawComboButtonMask( QPainter *p, int x, int y, int w, int h ) { drawBaseMask( p, x, y, w, h, roundComboBox() ); } void OThemeStyle::drawBevelButton( QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool sunken, const QBrush * ) { WidgetType type = sunken ? BevelDown : Bevel; drawBaseButton( p, x, y, w, h, *colorGroup( g, type ), sunken, false, type ); } +void OThemeStyle::drawToolButton( QPainter *p, int x, int y, int w, int h, + const QColorGroup &g, bool sunken, + const QBrush * ) +{ + WidgetType type = sunken ? ToolButtonDown : ToolButton; + drawBaseButton( p, x, y, w, h, *colorGroup( g, type ), sunken, false, type ); +} + #if 0 void OThemeStyle::drawKToolBarButton( QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool sunken, bool raised, bool enabled, bool popup, KToolButtonType type, const QString &btext, const QPixmap *pixmap, QFont *font, QWidget * ) { QFont tmp_font( QString::fromLatin1( "Helvetica" ), 10 ); if ( font ) tmp_font = *font; QFontMetrics fm( tmp_font ); WidgetType widget = sunken ? ToolButtonDown : ToolButton; drawBaseButton( p, x, y, w, h, *colorGroup( g, widget ), sunken, false, widget ); diff --git a/noncore/styles/theme/othemestyle.h b/noncore/styles/theme/othemestyle.h index 02bec78..52445c4 100644 --- a/noncore/styles/theme/othemestyle.h +++ b/noncore/styles/theme/othemestyle.h @@ -96,32 +96,38 @@ public: * * This calls @ref drawBaseButton() with @p PushButton as the * widget type. */ virtual void drawButton( QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool sunken = FALSE, const QBrush *fill = 0 ); /** * Draw a bevel button. * * This calls @ref drawBaseButton() with Bevel as the * widget type. */ virtual void drawBevelButton( QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool sunken = FALSE, const QBrush *fill = 0 ); + /** + * Draw a toolbar button. + */ + virtual void drawToolButton ( QPainter *p, int x, int y, int w, int h, + const QColorGroup &g, bool sunken = FALSE, + const QBrush *fill = 0 ); #if 0 /** * Draw a toolbar button. */ virtual void drawKToolBarButton( QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool sunken = false, bool raised = true, bool enabled = true, bool popup = false, KToolButtonType type = Icon, const QString &btext = QString::null, const QPixmap *icon = NULL, QFont *font = NULL, QWidget *btn = NULL ); /** * Draw the handle used in toolbars. */ void drawKBarHandle( QPainter *p, int x, int y, int w, int h, const QColorGroup &g, |