Update style API

pull/16/head
Timothy Pearson 12 years ago
parent 5df549ce8d
commit 0ee242623b

@ -83,9 +83,9 @@ LightStyleV2::~LightStyleV2()
} }
} }
void LightStyleV2::polishPopupMenu( TQPopupMenu * menu ) void LightStyleV2::polishPopupMenu( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr )
{ {
KStyle::polishPopupMenu(menu); KStyle::polishPopupMenu(ceData, elementFlags, ptr);
} }
static void drawLightBevel(TQPainter *p, const TQRect &r, const TQColorGroup &cg, static void drawLightBevel(TQPainter *p, const TQRect &r, const TQColorGroup &cg,

@ -42,7 +42,7 @@ public:
LightStyleV2(); LightStyleV2();
virtual ~LightStyleV2(); virtual ~LightStyleV2();
void polishPopupMenu( TQPopupMenu * ); void polishPopupMenu( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr );
void drawPrimitive(TQ_PrimitiveElement, TQPainter *, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQRect &, const TQColorGroup &, void drawPrimitive(TQ_PrimitiveElement, TQPainter *, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQRect &, const TQColorGroup &,
SFlags = Style_Default, SFlags = Style_Default,

@ -59,9 +59,9 @@ LightStyleV3::~LightStyleV3()
delete basestyle; delete basestyle;
} }
void LightStyleV3::polishPopupMenu( TQPopupMenu * menu) void LightStyleV3::polishPopupMenu( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr )
{ {
KStyle::polishPopupMenu(menu); KStyle::polishPopupMenu(ceData, elementFlags, ptr);
// empty to satisy pure virtual requirements // empty to satisy pure virtual requirements
} }

@ -46,7 +46,7 @@ public:
LightStyleV3(); LightStyleV3();
virtual ~LightStyleV3(); virtual ~LightStyleV3();
void polishPopupMenu( TQPopupMenu * ); void polishPopupMenu( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr );
void drawPrimitive(TQ_PrimitiveElement, TQPainter *, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQRect &, const TQColorGroup &, void drawPrimitive(TQ_PrimitiveElement, TQPainter *, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQRect &, const TQColorGroup &,
SFlags = Style_Default, SFlags = Style_Default,

@ -302,15 +302,22 @@ void KStyle::unPolish( TQStyleControlElementData ceData, ControlElementFlags ele
// Style changes (should) always re-polish popups. // Style changes (should) always re-polish popups.
void KStyle::polishPopupMenu( TQPopupMenu* p ) void KStyle::polishPopupMenu( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr )
{ {
if (!p->testWState( WState_Polished )) if ( !(ceData.windowState & WState_Polished ) ) {
p->setCheckable(true); widgetActionRequest(ceData, elementFlags, ptr, WAR_SetCheckable);
}
// Install transparency handler if the effect is enabled. if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) {
if ( d->menuHandler && TQWidget* widget = reinterpret_cast<TQWidget*>(ptr);
(strcmp(p->name(), "tear off menu") != 0)) TQPopupMenu *p = dynamic_cast<TQPopupMenu*>(widget);
p->installEventFilter(d->menuHandler); if (p) {
// Install transparency handler if the effect is enabled.
if ( d->menuHandler && (strcmp(p->name(), "tear off menu") != 0)) {
p->installEventFilter(d->menuHandler);
}
}
}
} }

@ -288,7 +288,7 @@ class TDEFX_EXPORT KStyle: public TQCommonStyle
void polish( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); void polish( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void * );
void unPolish( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); void unPolish( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void * );
void polishPopupMenu( TQPopupMenu* ); void polishPopupMenu( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr );
void tqdrawPrimitive( TQ_PrimitiveElement pe, void tqdrawPrimitive( TQ_PrimitiveElement pe,
TQPainter* p, TQPainter* p,

Loading…
Cancel
Save