|
|
|
@ -329,7 +329,7 @@ KeramikStyle::~KeramikStyle()
|
|
|
|
|
|
|
|
|
|
void KeramikStyle::applicationPolish(const TQStyleControlElementData &ceData, ControlElementFlags, void *ptr)
|
|
|
|
|
{
|
|
|
|
|
if (ceData.widgetObjectTypes.contains(TQAPPLICATION_OBJECT_NAME_STRING)) {
|
|
|
|
|
if (ceData.widgetObjectTypes.contains("TQApplication")) {
|
|
|
|
|
TQApplication *app = reinterpret_cast<TQApplication*>(ptr);
|
|
|
|
|
if (!qstrcmp(app->argv()[0], "kicker")) {
|
|
|
|
|
kickerMode = true;
|
|
|
|
@ -339,28 +339,28 @@ void KeramikStyle::applicationPolish(const TQStyleControlElementData &ceData, Co
|
|
|
|
|
|
|
|
|
|
void KeramikStyle::polish(const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr)
|
|
|
|
|
{
|
|
|
|
|
if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) {
|
|
|
|
|
if (ceData.widgetObjectTypes.contains("TQWidget")) {
|
|
|
|
|
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) )
|
|
|
|
|
if ( widget->inherits( "TQPushButton" ) || widget->inherits( "TQComboBox" ) || widget->inherits("TQToolButton") )
|
|
|
|
|
{
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
if ( widget->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) )
|
|
|
|
|
if ( widget->inherits( "TQComboBox" ) )
|
|
|
|
|
widget->setBackgroundMode( NoBackground );
|
|
|
|
|
}
|
|
|
|
|
else if ( widget->inherits( TQMENUBAR_OBJECT_NAME_STRING ) || widget->inherits( TQPOPUPMENU_OBJECT_NAME_STRING ) )
|
|
|
|
|
else if ( widget->inherits( "TQMenuBar" ) || widget->inherits( "TQPopupMenu" ) )
|
|
|
|
|
widget->setBackgroundMode( NoBackground );
|
|
|
|
|
|
|
|
|
|
else if ( widget->parentWidget() &&
|
|
|
|
|
( ( widget->inherits( TQLISTBOX_OBJECT_NAME_STRING ) && widget->parentWidget()->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) ) ||
|
|
|
|
|
( ( widget->inherits( "TQListBox" ) && widget->parentWidget()->inherits( "TQComboBox" ) ) ||
|
|
|
|
|
widget->inherits( "TDECompletionBox" ) ) ) {
|
|
|
|
|
TQListBox* listbox = (TQListBox*) widget;
|
|
|
|
|
listbox->setLineWidth( 4 );
|
|
|
|
|
listbox->setBackgroundMode( NoBackground );
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
|
|
|
|
|
} else if (widget->inherits(TQTOOLBAREXTENSIONWIDGET_OBJECT_NAME_STRING)) {
|
|
|
|
|
} else if (widget->inherits("TQToolBarExtensionWidget")) {
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
//widget->setBackgroundMode( NoBackground );
|
|
|
|
|
}
|
|
|
|
@ -384,28 +384,28 @@ void KeramikStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
|
|
|
|
|
|
|
|
|
|
void KeramikStyle::unPolish(const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr)
|
|
|
|
|
{
|
|
|
|
|
if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) {
|
|
|
|
|
if (ceData.widgetObjectTypes.contains("TQWidget")) {
|
|
|
|
|
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( "TQPushButton" ) || widget->inherits( "TQComboBox" ) )
|
|
|
|
|
{
|
|
|
|
|
if ( widget->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) )
|
|
|
|
|
if ( widget->inherits( "TQComboBox" ) )
|
|
|
|
|
widget->setBackgroundMode( PaletteButton );
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
}
|
|
|
|
|
else if ( widget->inherits( TQMENUBAR_OBJECT_NAME_STRING ) || widget->inherits( TQPOPUPMENU_OBJECT_NAME_STRING ) )
|
|
|
|
|
else if ( widget->inherits( "TQMenuBar" ) || widget->inherits( "TQPopupMenu" ) )
|
|
|
|
|
widget->setBackgroundMode( PaletteBackground );
|
|
|
|
|
|
|
|
|
|
else if ( widget->parentWidget() &&
|
|
|
|
|
( ( widget->inherits( TQLISTBOX_OBJECT_NAME_STRING ) && widget->parentWidget()->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) ) ||
|
|
|
|
|
( ( widget->inherits( "TQListBox" ) && widget->parentWidget()->inherits( "TQComboBox" ) ) ||
|
|
|
|
|
widget->inherits( "TDECompletionBox" ) ) ) {
|
|
|
|
|
TQListBox* listbox = (TQListBox*) widget;
|
|
|
|
|
listbox->setLineWidth( 1 );
|
|
|
|
|
listbox->setBackgroundMode( PaletteBackground );
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
widget->clearMask();
|
|
|
|
|
} else if (widget->inherits(TQTOOLBAREXTENSIONWIDGET_OBJECT_NAME_STRING)) {
|
|
|
|
|
} else if (widget->inherits("TQToolBarExtensionWidget")) {
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
}
|
|
|
|
|
else if ( !qstrcmp( widget->name(), kdeToolbarWidget ) ) {
|
|
|
|
@ -1283,7 +1283,7 @@ void KeramikStyle::drawTDEStylePrimitive( TDEStylePrimitive kpe,
|
|
|
|
|
|
|
|
|
|
TQToolBar* parent = 0;
|
|
|
|
|
|
|
|
|
|
if (widget && widget->parent() && widget->parent()->inherits(TQTOOLBAR_OBJECT_NAME_STRING))
|
|
|
|
|
if (widget && widget->parent() && widget->parent()->inherits("TQToolBar"))
|
|
|
|
|
parent = static_cast<TQToolBar*>(TQT_TQWIDGET(widget->parent()));
|
|
|
|
|
|
|
|
|
|
renderToolbarEntryBackground(p, parent, r, cg, (flags & Style_Horizontal));
|
|
|
|
@ -1414,7 +1414,7 @@ void KeramikStyle::drawControl( TQ_ControlElement element,
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (ceData.parentWidgetData.widgetObjectTypes.contains(TQTOOLBAR_OBJECT_NAME_STRING))
|
|
|
|
|
if (ceData.parentWidgetData.widgetObjectTypes.contains("TQToolBar"))
|
|
|
|
|
toolbarBlendWidget = widget;
|
|
|
|
|
|
|
|
|
|
drawPrimitive( PE_ButtonCommand, p, ceData, elementFlags, r, cg, flags );
|
|
|
|
@ -1520,7 +1520,7 @@ void KeramikStyle::drawControl( TQ_ControlElement element,
|
|
|
|
|
|
|
|
|
|
case CE_ToolButtonLabel:
|
|
|
|
|
{
|
|
|
|
|
bool onToolbar = ceData.parentWidgetData.widgetObjectTypes.contains( TQTOOLBAR_OBJECT_NAME_STRING );
|
|
|
|
|
bool onToolbar = ceData.parentWidgetData.widgetObjectTypes.contains( "TQToolBar" );
|
|
|
|
|
TQRect nr = r;
|
|
|
|
|
|
|
|
|
|
if (!onToolbar)
|
|
|
|
@ -1588,7 +1588,7 @@ void KeramikStyle::drawControl( TQ_ControlElement element,
|
|
|
|
|
case CE_DockWindowEmptyArea:
|
|
|
|
|
{
|
|
|
|
|
TQRect pr = r;
|
|
|
|
|
if (ceData.widgetObjectTypes.contains(TQTOOLBAR_OBJECT_NAME_STRING))
|
|
|
|
|
if (ceData.widgetObjectTypes.contains("TQToolBar"))
|
|
|
|
|
{
|
|
|
|
|
const TQToolBar* tb = static_cast<const TQToolBar*>(widget);
|
|
|
|
|
if (tb->place() == TQDockWindow::OutsideDock)
|
|
|
|
@ -2029,7 +2029,7 @@ void KeramikStyle::drawComplexControl( TQ_ComplexControl control,
|
|
|
|
|
if (controls == SC_All)
|
|
|
|
|
{
|
|
|
|
|
//Double-buffer only when we are in the slower full-blend mode
|
|
|
|
|
if ( ceData.parentWidgetData.widgetObjectTypes.contains(TQTOOLBAR_OBJECT_NAME_STRING) || !qstrcmp(ceData.parentWidgetData.name.ascii(), kdeToolbarWidget) )
|
|
|
|
|
if ( ceData.parentWidgetData.widgetObjectTypes.contains("TQToolBar") || !qstrcmp(ceData.parentWidgetData.name.ascii(), kdeToolbarWidget) )
|
|
|
|
|
{
|
|
|
|
|
buf = new TQPixmap( r.width(), r.height() );
|
|
|
|
|
br.setX(0);
|
|
|
|
@ -2257,10 +2257,10 @@ void KeramikStyle::drawComplexControl( TQ_ComplexControl control,
|
|
|
|
|
// TOOLBUTTON
|
|
|
|
|
// -------------------------------------------------------------------
|
|
|
|
|
case CC_ToolButton: {
|
|
|
|
|
bool onToolbar = ceData.parentWidgetData.widgetObjectTypes.contains(TQTOOLBAR_OBJECT_NAME_STRING);
|
|
|
|
|
bool onToolbar = ceData.parentWidgetData.widgetObjectTypes.contains("TQToolBar");
|
|
|
|
|
bool onExtender = !onToolbar &&
|
|
|
|
|
ceData.parentWidgetData.widgetObjectTypes.contains( TQTOOLBAREXTENSIONWIDGET_OBJECT_NAME_STRING) &&
|
|
|
|
|
widget && widget->parentWidget()->parentWidget()->inherits( TQTOOLBAR_OBJECT_NAME_STRING );
|
|
|
|
|
ceData.parentWidgetData.widgetObjectTypes.contains( "TQToolBarExtensionWidget") &&
|
|
|
|
|
widget && widget->parentWidget()->parentWidget()->inherits( "TQToolBar" );
|
|
|
|
|
|
|
|
|
|
bool onControlButtons = false;
|
|
|
|
|
if (!onToolbar && !onExtender && !ceData.parentWidgetData.widgetObjectTypes.isEmpty() &&
|
|
|
|
@ -2437,7 +2437,7 @@ int KeramikStyle::pixelMetric(PixelMetric m, const TQStyleControlElementData &ce
|
|
|
|
|
|
|
|
|
|
case PM_TabBarTabShiftVertical:
|
|
|
|
|
{
|
|
|
|
|
if (ceData.widgetObjectTypes.contains(TQTABBAR_OBJECT_NAME_STRING))
|
|
|
|
|
if (ceData.widgetObjectTypes.contains("TQTabBar"))
|
|
|
|
|
{
|
|
|
|
|
if (ceData.tabBarData.shape == TQTabBar::RoundedBelow ||
|
|
|
|
|
ceData.tabBarData.shape == TQTabBar::TriangularBelow)
|
|
|
|
@ -2492,7 +2492,7 @@ TQSize KeramikStyle::sizeFromContents( ContentsType contents,
|
|
|
|
|
|
|
|
|
|
case CT_ToolButton:
|
|
|
|
|
{
|
|
|
|
|
bool onToolbar = widget->parentWidget() && widget->parentWidget()->inherits( TQTOOLBAR_OBJECT_NAME_STRING );
|
|
|
|
|
bool onToolbar = widget->parentWidget() && widget->parentWidget()->inherits( "TQToolBar" );
|
|
|
|
|
if (!onToolbar) //Behaves like a button, so scale appropriately to the border
|
|
|
|
|
{
|
|
|
|
|
int w = contentSize.width();
|
|
|
|
@ -2795,7 +2795,7 @@ bool KeramikStyle::objectEventHandler( const TQStyleControlElementData &ceData,
|
|
|
|
|
if (TDEStyle::objectEventHandler( ceData, elementFlags, source, event ))
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
if (ceData.widgetObjectTypes.contains(TQOBJECT_OBJECT_NAME_STRING)) {
|
|
|
|
|
if (ceData.widgetObjectTypes.contains("TQObject")) {
|
|
|
|
|
TQObject* object = reinterpret_cast<TQObject*>(source);
|
|
|
|
|
|
|
|
|
|
if ( !object->isWidgetType() ) return false;
|
|
|
|
|