|
|
|
@ -1015,9 +1015,11 @@ void PhaseStyle::drawPrimitive(TQ_PrimitiveElement element,
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case PE_MenuItemIndicatorCheck: {
|
|
|
|
|
int checkwidth = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, option, NULL, NULL);
|
|
|
|
|
int cx = reverse_ ? x+w - checkwidth : x;
|
|
|
|
|
drawPrimitive(PE_CheckMark, painter, ceData, elementFlags,
|
|
|
|
|
TQRect(x + ITEMFRAME, y + ITEMFRAME,
|
|
|
|
|
w - ITEMFRAME*2, h - ITEMFRAME*2),
|
|
|
|
|
TQRect(cx + ITEMFRAME, y + ITEMFRAME,
|
|
|
|
|
checkwidth - ITEMFRAME*2, h - ITEMFRAME*2),
|
|
|
|
|
group, Style_Default |
|
|
|
|
|
(active ? Style_Enabled : Style_On));
|
|
|
|
|
break;
|
|
|
|
@ -1415,8 +1417,7 @@ void PhaseStyle::drawControl(TQ_ControlElement element,
|
|
|
|
|
|
|
|
|
|
// draw check
|
|
|
|
|
if (mi->isChecked()) {
|
|
|
|
|
int cx = reverse_ ? x+w - checkwidth : x;
|
|
|
|
|
drawPrimitive(PE_MenuItemIndicatorCheck, painter, ceData, elementFlags, TQRect(cx, y, checkwidth, h), group, flags);
|
|
|
|
|
drawPrimitive(PE_MenuItemIndicatorCheck, painter, ceData, elementFlags, TQRect(x, y, checkwidth, h), group, flags, option);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// draw text
|
|
|
|
@ -2024,6 +2025,12 @@ int PhaseStyle::pixelMetric(PixelMetric metric, TQStyleControlElementData ceData
|
|
|
|
|
case PM_SliderControlThickness:
|
|
|
|
|
return em;
|
|
|
|
|
|
|
|
|
|
case PM_MenuIndicatorFrameHBorder:
|
|
|
|
|
case PM_MenuIndicatorFrameVBorder:
|
|
|
|
|
case PM_MenuIconIndicatorFrameHBorder:
|
|
|
|
|
case PM_MenuIconIndicatorFrameVBorder:
|
|
|
|
|
return ITEMFRAME;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
return KStyle::pixelMetric(metric, ceData, elementFlags, widget);
|
|
|
|
|
}
|
|
|
|
@ -2257,6 +2264,29 @@ bool PhaseStyle::flatToolbar(const TQToolBar *toolbar) const
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int PhaseStyle::styleHint(StyleHint sh, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQStyleOption &opt, TQStyleHintReturn *returnData, const TQWidget *w) const
|
|
|
|
|
{
|
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
|
|
switch (sh) {
|
|
|
|
|
case SH_MenuIndicatorColumnWidth:
|
|
|
|
|
{
|
|
|
|
|
int checkwidth = opt.maxIconWidth();
|
|
|
|
|
bool checkable = (elementFlags & CEF_IsCheckable);
|
|
|
|
|
|
|
|
|
|
if (checkable) checkwidth = TQMAX(checkwidth, 20);
|
|
|
|
|
|
|
|
|
|
ret = checkwidth;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ret = TQCommonStyle::styleHint(sh, ceData, elementFlags, opt, returnData, w);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// eventFilter()
|
|
|
|
|
// -------------
|
|
|
|
|