diff options
Diffstat (limited to 'style/polish.cpp')
-rw-r--r-- | style/polish.cpp | 109 |
1 files changed, 59 insertions, 50 deletions
diff --git a/style/polish.cpp b/style/polish.cpp index 650afc9..73d1f49 100644 --- a/style/polish.cpp +++ b/style/polish.cpp @@ -107,7 +107,7 @@ void LiquidStyle::polish( TQPalette &pal ) pal.setColor(TQPalette::Active, TQColorGroup::HighlightedText, TQColor(optionHandler->custCols[5])); pal.setColor(TQPalette::Active, TQColorGroup::ButtonText, TQColor(optionHandler->custCols[6])); pal.setColor(TQColorGroup::Mid, TQColor((tqRed(optionHandler->custCols[2])+tqRed(optionHandler->custCols[3]))/2,(tqGreen(optionHandler->custCols[2])+tqGreen(optionHandler->custCols[3]))/2,(tqBlue(optionHandler->custCols[2])+tqBlue(optionHandler->custCols[3]))/2)); - + pal.setColor(TQPalette::Inactive, TQColorGroup::Text, TQColor(optionHandler->custCols[3])); pal.setColor(TQPalette::Inactive, TQColorGroup::HighlightedText, TQColor(optionHandler->custCols[5])); pal.setColor(TQPalette::Inactive, TQColorGroup::ButtonText, TQColor(optionHandler->custCols[6])); @@ -120,10 +120,10 @@ void LiquidStyle::polish( TQPalette &pal ) origPanelBrush = pal.brush( TQPalette::Active, TQColorGroup::Background ); origPanelPalette = pal; TQColor c( pal.active().background() ); - + if ( optionHandler->usePanelCustomColor() && optionHandler->panelCustomColor().isValid() ) c = optionHandler->panelCustomColor(); - + kickerColor = c; pal.setColor( TQColorGroup::Mid, optionHandler->CustomButtonColor().dark( 110 ) ); @@ -185,7 +185,7 @@ void LiquidStyle::polish( TQPalette &pal ) TQBrush brush( c, stipple ); pal.setBrush( TQColorGroup::Background, brush ); } - + if (optionHandler->bevelHighlights()) { TQColor c(pal.active().highlight()); @@ -204,36 +204,40 @@ void LiquidStyle::polish( TQPalette &pal ) optionHandler->reset(); } -void LiquidStyle::unPolish( TQApplication *app ) +void LiquidStyle::applicationUnPolish( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ) { - popupBack.resize(0,0); - TQPalette pal( app->palette() ); - inExitPolish = true; - - if ( !isPlain() ) - { - // reset any stipples - if ( pal.brush( TQPalette::Active, TQColorGroup::Background ).pixmap() ) - pal.setBrush( TQColorGroup::Background, pal.active().background() ); - if ( pal.brush( TQPalette::Active, TQColorGroup::Button ).pixmap() ) - pal.setBrush( TQColorGroup::Button, pal.active().button() ); -// app->blockSignals( TRUE ); - app->setPalette( pal ); -// app->blockSignals( FALSE ); - } + if (ceData.widgetObjectTypes.contains(TQAPPLICATION_OBJECT_NAME_STRING)) { + TQApplication *app = reinterpret_cast<TQApplication*>(ptr); + popupBack.resize(0,0); + TQPalette pal( app->palette() ); + inExitPolish = true; + + if ( !isPlain() ) { + // reset any stipples + if ( pal.brush( TQPalette::Active, TQColorGroup::Background ).pixmap() ) + pal.setBrush( TQColorGroup::Background, pal.active().background() ); + if ( pal.brush( TQPalette::Active, TQColorGroup::Button ).pixmap() ) + pal.setBrush( TQColorGroup::Button, pal.active().button() ); +// app->blockSignals( TRUE ); + app->setPalette( pal ); +// app->blockSignals( FALSE ); + } - inExitPolish = false; + inExitPolish = false; + } } Atom baghira_deco_design = XInternAtom(tqt_xdisplay(), "BAGHIRA_DECO_DESIGN", False); -void LiquidStyle::polish( TQWidget *w ) +void LiquidStyle::polish( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ) { // bool testWidget = w->inherits("Splash"); // int testInt = 0; // if (w->sizePolicy().horData() == TQSizePolicy::Minimum || w->sizePolicy().horData() == TQSizePolicy::MinimumExpanding) // tqWarning("%s, \"%s\"",w->className(), w->name()); // w->installEventFilter(this); + if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) { + TQWidget *w = reinterpret_cast<TQWidget*>(ptr); bool tmpBool = false; bool isViewport = qstrcmp( w->name(), "qt_viewport" ) == 0 || @@ -358,7 +362,7 @@ void LiquidStyle::polish( TQWidget *w ) goto kstpolish; } - + if (w->inherits("KColorGrid")) { // kiconedit doesn't check for the paintevent rect size, but tries to create a (possibly) NULL Pixmap (after palette change event e.g.) @@ -367,18 +371,18 @@ void LiquidStyle::polish( TQWidget *w ) w->installEventFilter( this ); goto kstpolish; } - + if (w->inherits("BGMonitor") || w->inherits("mapWidget") || w->isA("MyButton") || (w->parentWidget() && w->parentWidget()->inherits("Thumbnail"))) // don't touch these widgets at all - they don't like it { goto kstpolish; } - + if (qstrcmp( w->name(), "tde toolbar widget" ) == 0 ) w->installEventFilter( this ); - + if (::tqt_cast<TQButton*>(w)) { w->setBackgroundOrigin(TQWidget::WindowOrigin); @@ -413,7 +417,7 @@ void LiquidStyle::polish( TQWidget *w ) goto kstpolish; } } - + if ( ::tqt_cast<TQToolBar*>(w)) { if (optionHandler->useToolButtonFrame() && w->inherits("TDEToolBar")) @@ -433,7 +437,7 @@ void LiquidStyle::polish( TQWidget *w ) goto kstpolish ; } //if (testWidget) tqWarning("testwidget stage %d",testInt++); - + if (tmpBool = ::tqt_cast<TQToolButton*>(w) || w->inherits( "TQToolBarSeparator" ) || w->inherits( "TDEToolBarSeparator" ) ) { if (tmpBool && w->parentWidget() && ::tqt_cast<TQToolBar*>(w->parentWidget()) ) @@ -445,7 +449,7 @@ void LiquidStyle::polish( TQWidget *w ) w->installEventFilter( this ); goto kstpolish; } - + if (::tqt_cast<TQComboBox*>(w)) { w->setBackgroundMode(NoBackground); @@ -453,7 +457,7 @@ void LiquidStyle::polish( TQWidget *w ) w->setBackgroundOrigin(TQWidget::WindowOrigin); goto kstpolish; } - + if (w->inherits("TaskBar")) { w->setBackgroundOrigin(TQWidget::WidgetOrigin); @@ -464,7 +468,7 @@ void LiquidStyle::polish( TQWidget *w ) w->installEventFilter( this ); goto kstpolish; } - + if ( !isPlain () && (w->inherits( "KonqIconViewWidget" ) || w->inherits( "tdehtml")/* || w->inherits( "TQtVisionView")*/)) { // if you want custom backgrounds in konqueror, you have to reset pixmap, since Konq animation can't handle it @@ -480,7 +484,7 @@ void LiquidStyle::polish( TQWidget *w ) w->setBackgroundMode( TQWidget::NoBackground ); goto kstpolish; } - + if ((::tqt_cast<TQScrollView*>(w) || w->inherits("KateView") || w->inherits("TEWidget") || w->inherits("CHexViewWidget")) && !(w->isA("KOAgenda"))) { if (::tqt_cast<TDEListView*>(w) && optionHandler->custCols[7] != -1 && ((TDEListView*)w)->alternateBackground() == TDEGlobalSettings::alternateBackgroundColor()) @@ -519,7 +523,7 @@ void LiquidStyle::polish( TQWidget *w ) w->installEventFilter( this ); goto kstpolish; } - + if (w->inherits("TQStatusBar")) { w->setBackgroundOrigin(TQWidget::WindowOrigin); @@ -530,14 +534,14 @@ void LiquidStyle::polish( TQWidget *w ) } goto kstpolish; } - + if (w->inherits( "TQLineEdit" ) || w->inherits("TQSplitterHandle") || w->isA( "AppletHandleDrag" ) || w->inherits( "KMiniPagerButton" )) { w->setBackgroundOrigin(TQWidget::WindowOrigin); w->installEventFilter( this ); goto kstpolish; } - + if (w->inherits( "TaskContainer" )) { w->installEventFilter( this ); @@ -552,7 +556,7 @@ void LiquidStyle::polish( TQWidget *w ) goto kstpolish; } - if ( !isPlain() ) + if ( !isPlain() ) { if ( !isViewport && w->parent() && qstrcmp( w->parent() ->name(), "proxyview" ) == 0 ) { @@ -626,7 +630,7 @@ void LiquidStyle::polish( TQWidget *w ) #endif goto kstpolish ; } - + if (::tqt_cast<TQFrame*>(w)) { w->setBackgroundOrigin(TQWidget::WindowOrigin); @@ -669,8 +673,8 @@ void LiquidStyle::polish( TQWidget *w ) } } //if (testWidget) tqWarning("testwidget stage %d",testInt++); - - + + if ( w->parentWidget() && ( ( ::tqt_cast<TQListBox*>(w) && ::tqt_cast<TQPushButton*>(w->parentWidget())) || w->inherits( "TDECompletionBox" ) ) ) { TQListBox* listbox = (TQListBox*) w; listbox->setBackgroundMode( NoBackground ); @@ -679,7 +683,7 @@ void LiquidStyle::polish( TQWidget *w ) } //if (testWidget) tqWarning("testwidget stage %d",testInt++); - + if (::tqt_cast<TQHeader*>(w)){ // if (::tqt_cast<TQListView*>(w->parentWidget())) // headerSortID = ((TQListView*)w->parentWidget())->sortColumn(); @@ -690,7 +694,7 @@ void LiquidStyle::polish( TQWidget *w ) } //if (testWidget) tqWarning("testwidget stage %d",testInt++); - + if (::tqt_cast<TQTabBar*>(w)){ // tqWarning("installing tab event"); w->setMouseTracking( true ); @@ -698,7 +702,7 @@ void LiquidStyle::polish( TQWidget *w ) w->setBackgroundOrigin(TQWidget::WindowOrigin); goto kstpolish; } - + if (::tqt_cast<TQGroupBox*>(w) && ((TQGroupBox*)w)->frameShape() == TQFrame::GroupBoxPanel && !((TQGroupBox*)w)->isFlat()) { if ( optionHandler->drawGroupBoxShadow() ) @@ -726,7 +730,7 @@ void LiquidStyle::polish( TQWidget *w ) connect(w, SIGNAL(destroyed(TQObject*)), this, SLOT(progressBarDestroyed(TQObject*))); goto kstpolish; } - + if ( w->inherits( "TQDockWindow" ) ) { w->setBackgroundMode( TQWidget::PaletteBackground ); w->setBackgroundOrigin(TQWidget::WindowOrigin); @@ -744,25 +748,29 @@ void LiquidStyle::polish( TQWidget *w ) if ( w->inherits( "KdetvView")) { w->setBackgroundMode( TQWidget::NoBackground ); } + } //if (testWidget) tqWarning("testwidget stage %d",testInt++); - kstpolish: TDEStyle::polish( w ); // nothing of all above? do default kde stuff + kstpolish: TDEStyle::polish( ceData, elementFlags, ptr ); // nothing of all above? do default kde stuff } -void LiquidStyle::unPolish( TQWidget *w ) { +void LiquidStyle::unPolish( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ) { + + if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) { + TQWidget *w = reinterpret_cast<TQWidget*>(ptr); bool isViewport; bool isViewportChild; - + // general - better than querying for each and ever widget if it got one... w->removeEventFilter( this ); - + if (w->inherits("KColorGrid")){ goto kstunpolish; } - + if ( w->inherits("TQToolBar") || qstrcmp( w->name(), "tde toolbar widget" ) == 0 ) { w->setBackgroundOrigin( TQWidget::WidgetOrigin ); // w->unsetPalette(); @@ -874,5 +882,6 @@ void LiquidStyle::unPolish( TQWidget *w ) { goto kstunpolish; } } -kstunpolish: TDEStyle::unPolish( w ); - } + } +kstunpolish: TDEStyle::unPolish( ceData, elementFlags, ptr ); +} |