Update for style API

pull/1/head
Timothy Pearson 12 years ago
parent 88437440b5
commit 30a3926517

@ -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

Loading…
Cancel
Save