|
|
|
@ -136,9 +136,12 @@ PhaseStyle::~PhaseStyle()
|
|
|
|
|
// --------
|
|
|
|
|
// Initialize application specific
|
|
|
|
|
|
|
|
|
|
void PhaseStyle::polish(TQApplication* app)
|
|
|
|
|
void PhaseStyle::applicationPolish(TQStyleControlElementData ceData, ControlElementFlags, void *ptr)
|
|
|
|
|
{
|
|
|
|
|
if (ceData.widgetObjectTypes.contains(TQAPPLICATION_OBJECT_NAME_STRING)) {
|
|
|
|
|
TQApplication *app = reinterpret_cast<TQApplication*>(ptr);
|
|
|
|
|
if (!qstrcmp(app->argv()[0], "kicker")) kicker_ = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
@ -146,8 +149,11 @@ void PhaseStyle::polish(TQApplication* app)
|
|
|
|
|
// --------
|
|
|
|
|
// Initialize the appearance of a widget
|
|
|
|
|
|
|
|
|
|
void PhaseStyle::polish(TQWidget *widget)
|
|
|
|
|
void PhaseStyle::polish(TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr)
|
|
|
|
|
{
|
|
|
|
|
if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) {
|
|
|
|
|
TQWidget *widget = reinterpret_cast<TQWidget*>(ptr);
|
|
|
|
|
|
|
|
|
|
if (::tqqt_cast<TQMenuBar*>(widget) ||
|
|
|
|
|
::tqqt_cast<TQPopupMenu*>(widget)) {
|
|
|
|
|
// anti-flicker optimization
|
|
|
|
@ -156,7 +162,7 @@ void PhaseStyle::polish(TQWidget *widget)
|
|
|
|
|
widget->inherits(TQTOOLBAREXTENSION) ||
|
|
|
|
|
(!qstrcmp(widget->name(), KTOOLBARWIDGET))) {
|
|
|
|
|
// needs special handling on paint events
|
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
} else if (highlights_ &&
|
|
|
|
|
(::tqqt_cast<TQPushButton*>(widget) ||
|
|
|
|
|
::tqqt_cast<TQComboBox*>(widget) ||
|
|
|
|
@ -166,14 +172,15 @@ void PhaseStyle::polish(TQWidget *widget)
|
|
|
|
|
::tqqt_cast<TQSlider*>(widget) ||
|
|
|
|
|
widget->inherits(TQSPLITTERHANDLE))) {
|
|
|
|
|
// mouseover highlighting
|
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
} else if (highlights_ && ::tqqt_cast<TQTabBar*>(widget)) {
|
|
|
|
|
// highlighting needing mouse tracking
|
|
|
|
|
widget->setMouseTracking(true);
|
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
KStyle::polish(widget);
|
|
|
|
|
KStyle::polish(ceData, elementFlags, ptr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
@ -204,15 +211,18 @@ void PhaseStyle::polish(TQPalette &pal)
|
|
|
|
|
// ----------
|
|
|
|
|
// Undo the initialization of a widget's appearance
|
|
|
|
|
|
|
|
|
|
void PhaseStyle::unPolish(TQWidget *widget)
|
|
|
|
|
void PhaseStyle::unPolish(TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr)
|
|
|
|
|
{
|
|
|
|
|
if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) {
|
|
|
|
|
TQWidget *widget = reinterpret_cast<TQWidget*>(ptr);
|
|
|
|
|
|
|
|
|
|
if (::tqqt_cast<TQMenuBar*>(widget) ||
|
|
|
|
|
::tqqt_cast<TQPopupMenu*>(widget)) {
|
|
|
|
|
widget->setBackgroundMode(PaletteBackground);
|
|
|
|
|
} else if (::tqqt_cast<TQFrame*>(widget) ||
|
|
|
|
|
widget->inherits(TQTOOLBAREXTENSION) ||
|
|
|
|
|
(!qstrcmp(widget->name(), KTOOLBARWIDGET))) {
|
|
|
|
|
widget->removeEventFilter(this);
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
} else if (highlights_ && // highlighting
|
|
|
|
|
(::tqqt_cast<TQPushButton*>(widget) ||
|
|
|
|
|
::tqqt_cast<TQComboBox*>(widget) ||
|
|
|
|
@ -221,13 +231,14 @@ void PhaseStyle::unPolish(TQWidget *widget)
|
|
|
|
|
::tqqt_cast<TQRadioButton*>(widget) ||
|
|
|
|
|
::tqqt_cast<TQSlider*>(widget) ||
|
|
|
|
|
widget->inherits(TQSPLITTERHANDLE))) {
|
|
|
|
|
widget->removeEventFilter(this);
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
} else if (highlights_ && ::tqqt_cast<TQTabBar*>(widget)) {
|
|
|
|
|
widget->setMouseTracking(false);
|
|
|
|
|
widget->removeEventFilter(this);
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
KStyle::unPolish(widget);
|
|
|
|
|
KStyle::unPolish(ceData, elementFlags, ptr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
@ -2251,8 +2262,11 @@ 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::eventFilter(TQObject *object, TQEvent *event)
|
|
|
|
|
bool PhaseStyle::objectEventHandler( TQStyleControlElementData ceData, ControlElementFlags, 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 (!object->isWidgetType()) return false;
|
|
|
|
|
|
|
|
|
@ -2408,6 +2422,7 @@ bool PhaseStyle::eventFilter(TQObject *object, TQEvent *event)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|