summaryrefslogtreecommitdiffstats
path: root/style/lipstik.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'style/lipstik.cpp')
-rw-r--r--style/lipstik.cpp31
1 files changed, 25 insertions, 6 deletions
diff --git a/style/lipstik.cpp b/style/lipstik.cpp
index edbeb2a..f10f93f 100644
--- a/style/lipstik.cpp
+++ b/style/lipstik.cpp
@@ -2386,14 +2386,16 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
case PE_MenuItemIndicatorIconFrame: {
int x, y, w, h;
r.rect( &x, &y, &w, &h );
- TQRect cr = visualRect( TQRect( x + 2, y + 2, w - 1, h - 4 ), r );
+ int checkcol = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, opt, NULL, NULL);
+ TQRect cr = visualRect( TQRect( x + 2, y + 2, checkcol - 1, h - 4 ), 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 + 2, y + 2, w - 1, h - 4 ), r );
+ int checkcol = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, opt, NULL, NULL);
+ TQRect cr = visualRect( TQRect( x + 2, y + 2, checkcol - 1, h - 4 ), r );
SFlags cflags = Style_On;
if (enabled)
cflags |= Style_Enabled;
@@ -2991,10 +2993,10 @@ void LipstikStyle::drawControl(ControlElement element,
// Then dont draw the icon, only the check. I believe its more
// apparent its checked, compared to an almost invisible pressed background only.
if ( checkable && /*!active &&*/ mi->isChecked() ) {
- drawPrimitive(PE_MenuItemIndicatorIconFrame, p, ceData, elementFlags, TQRect(r.x(), r.y(), checkcol, r.height()), cg, flags);
+ drawPrimitive(PE_MenuItemIndicatorIconFrame, p, ceData, elementFlags, TQRect(r.x(), r.y(), checkcol, r.height()), cg, flags, opt);
// Draw the checkmark
- drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, TQRect(r.x(), r.y(), checkcol, r.height()), cg, flags);
+ drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, TQRect(r.x(), r.y(), checkcol, r.height()), cg, flags, opt);
}
}
@@ -3004,10 +3006,10 @@ void LipstikStyle::drawControl(ControlElement element,
// 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 )
- drawPrimitive(PE_MenuItemIndicatorIconFrame, p, ceData, elementFlags, TQRect(r.x(), r.y(), checkcol, r.height()), cg, flags);
+ drawPrimitive(PE_MenuItemIndicatorIconFrame, p, ceData, elementFlags, TQRect(r.x(), r.y(), checkcol, r.height()), cg, flags, opt);
// Draw the checkmark
- drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, TQRect(r.x(), r.y(), checkcol, r.height()), cg, flags);
+ drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, TQRect(r.x(), r.y(), checkcol, r.height()), cg, flags, opt);
}
// Time to draw the menu item label...
@@ -3858,6 +3860,12 @@ int LipstikStyle::pixelMetric(PixelMetric m, TQStyleControlElementData ceData, C
return 1;
}
+ case PM_MenuIndicatorFrameHBorder:
+ case PM_MenuIndicatorFrameVBorder:
+ case PM_MenuIconIndicatorFrameHBorder:
+ case PM_MenuIconIndicatorFrameVBorder:
+ return 2;
+
default:
return KStyle::pixelMetric(m, ceData, elementFlags, widget);
}
@@ -3963,6 +3971,17 @@ int LipstikStyle::styleHint( StyleHint stylehint,
case SH_PopupMenu_SubMenuPopupDelay:
return 96; // Motif-like delay...
+ case SH_MenuIndicatorColumnWidth:
+ {
+ int checkcol = option.maxIconWidth();
+ bool checkable = (elementFlags & CEF_IsCheckable);
+
+ if ( checkable )
+ checkcol = TQMAX( checkcol, 20 );
+
+ return checkcol;
+ }
+
default:
return KStyle::styleHint(stylehint, ceData, elementFlags, option, returnData, widget);
}