summaryrefslogtreecommitdiffstats
path: root/kstyles/highcolor
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/highcolor
parent40712e064638a603834221ccc204345c1bb9acf5 (diff)
downloadtdelibs-d26d6ac23685063d532f0195499e617b2442350b.tar.gz
tdelibs-d26d6ac23685063d532f0195499e617b2442350b.zip
Style update
Diffstat (limited to 'kstyles/highcolor')
-rw-r--r--kstyles/highcolor/highcolor.cpp61
1 files changed, 43 insertions, 18 deletions
diff --git a/kstyles/highcolor/highcolor.cpp b/kstyles/highcolor/highcolor.cpp
index 120f7d6e6..c659f7451 100644
--- a/kstyles/highcolor/highcolor.cpp
+++ b/kstyles/highcolor/highcolor.cpp
@@ -260,8 +260,10 @@ void HighColorStyle::drawPrimitive( TQ_PrimitiveElement pe,
SFlags flags,
const TQStyleOption& opt ) const
{
- bool down = flags & Style_Down;
- bool on = flags & Style_On;
+ bool down = flags & Style_Down;
+ bool on = flags & Style_On;
+ bool active = flags & Style_Active;
+ bool reverse = TQApplication::reverseLayout();
switch(pe)
{
@@ -851,6 +853,42 @@ void HighColorStyle::drawPrimitive( TQ_PrimitiveElement pe,
break;
}
+ case PE_MenuItemIndicatorFrame: {
+ int x, y, w, h;
+ r.rect( &x, &y, &w, &h );
+ TQRect cr = visualRect( TQRect(x, y, w, h), r );
+
+ int cx = reverse ? x+w - w : x;
+
+ // We only have to draw the background if the menu item is inactive -
+ // if it's active the "pressed" background is already drawn
+ if ( ! active )
+ qDrawShadePanel( p, cx, y, w, h, cg, true, 1, &cg.brush(TQColorGroup::Midlight) );
+ }
+ break;
+
+ case PE_MenuItemIndicatorIconFrame: {
+ int x, y, w, h;
+ r.rect( &x, &y, &w, &h );
+ TQRect cr = visualRect( TQRect(x, y, w, h), r );
+ qDrawShadePanel( p, cr.x(), cr.y(), cr.width(), cr.height(), cg, true, 1, &cg.brush(TQColorGroup::Midlight) );
+ }
+ break;
+
+ case PE_MenuItemIndicatorCheck: {
+ int x, y, w, h;
+ r.rect( &x, &y, &w, &h );
+ TQRect cr = visualRect( TQRect(x, y, w, h), r );
+
+ int cx = reverse ? x+w - w : x;
+
+ // Draw the checkmark
+ SFlags cflags = Style_Default;
+ cflags |= active ? Style_Enabled : Style_On;
+
+ drawPrimitive( PE_CheckMark, p, ceData, elementFlags, TQRect( cx + itemFrame, y + itemFrame, w - itemFrame*2, h - itemFrame*2), cg, cflags );
+ }
+ break;
default:
{
@@ -1345,8 +1383,7 @@ void HighColorStyle::drawControl( TQ_ControlElement element,
// Do we have an icon and are checked at the same time?
// Then draw a "pressed" background behind the icon
if ( checkable && !active && mi->isChecked() )
- qDrawShadePanel( p, cr.x(), cr.y(), cr.width(), cr.height(),
- cg, true, 1, &cg.brush(TQColorGroup::Midlight) );
+ drawPrimitive(PE_MenuItemIndicatorIconFrame, p, ceData, elementFlags, TQRect(x, y, checkcol, h), cg, flags);
// Draw the icon
TQPixmap pixmap = mi->iconSet()->pixmap( TQIconSet::Small, mode );
TQRect pmr( 0, 0, pixmap.width(), pixmap.height() );
@@ -1356,20 +1393,8 @@ void HighColorStyle::drawControl( TQ_ControlElement element,
// Are we checked? (This time without an icon)
else if ( checkable && mi->isChecked() ) {
- int cx = reverse ? x+w - checkcol : x;
-
- // We only have to draw the background if the menu item is inactive -
- // if it's active the "pressed" background is already drawn
- if ( ! active )
- qDrawShadePanel( p, cx, y, checkcol, h, cg, true, 1,
- &cg.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, cflags );
+ drawPrimitive(PE_MenuItemIndicatorFrame, p, ceData, elementFlags, TQRect(x, y, checkcol, h), cg, flags);
+ drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, TQRect(x, y, checkcol, h), cg, flags);
}
// Time to draw the menu item label...