diff options
-rw-r--r-- | styles/dotnet/dotnet.cpp | 52 | ||||
-rw-r--r-- | styles/phase/phasestyle.cpp | 30 |
2 files changed, 56 insertions, 26 deletions
diff --git a/styles/dotnet/dotnet.cpp b/styles/dotnet/dotnet.cpp index 11e68412..9ab1d92d 100644 --- a/styles/dotnet/dotnet.cpp +++ b/styles/dotnet/dotnet.cpp @@ -435,10 +435,11 @@ void dotNETstyle::drawPrimitive(TQ_PrimitiveElement pe, SFlags flags, const TQStyleOption &opt ) const { - bool down = flags & Style_Down; - bool on = flags & Style_On; - bool sunken = flags & Style_Sunken; - bool horiz = flags & Style_Horizontal; + bool down = flags & Style_Down; + bool on = flags & Style_On; + bool sunken = flags & Style_Sunken; + bool horiz = flags & Style_Horizontal; + bool disabled = !(flags & Style_Enabled); int x, x2, y, y2, w, h; r.rect(&x, &y, &w, &h); @@ -691,6 +692,34 @@ void dotNETstyle::drawPrimitive(TQ_PrimitiveElement pe, break; } + case PE_MenuItemIndicatorFrame: { + // Draw nothing + break; + } + case PE_MenuItemIndicatorIconFrame: { + // Draw nothing + break; + } + case PE_MenuItemIndicatorCheck: { + int x, y, w, h; + r.rect( &x, &y, &w, &h ); + + SFlags cflags = Style_Default; + + if (!disabled) + cflags |= Style_Enabled; + else + cflags |= Style_On; + + TQRect rr = TQRect( x + 6, y + 6, 16, h - 6 ); + if (TQApplication::reverseLayout()) + rr = visualRect( rr, r ); + + drawPrimitive(PE_CheckMark, p, ceData, elementFlags, rr, cg, cflags); + + break; + } + case PE_SpinWidgetUp: case PE_SpinWidgetDown: case PE_HeaderArrow: @@ -1361,20 +1390,7 @@ void dotNETstyle::drawControl(TQ_ControlElement element, if (checkable) { if (mi->isChecked()) { - int xp = x; - - SFlags cflags = Style_Default; - - if (!disabled) - cflags |= Style_Enabled; - else - cflags |= Style_On; - - TQRect rr = TQRect( xp + 6, y + 6, 16, h - 6 ); - if (TQApplication::reverseLayout()) - rr = visualRect( rr, r ); - - drawPrimitive(PE_CheckMark, p, ceData, elementFlags, rr, cg, cflags); + drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, TQRect(x, y, checkcol, h), cg, flags); } } diff --git a/styles/phase/phasestyle.cpp b/styles/phase/phasestyle.cpp index 3b73ebfb..f163ef46 100644 --- a/styles/phase/phasestyle.cpp +++ b/styles/phase/phasestyle.cpp @@ -591,6 +591,7 @@ void PhaseStyle::drawPrimitive(TQ_PrimitiveElement element, bool depress = (down || on); bool enabled = flags & Style_Enabled; bool horiz = flags & Style_Horizontal; + bool active = flags & Style_Active; bool mouseover = highlights_ && (flags & Style_MouseOver); int x, y, w, h, x2, y2, n, cx, cy; TQPointArray parray; @@ -1005,6 +1006,23 @@ void PhaseStyle::drawPrimitive(TQ_PrimitiveElement element, painter->drawPixmap(x+w/2-3, y+h/2-3, rarrow); break; + case PE_MenuItemIndicatorFrame: { + // Draw nothing + break; + } + case PE_MenuItemIndicatorIconFrame: { + // Draw nothing + break; + } + case PE_MenuItemIndicatorCheck: { + drawPrimitive(PE_CheckMark, painter, ceData, elementFlags, + TQRect(x + ITEMFRAME, y + ITEMFRAME, + w - ITEMFRAME*2, h - ITEMFRAME*2), + group, Style_Default | + (active ? Style_Enabled : Style_On)); + break; + } + default: KStyle::drawPrimitive(element, painter, ceData, elementFlags, rect, group, flags, option); } @@ -1398,11 +1416,7 @@ void PhaseStyle::drawControl(TQ_ControlElement element, // draw check if (mi->isChecked()) { int cx = reverse_ ? x+w - checkwidth : x; - drawPrimitive(PE_CheckMark, painter, ceData, elementFlags, - TQRect(cx + ITEMFRAME, y + ITEMFRAME, - checkwidth - ITEMFRAME*2, h - ITEMFRAME*2), - group, Style_Default | - (active ? Style_Enabled : Style_On)); + drawPrimitive(PE_MenuItemIndicatorCheck, painter, ceData, elementFlags, TQRect(cx, y, checkwidth, h), group, flags); } // draw text @@ -2249,14 +2263,14 @@ bool PhaseStyle::flatToolbar(const TQToolBar *toolbar) const // Grab events we are interested in. Most of this routine is to handle the // exceptions to the normal styling rules. -bool PhaseStyle::objectEventHandler( TQStyleControlElementData ceData, ControlElementFlags, void* source, TQEvent *event ) +bool PhaseStyle::objectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQEvent *event ) { if (ceData.widgetObjectTypes.contains(TQOBJECT_OBJECT_NAME_STRING)) { TQObject* object = reinterpret_cast<TQObject*>(source); - if (KStyle::eventFilter(object, event)) return true; + if (KStyle::objectEventHandler(ceData, elementFlags, source, event)) return true; if (!object->isWidgetType()) return false; - + bool horiz; int x, y, w, h; TQFrame *frame; |