summaryrefslogtreecommitdiffstats
path: root/src/styles/qsgistyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/styles/qsgistyle.cpp')
-rw-r--r--src/styles/qsgistyle.cpp36
1 files changed, 23 insertions, 13 deletions
diff --git a/src/styles/qsgistyle.cpp b/src/styles/qsgistyle.cpp
index a66fcda..b65100c 100644
--- a/src/styles/qsgistyle.cpp
+++ b/src/styles/qsgistyle.cpp
@@ -567,6 +567,9 @@ void QSGIStyle::drawPrimitive( PrimitiveElement pe,
const int defaultFrameWidth = pixelMetric( PM_DefaultFrameWidth, ceData, elementFlags );
bool hot = ( flags & Style_MouseOver ) && ( flags & Style_Enabled );
+ bool dis = ! (flags & Style_Enabled);
+ bool act = flags & Style_Active;
+
switch ( pe ) {
case PE_ButtonCommand:
{
@@ -878,6 +881,25 @@ void QSGIStyle::drawPrimitive( PrimitiveElement pe,
}
break;
+ case PE_MenuItemIndicatorCheck:
+ {
+ int x, y, w, h;
+ r.rect(&x, &y, &w, &h);
+
+ SFlags cflags = Style_Default;
+ if (! dis)
+ cflags |= Style_Enabled;
+ if (act)
+ cflags |= Style_On;
+
+ QRect er( x+sgiItemFrame+1, y+sgiItemFrame+3, pixelMetric(PM_IndicatorWidth, ceData, elementFlags), pixelMetric(PM_IndicatorHeight, ceData, elementFlags) );
+ er.addCoords( 1, 1, -1, -1 );
+ drawPrimitive( PE_ButtonBevel, p, ceData, elementFlags, er, cg, cflags, opt );
+ er.addCoords( 0, 1, 1, 1 );
+ drawPrimitive( PE_CheckMark, p, ceData, elementFlags, er, cg, cflags | Style_On, opt );
+ }
+ break;
+
default:
QMotifStyle::drawPrimitive( pe, p, ceData, elementFlags, r, cg, flags, opt );
break;
@@ -1018,20 +1040,8 @@ void QSGIStyle::drawControl( ControlElement element,
p->drawPixmap( pmr.topLeft(), pixmap );
} else {
if ( checkable ) {
- SFlags cflags = Style_Default;
- if (! dis)
- cflags |= Style_Enabled;
- if (act)
- cflags |= Style_On;
-
if ( mi->isChecked() ) {
- QRect er( x+sgiItemFrame+1, y+sgiItemFrame+3,
- pixelMetric(PM_IndicatorWidth, ceData, elementFlags),
- pixelMetric(PM_IndicatorHeight, ceData, elementFlags) );
- er.addCoords( 1, 1, -1, -1 );
- drawPrimitive( PE_ButtonBevel, p, ceData, elementFlags, er, cg, cflags, opt );
- er.addCoords( 0, 1, 1, 1 );
- drawPrimitive( PE_CheckMark, p, ceData, elementFlags, er, cg, cflags | Style_On, opt );
+ drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, QRect(x, y, w, h), cg, flags);
}
}
}