summaryrefslogtreecommitdiffstats
path: root/kstyles/kthemestyle
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-10-30 22:44:02 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-10-30 22:44:02 -0500
commitd26d6ac23685063d532f0195499e617b2442350b (patch)
treea319beb31fac524d2147a3460de5880841c14faa /kstyles/kthemestyle
parent40712e064638a603834221ccc204345c1bb9acf5 (diff)
downloadtdelibs-d26d6ac23685063d532f0195499e617b2442350b.tar.gz
tdelibs-d26d6ac23685063d532f0195499e617b2442350b.zip
Style update
Diffstat (limited to 'kstyles/kthemestyle')
-rw-r--r--kstyles/kthemestyle/kthemestyle.cpp37
1 files changed, 31 insertions, 6 deletions
diff --git a/kstyles/kthemestyle/kthemestyle.cpp b/kstyles/kthemestyle/kthemestyle.cpp
index 9a604014e..f79bb3765 100644
--- a/kstyles/kthemestyle/kthemestyle.cpp
+++ b/kstyles/kthemestyle/kthemestyle.cpp
@@ -732,6 +732,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, TQPainter * p, TQStyleCon
bool enabled = ( flags & Style_Enabled );
bool down = ( flags & Style_Down );
bool on = flags & Style_On;
+ bool active = flags & Style_Active;
TQColorGroup g = g_base;
switch ( pe )
@@ -1085,6 +1086,34 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, TQPainter * p, TQStyleCon
break;
}
+
+ case PE_MenuItemIndicatorFrame:
+ {
+ // Draw nothing
+ break;
+ }
+ case PE_MenuItemIndicatorIconFrame:
+ {
+ int x, y, w, h;
+ r.rect( &x, &y, &w, &h );
+ TQRect cr = visualRect( TQRect( x, y, w, h ), r );
+ const TQColorGroup& cg_ours = *colorGroup( g_base, active ? MenuItemDown : MenuItem );
+ drawBaseButton( p, cr.x(), cr.y(), cr.width(), cr.height(), *colorGroup( cg_ours, BevelDown ), true, false, BevelDown );
+ break;
+ }
+ case PE_MenuItemIndicatorCheck:
+ {
+ int x, y, w, h;
+ r.rect( &x, &y, &w, &h );
+ TQRect cr = visualRect( TQRect( x, y, w, h ), r );
+ const TQColorGroup& cg_ours = *colorGroup( g_base, active ? MenuItemDown : MenuItem );
+
+ SFlags cflags = Style_Default;
+ cflags |= active ? Style_Enabled : Style_On;
+
+ drawPrimitive( PE_CheckMark, p, ceData, elementFlags, TQRect( x + itemFrame, y + itemFrame, w - itemFrame * 2, h - itemFrame * 2 ), cg_ours, cflags );
+ break;
+ }
default:
handled = false;
}
@@ -1525,7 +1554,7 @@ void KThemeStyle::drawControl( ControlElement element,
// Do we have an icon and are checked at the same time?
// Then draw a "pressed" background behind the icon
if ( checkable && mi->isChecked() ) //!active && -- ??
- drawBaseButton( p, cr.x(), cr.y(), cr.width(), cr.height(), *colorGroup( cg_ours, BevelDown ), true, false, BevelDown );
+ drawPrimitive(PE_MenuItemIndicatorIconFrame, p, ceData, elementFlags, TQRect(x, y, checkcol, h), cg, how);
// Draw the icon
TQPixmap pixmap = mi->iconSet() ->pixmap( TQIconSet::Small, mode );
@@ -1549,11 +1578,7 @@ void KThemeStyle::drawControl( ControlElement element,
// &cg_ours.brush(TQColorGroup::Midlight) );
// Draw the checkmark
- SFlags cflags = Style_Default;
- cflags |= active ? Style_Enabled : Style_On;
-
- drawPrimitive( PE_CheckMark, p, ceData, elementFlags, TQRect( cx + itemFrame, y + itemFrame,
- checkcol - itemFrame * 2, h - itemFrame * 2 ), cg_ours, cflags );
+ drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, TQRect(cx, y, checkcol, h), cg, how);
}
// Time to draw the menu item label...