|
|
|
@ -331,18 +331,25 @@ KeramikStyle::~KeramikStyle()
|
|
|
|
|
KeramikDbCleanup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KeramikStyle::polish(TQApplication* app)
|
|
|
|
|
void KeramikStyle::applicationPolish(TQStyleControlElementData ceData, ControlElementFlags, void *ptr)
|
|
|
|
|
{
|
|
|
|
|
if (!qstrcmp(app->argv()[0], "kicker"))
|
|
|
|
|
if (ceData.widgetObjectTypes.contains(TQAPPLICATION_OBJECT_NAME_STRING)) {
|
|
|
|
|
TQApplication *app = reinterpret_cast<TQApplication*>(ptr);
|
|
|
|
|
if (!qstrcmp(app->argv()[0], "kicker")) {
|
|
|
|
|
kickerMode = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KeramikStyle::polish(TQWidget* widget)
|
|
|
|
|
void KeramikStyle::polish(TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr)
|
|
|
|
|
{
|
|
|
|
|
if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) {
|
|
|
|
|
TQWidget *widget = reinterpret_cast<TQWidget*>(ptr);
|
|
|
|
|
|
|
|
|
|
// Put in order of highest occurrence to maximise hit rate
|
|
|
|
|
if ( widget->inherits( TQPUSHBUTTON_OBJECT_NAME_STRING ) || widget->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) || widget->inherits(TQTOOLBUTTON_OBJECT_NAME_STRING) )
|
|
|
|
|
{
|
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
if ( widget->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) )
|
|
|
|
|
widget->setBackgroundMode( NoBackground );
|
|
|
|
|
}
|
|
|
|
@ -355,37 +362,41 @@ void KeramikStyle::polish(TQWidget* widget)
|
|
|
|
|
TQListBox* listbox = (TQListBox*) widget;
|
|
|
|
|
listbox->setLineWidth( 4 );
|
|
|
|
|
listbox->setBackgroundMode( NoBackground );
|
|
|
|
|
widget->installEventFilter( this );
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
|
|
|
|
|
} else if (widget->inherits("QToolBarExtensionWidget")) {
|
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
//widget->setBackgroundMode( NoBackground );
|
|
|
|
|
}
|
|
|
|
|
else if ( !qstrcmp( widget->name(), kdeToolbarWidget ) ) {
|
|
|
|
|
widget->setBackgroundMode( NoBackground );
|
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (animateProgressBar && ::tqqt_cast<TQProgressBar*>(widget))
|
|
|
|
|
{
|
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
progAnimWidgets[static_cast<TQProgressBar*>(widget)] = 0;
|
|
|
|
|
connect(widget, TQT_SIGNAL(destroyed(TQObject*)), this, TQT_SLOT(progressBarDestroyed(TQObject*)));
|
|
|
|
|
if (!animationTimer->isActive())
|
|
|
|
|
animationTimer->start( 50, false );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
KStyle::polish(widget);
|
|
|
|
|
KStyle::polish(ceData, elementFlags, ptr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KeramikStyle::unPolish(TQWidget* widget)
|
|
|
|
|
void KeramikStyle::unPolish(TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr)
|
|
|
|
|
{
|
|
|
|
|
if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) {
|
|
|
|
|
TQWidget *widget = reinterpret_cast<TQWidget*>(ptr);
|
|
|
|
|
|
|
|
|
|
//### TODO: This needs major cleanup (and so does polish() )
|
|
|
|
|
if ( widget->inherits( TQPUSHBUTTON_OBJECT_NAME_STRING ) || widget->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) )
|
|
|
|
|
{
|
|
|
|
|
if ( widget->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) )
|
|
|
|
|
widget->setBackgroundMode( PaletteButton );
|
|
|
|
|
widget->removeEventFilter(this);
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
}
|
|
|
|
|
else if ( widget->inherits( TQMENUBAR_OBJECT_NAME_STRING ) || widget->inherits( TQPOPUPMENU_OBJECT_NAME_STRING ) )
|
|
|
|
|
widget->setBackgroundMode( PaletteBackground );
|
|
|
|
@ -396,21 +407,22 @@ void KeramikStyle::unPolish(TQWidget* widget)
|
|
|
|
|
TQListBox* listbox = (TQListBox*) widget;
|
|
|
|
|
listbox->setLineWidth( 1 );
|
|
|
|
|
listbox->setBackgroundMode( PaletteBackground );
|
|
|
|
|
widget->removeEventFilter( this );
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
widget->clearMask();
|
|
|
|
|
} else if (widget->inherits("QToolBarExtensionWidget")) {
|
|
|
|
|
widget->removeEventFilter(this);
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
}
|
|
|
|
|
else if ( !qstrcmp( widget->name(), kdeToolbarWidget ) ) {
|
|
|
|
|
widget->setBackgroundMode( PaletteBackground );
|
|
|
|
|
widget->removeEventFilter(this);
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
}
|
|
|
|
|
else if ( ::tqqt_cast<TQProgressBar*>(widget) )
|
|
|
|
|
{
|
|
|
|
|
progAnimWidgets.remove(static_cast<TQProgressBar*>(widget));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
KStyle::unPolish(widget);
|
|
|
|
|
KStyle::unPolish(ceData, elementFlags, ptr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KeramikStyle::progressBarDestroyed(TQObject* obj)
|
|
|
|
@ -2759,11 +2771,14 @@ TQRect KeramikStyle::querySubControlMetrics( TQ_ComplexControl control,
|
|
|
|
|
#undef KeyRelease
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
bool KeramikStyle::eventFilter( TQObject* object, TQEvent* event )
|
|
|
|
|
bool KeramikStyle::objectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQEvent *event )
|
|
|
|
|
{
|
|
|
|
|
if (KStyle::eventFilter( object, event ))
|
|
|
|
|
if (KStyle::objectEventHandler( ceData, elementFlags, source, event ))
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
if (ceData.widgetObjectTypes.contains(TQOBJECT_OBJECT_NAME_STRING)) {
|
|
|
|
|
TQObject* object = reinterpret_cast<TQObject*>(source);
|
|
|
|
|
|
|
|
|
|
if ( !object->isWidgetType() ) return false;
|
|
|
|
|
|
|
|
|
|
//Clear hover highlight when needed
|
|
|
|
@ -2866,8 +2881,8 @@ bool KeramikStyle::eventFilter( TQObject* object, TQEvent* event )
|
|
|
|
|
*/
|
|
|
|
|
case TQEvent::Show:
|
|
|
|
|
//Prioritize ourselves to see the mouse events first
|
|
|
|
|
object->removeEventFilter(this);
|
|
|
|
|
object->installEventFilter(this);
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, source, this);
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, source, this);
|
|
|
|
|
firstComboPopupRelease = true;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
@ -2950,6 +2965,8 @@ bool KeramikStyle::eventFilter( TQObject* object, TQEvent* event )
|
|
|
|
|
animationTimer->start( 50, false );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|