summaryrefslogtreecommitdiffstats
path: root/style/qtcurve.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-10-31 01:09:09 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-10-31 01:09:09 -0500
commit30a3926517a452c8a1ca0c1ba00cdd46ed063e8d (patch)
tree2318b2812821b1bdf54c674e089417a7fa730058 /style/qtcurve.cpp
parent88437440b51e1c34e2bb81c85cf23dabdd9daced (diff)
downloadtde-style-qtcurve-30a3926517a452c8a1ca0c1ba00cdd46ed063e8d.tar.gz
tde-style-qtcurve-30a3926517a452c8a1ca0c1ba00cdd46ed063e8d.zip
Update for style API
Diffstat (limited to 'style/qtcurve.cpp')
-rw-r--r--style/qtcurve.cpp41
1 files changed, 33 insertions, 8 deletions
diff --git a/style/qtcurve.cpp b/style/qtcurve.cpp
index 5e9dd1e..701c877 100644
--- a/style/qtcurve.cpp
+++ b/style/qtcurve.cpp
@@ -4335,6 +4335,37 @@ void QtCurveStyle::drawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, TQStyleCo
p->restore();
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);
+
+ drawLightBevel((flags & Style_Active)&&(flags & Style_Enabled)
+ ? itsHighlightCols[ORIGINAL_SHADE]
+ : cg.background(), p, TQRect(cr.x()+1, cr.y()+2, cr.width()-2, cr.height()-4),
+ cg, flags|Style_Sunken|Style_Horizontal, ROUNDED_ALL,
+ getFill(flags|Style_Sunken|Style_Enabled, itsBackgroundCols),
+ itsBackgroundCols, true, false, WIDGET_NO_ETCH_BTN);
+ break;
+ }
+ case PE_MenuItemIndicatorCheck:
+ {
+ int x, y, w, h;
+ r.rect( &x, &y, &w, &h );
+ TQRect cr=visualRect(TQRect(x, y, w, h), r);
+
+ drawPrimitive(PE_CheckMark, p, ceData, elementFlags, cr, cg,
+ (flags &(Style_Enabled|(opts.useHighlightForMenu ? Style_Active : 0)))| Style_On|MENU_ITEM);
+ break;
+ }
+
default:
BASE_STYLE::drawPrimitive(pe, p, ceData, elementFlags, r, cg, flags, data);
}
@@ -5010,12 +5041,7 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, TQStyleCont
// Do we have an icon and are checked at the same time?
// Then draw a "pressed" background behind the icon
if((elementFlags & CEF_IsCheckable) && mi->isChecked())
- drawLightBevel((flags & Style_Active)&&(flags & Style_Enabled)
- ? itsHighlightCols[ORIGINAL_SHADE]
- : cg.background(), p, TQRect(cr.x()+1, cr.y()+2, cr.width()-2, cr.height()-4),
- cg, flags|Style_Sunken|Style_Horizontal, ROUNDED_ALL,
- getFill(flags|Style_Sunken|Style_Enabled, itsBackgroundCols),
- itsBackgroundCols, true, false, WIDGET_NO_ETCH_BTN);
+ drawPrimitive(PE_MenuItemIndicatorIconFrame, p, ceData, elementFlags, TQRect(x, y, maxpmw, h), cg, flags);
// Draw the icon
TQPixmap pixmap(mi->iconSet()->pixmap(TQIconSet::Small, mode));
@@ -5025,8 +5051,7 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, TQStyleCont
p->drawPixmap(pmr.topLeft(), pixmap);
}
else if((elementFlags & CEF_IsCheckable) && mi->isChecked())
- drawPrimitive(PE_CheckMark, p, ceData, elementFlags, cr, cg,
- (flags &(Style_Enabled|(opts.useHighlightForMenu ? Style_Active : 0)))| Style_On|MENU_ITEM);
+ drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, TQRect(x, y, maxpmw, h), cg, flags);
TQColor textCol(flags&Style_Enabled
? flags&Style_Active && opts.useHighlightForMenu