Use proper toolbar extension widget name when detecting widget inheritance

This relates to Bug 1693
pull/16/head
Timothy Pearson 10 years ago
parent 32f50cd6f9
commit 2c1bb83ad6

@ -197,7 +197,7 @@ void HighColorStyle::polish(const TQStyleControlElementData &ceData, ControlElem
installObjectEventHandler(ceData, elementFlags, ptr, this);
} else if (widget->inherits(TQMENUBAR_OBJECT_NAME_STRING) || widget->inherits(TQPOPUPMENU_OBJECT_NAME_STRING)) {
widget->setBackgroundMode(TQWidget::NoBackground);
} else if (type == HighColor && widget->inherits("QToolBarExtensionWidget")) {
} else if (type == HighColor && widget->inherits(TQTOOLBAREXTENSIONWIDGET_OBJECT_NAME_STRING)) {
installObjectEventHandler(ceData, elementFlags, ptr, this);
} else if ( !qstrcmp( widget->name(), kdeToolbarWidget) ) {
widget->setBackgroundMode( NoBackground ); // We paint the whole background.
@ -222,7 +222,7 @@ void HighColorStyle::unPolish(const TQStyleControlElementData &ceData, ControlEl
}
else if (widget->inherits(TQMENUBAR_OBJECT_NAME_STRING) || widget->inherits(TQPOPUPMENU_OBJECT_NAME_STRING)) {
widget->setBackgroundMode(TQWidget::PaletteBackground);
} else if (type == HighColor && widget->inherits("QToolBarExtensionWidget")) {
} else if (type == HighColor && widget->inherits(TQTOOLBAREXTENSIONWIDGET_OBJECT_NAME_STRING)) {
removeObjectEventHandler(ceData, elementFlags, ptr, this);
} else if ( !qstrcmp( widget->name(), kdeToolbarWidget) ) {
removeObjectEventHandler(ceData, elementFlags, ptr, this);
@ -1692,7 +1692,7 @@ void HighColorStyle::drawComplexControl( TQ_ComplexControl control,
parent->orientation() == Qt::Vertical,
r.x(), r.y(), pr.width()-2, pr.height()-2);
}
else if (ceData.parentWidgetData.widgetObjectTypes.contains("QToolBarExtensionWidget"))
else if (ceData.parentWidgetData.widgetObjectTypes.contains(TQTOOLBAREXTENSIONWIDGET_OBJECT_NAME_STRING))
{
TQWidget* parent = (TQWidget*)widget->parent();
TQToolBar* toolbar = (TQToolBar*)parent->parent();

@ -360,7 +360,7 @@ void KeramikStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
listbox->setBackgroundMode( NoBackground );
installObjectEventHandler(ceData, elementFlags, ptr, this);
} else if (widget->inherits("QToolBarExtensionWidget")) {
} else if (widget->inherits(TQTOOLBAREXTENSIONWIDGET_OBJECT_NAME_STRING)) {
installObjectEventHandler(ceData, elementFlags, ptr, this);
//widget->setBackgroundMode( NoBackground );
}
@ -405,7 +405,7 @@ void KeramikStyle::unPolish(const TQStyleControlElementData &ceData, ControlElem
listbox->setBackgroundMode( PaletteBackground );
removeObjectEventHandler(ceData, elementFlags, ptr, this);
widget->clearMask();
} else if (widget->inherits("QToolBarExtensionWidget")) {
} else if (widget->inherits(TQTOOLBAREXTENSIONWIDGET_OBJECT_NAME_STRING)) {
removeObjectEventHandler(ceData, elementFlags, ptr, this);
}
else if ( !qstrcmp( widget->name(), kdeToolbarWidget ) ) {
@ -2258,7 +2258,7 @@ void KeramikStyle::drawComplexControl( TQ_ComplexControl control,
case CC_ToolButton: {
bool onToolbar = ceData.parentWidgetData.widgetObjectTypes.contains(TQTOOLBAR_OBJECT_NAME_STRING);
bool onExtender = !onToolbar &&
ceData.parentWidgetData.widgetObjectTypes.contains( "QToolBarExtensionWidget") &&
ceData.parentWidgetData.widgetObjectTypes.contains( TQTOOLBAREXTENSIONWIDGET_OBJECT_NAME_STRING) &&
widget && widget->parentWidget()->parentWidget()->inherits( TQTOOLBAR_OBJECT_NAME_STRING );
bool onControlButtons = false;

Loading…
Cancel
Save