|
|
|
@ -278,16 +278,22 @@ LipstikStyle::~LipstikStyle()
|
|
|
|
|
delete verticalLine;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LipstikStyle::polish(TQApplication* app)
|
|
|
|
|
void LipstikStyle::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"))
|
|
|
|
|
kickerMode = true;
|
|
|
|
|
else if (!qstrcmp(app->argv()[0], "korn"))
|
|
|
|
|
kornMode = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LipstikStyle::polish(TQWidget* widget)
|
|
|
|
|
void LipstikStyle::polish(TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr)
|
|
|
|
|
{
|
|
|
|
|
if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) {
|
|
|
|
|
TQWidget *widget = reinterpret_cast<TQWidget*>(ptr);
|
|
|
|
|
|
|
|
|
|
if( !strcmp(widget->name(), "__khtml") ) { // is it a khtml widget...?
|
|
|
|
|
khtmlWidgets[widget] = true;
|
|
|
|
|
connect(widget, TQT_SIGNAL(destroyed(TQObject*)), this, TQT_SLOT(khtmlWidgetDestroyed(TQObject*)));
|
|
|
|
@ -301,25 +307,25 @@ void LipstikStyle::polish(TQWidget* widget)
|
|
|
|
|
::tqqt_cast<TQToolButton*>(widget)
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
} else if (::tqqt_cast<TQTabBar*>(widget)) {
|
|
|
|
|
widget->setMouseTracking(true);
|
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
} else if (::tqqt_cast<TQPopupMenu*>(widget)) {
|
|
|
|
|
widget->setBackgroundMode( NoBackground );
|
|
|
|
|
} else if(::tqqt_cast<TQScrollBar*>(widget)) {
|
|
|
|
|
widget->setMouseTracking(true);
|
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
} else if (widget->inherits(TQSPLITTERHANDLE_OBJECT_NAME_STRING) || widget->inherits(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) ) {
|
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
} else if (::tqqt_cast<TQLineEdit*>(widget)) {
|
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
} else if ( !qstrcmp(widget->name(), "kde toolbar widget") ) {
|
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( _animateProgressBar && ::tqqt_cast<TQProgressBar*>(widget) ) {
|
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
progAnimWidgets[widget] = 0;
|
|
|
|
|
connect(widget, TQT_SIGNAL(destroyed(TQObject*)), this, TQT_SLOT(progressBarDestroyed(TQObject*)));
|
|
|
|
|
if (!animationTimer->isActive())
|
|
|
|
@ -335,12 +341,16 @@ void LipstikStyle::polish(TQWidget* widget)
|
|
|
|
|
kPalette.setColor( TQColorGroup::Midlight,kPalette.active().background() );
|
|
|
|
|
TQApplication::setPalette( kPalette );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
KStyle::polish(widget);
|
|
|
|
|
KStyle::polish(ceData, elementFlags, ptr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LipstikStyle::unPolish(TQWidget* widget)
|
|
|
|
|
void LipstikStyle::unPolish(TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr)
|
|
|
|
|
{
|
|
|
|
|
if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) {
|
|
|
|
|
TQWidget *widget = reinterpret_cast<TQWidget*>(ptr);
|
|
|
|
|
|
|
|
|
|
if( !strcmp(widget->name(), "__khtml") ) { // is it a khtml widget...?
|
|
|
|
|
khtmlWidgets.remove(widget);
|
|
|
|
|
}
|
|
|
|
@ -352,27 +362,28 @@ void LipstikStyle::unPolish(TQWidget* widget)
|
|
|
|
|
::tqqt_cast<TQToolButton*>(widget) || ::tqqt_cast<TQLineEdit*>(widget) ||
|
|
|
|
|
widget->inherits(TQSPLITTERHANDLE_OBJECT_NAME_STRING) )
|
|
|
|
|
{
|
|
|
|
|
widget->removeEventFilter(this);
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
}
|
|
|
|
|
else if (::tqqt_cast<TQTabBar*>(widget)) {
|
|
|
|
|
widget->setMouseTracking(false);
|
|
|
|
|
widget->removeEventFilter(this);
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
} else if (::tqqt_cast<TQScrollBar*>(widget)) {
|
|
|
|
|
widget->setMouseTracking(false);
|
|
|
|
|
widget->removeEventFilter(this);
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
} else if (::tqqt_cast<TQPopupMenu*>(widget)) {
|
|
|
|
|
widget->setBackgroundMode( PaletteBackground );
|
|
|
|
|
} else if ( !qstrcmp(widget->name(), "kde toolbar widget") ) {
|
|
|
|
|
widget->removeEventFilter(this);
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( ::tqqt_cast<TQProgressBar*>(widget) ) {
|
|
|
|
|
progAnimWidgets.remove(widget);
|
|
|
|
|
} else if( widget->inherits("KonqFrameStatusBar") ) {
|
|
|
|
|
widget->removeEventFilter(this);
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
KStyle::unPolish(widget);
|
|
|
|
|
KStyle::unPolish(ceData, elementFlags, ptr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LipstikStyle::khtmlWidgetDestroyed(TQObject* obj)
|
|
|
|
@ -3958,11 +3969,14 @@ int LipstikStyle::styleHint( StyleHint stylehint,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool LipstikStyle::eventFilter(TQObject *obj, TQEvent *ev)
|
|
|
|
|
bool LipstikStyle::objectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQEvent *ev )
|
|
|
|
|
{
|
|
|
|
|
if (KStyle::eventFilter(obj, ev) )
|
|
|
|
|
if (KStyle::objectEventHandler(ceData, elementFlags, source, ev) )
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
if (ceData.widgetObjectTypes.contains(TQOBJECT_OBJECT_NAME_STRING)) {
|
|
|
|
|
TQObject* obj = reinterpret_cast<TQObject*>(source);
|
|
|
|
|
|
|
|
|
|
if (!obj->isWidgetType() ) return false;
|
|
|
|
|
|
|
|
|
|
// focus highlight
|
|
|
|
@ -4057,7 +4071,8 @@ bool LipstikStyle::eventFilter(TQObject *obj, TQEvent *ev)
|
|
|
|
|
TQWidget* lb = TQT_TQWIDGET(obj);
|
|
|
|
|
if (lb->backgroundMode() == TQt::PaletteButton)
|
|
|
|
|
lb->setBackgroundMode(TQt::PaletteBackground);
|
|
|
|
|
lb->removeEventFilter(this);
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, source, this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|