diff options
Diffstat (limited to 'tdestyles/kthemestyle/kthemestyle.cpp')
| -rw-r--r-- | tdestyles/kthemestyle/kthemestyle.cpp | 77 |
1 files changed, 38 insertions, 39 deletions
diff --git a/tdestyles/kthemestyle/kthemestyle.cpp b/tdestyles/kthemestyle/kthemestyle.cpp index 5ddbb3899..386f813bf 100644 --- a/tdestyles/kthemestyle/kthemestyle.cpp +++ b/tdestyles/kthemestyle/kthemestyle.cpp @@ -158,7 +158,7 @@ public: } }; -KDE_Q_EXPORT_PLUGIN( KThemeStylePlugin ) +TDE_EXPORT_PLUGIN( KThemeStylePlugin ) void kDrawWindowsArrow ( TQPainter *p, const TQStyleControlElementData &ceData, const TQStyle::ControlElementFlags elementFlags, const TQStyle* style, TQStyle::PrimitiveElement pe, bool down, @@ -422,7 +422,7 @@ KThemeStyle::~KThemeStyle() void KThemeStyle::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; @@ -450,7 +450,7 @@ void KThemeStyle::polish( TQPalette &p ) if ( isPixmap( Background ) ) { - TQBrush bgBrush( p.color( TQPalette::Normal, + TQBrush bgBrush( p.color( TQPalette::Active, TQColorGroup::Background ), *uncached( Background ) ); brushHandle = uncached( Background )->handle(); @@ -470,7 +470,7 @@ void KThemeStyle::paletteChanged() void KThemeStyle::applicationUnPolish( 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); app->setPalette( oldPalette, true ); } @@ -478,7 +478,7 @@ void KThemeStyle::applicationUnPolish( const TQStyleControlElementData &ceData, bool KThemeStyle::objectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQEvent *event ) { - if (ceData.widgetObjectTypes.contains(TQOBJECT_OBJECT_NAME_STRING)) { + if (ceData.widgetObjectTypes.contains("TQObject")) { TQObject* object = reinterpret_cast<TQObject*>(source); if( object->inherits("KActiveLabel")) @@ -486,7 +486,7 @@ bool KThemeStyle::objectEventHandler( const TQStyleControlElementData &ceData, C if(event->type() == TQEvent::Move || event->type() == TQEvent::Resize || event->type() == TQEvent::Show) { - TQWidget *w = TQT_TQWIDGET(object); + TQWidget *w = static_cast<TQWidget*>(object); TQPoint pos(0, 0); pos = w->mapTo(w->topLevelWidget(), pos); TQPixmap pix(uncached( Background )->size()); @@ -499,16 +499,16 @@ bool KThemeStyle::objectEventHandler( const TQStyleControlElementData &ceData, C pos.x(), pos.y()); p.end(); TQPalette pal(w->palette()); - TQBrush brush( pal.color( TQPalette::Normal, + TQBrush brush( pal.color( TQPalette::Active, TQColorGroup::Background), pix ); pal.setBrush(TQColorGroup::Base, brush); w->setPalette(pal); } } - if (!qstrcmp(object->name(), "tde toolbar widget") && object->inherits(TQLABEL_OBJECT_NAME_STRING)) + if (!qstrcmp(object->name(), "tde toolbar widget") && object->inherits("TQLabel")) { - TQWidget* lb = TQT_TQWIDGET(object); + TQWidget* lb = static_cast<TQWidget*>(object); if (lb->backgroundMode() == TQt::PaletteButton) lb->setBackgroundMode(TQt::PaletteBackground); removeObjectEventHandler(ceData, elementFlags, source, this); @@ -520,13 +520,13 @@ bool KThemeStyle::objectEventHandler( const TQStyleControlElementData &ceData, C void KThemeStyle::polish( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ) { - if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) { + if (ceData.widgetObjectTypes.contains("TQWidget")) { TQWidget *w = reinterpret_cast<TQWidget*>(ptr); - if (::tqqt_cast<TQStatusBar*>(w)) - w->setPaletteBackgroundColor(TQApplication::palette().color(TQPalette::Normal, TQColorGroup::Background)); + if (::tqt_cast<TQStatusBar*>(w)) + w->setPaletteBackgroundColor(TQApplication::palette().color(TQPalette::Active, TQColorGroup::Background)); - if (::tqqt_cast<TQLabel*>(w) && !qstrcmp(w->name(), "tde toolbar widget")) + if (::tqt_cast<TQLabel*>(w) && !qstrcmp(w->name(), "tde toolbar widget")) installObjectEventHandler(ceData, elementFlags, ptr, this); if (w->backgroundPixmap() && !w->isTopLevel() && @@ -550,9 +550,9 @@ void KThemeStyle::polish( const TQStyleControlElementData &ceData, ControlElemen { polishLock = true; - TQColorGroup clrGroup( Qt::black, TQColor( 255, 255, 220 ), - TQColor( 96, 96, 96 ), Qt::black, Qt::black, - Qt::black, TQColor( 255, 255, 220 ) ); + TQColorGroup clrGroup( TQt::black, TQColor( 255, 255, 220 ), + TQColor( 96, 96, 96 ), TQt::black, TQt::black, + TQt::black, TQColor( 255, 255, 220 ) ); TQPalette toolTip ( clrGroup, clrGroup, clrGroup ); TQToolTip::setPalette( toolTip ); @@ -565,7 +565,7 @@ void KThemeStyle::polish( const TQStyleControlElementData &ceData, ControlElemen return ; } - if ( ::tqqt_cast<TQMenuBar*>(w) ) + if ( ::tqt_cast<TQMenuBar*>(w) ) { w->setBackgroundMode( TQWidget::NoBackground ); } @@ -573,7 +573,7 @@ void KThemeStyle::polish( const TQStyleControlElementData &ceData, ControlElemen { w->setBackgroundMode( TQWidget::PaletteBackground ); } - else if ( ::tqqt_cast<TQPopupMenu*>(w) ) + else if ( ::tqt_cast<TQPopupMenu*>(w) ) { popupPalette = w->palette(); if ( isColor( MenuItem ) || isColor( MenuItemDown ) ) @@ -593,7 +593,7 @@ void KThemeStyle::polish( const TQStyleControlElementData &ceData, ControlElemen w->setBackgroundMode( TQWidget::NoBackground ); } - else if ( ::tqqt_cast<TQCheckBox*>(w) ) + else if ( ::tqt_cast<TQCheckBox*>(w) ) { if ( isColor( IndicatorOff ) || isColor( IndicatorOn ) ) { @@ -608,7 +608,7 @@ void KThemeStyle::polish( const TQStyleControlElementData &ceData, ControlElemen w->setPalette( newPal ); } } - else if ( ::tqqt_cast<TQRadioButton*>(w) ) + else if ( ::tqt_cast<TQRadioButton*>(w) ) { if ( isColor( ExIndicatorOff ) || isColor( ExIndicatorOn ) ) { @@ -631,7 +631,7 @@ void KThemeStyle::polish( const TQStyleControlElementData &ceData, ControlElemen void KThemeStyle::unPolish( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ) { - if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) { + if (ceData.widgetObjectTypes.contains("TQWidget")) { TQWidget *w = reinterpret_cast<TQWidget*>(ptr); if (w->backgroundPixmap() && !w->isTopLevel()) @@ -644,21 +644,21 @@ void KThemeStyle::unPolish( const TQStyleControlElementData &ceData, ControlElem } //Toolbar labels should nornally be PaletteButton - if ( ::tqqt_cast<TQLabel*>(w) && !qstrcmp(w->name(), "tde toolbar widget")) + if ( ::tqt_cast<TQLabel*>(w) && !qstrcmp(w->name(), "tde toolbar widget")) w->setBackgroundMode( TQWidget::PaletteButton ); //The same for menu bars, popup menus - else if ( ::tqqt_cast<TQMenuBar*>(w) || ::tqqt_cast<TQPopupMenu*>(w) ) + else if ( ::tqt_cast<TQMenuBar*>(w) || ::tqt_cast<TQPopupMenu*>(w) ) w->setBackgroundMode( TQWidget::PaletteButton ); - //For toolbar internal separators, return to button, too (can't use tqqt_cast here since don't have access to the class) + //For toolbar internal separators, return to button, too (can't use tqt_cast here since don't have access to the class) else if ( w->inherits( "TDEToolBarSeparator" ) || w->inherits( "QToolBarSeparator" ) ) w->setBackgroundMode( TQWidget::PaletteButton ); //For scrollbars, we don't do much, since the widget queries the style on the switch //Drop some custom palettes. ### this really should check the serial number to be 100% correct. - if ( ::tqqt_cast<TQPopupMenu*>(w) || ::tqqt_cast<TQCheckBox*>(w) || ::tqqt_cast<TQRadioButton*>(w) || ::tqqt_cast<TQStatusBar*>(w) ) + if ( ::tqt_cast<TQPopupMenu*>(w) || ::tqt_cast<TQCheckBox*>(w) || ::tqt_cast<TQRadioButton*>(w) || ::tqt_cast<TQStatusBar*>(w) ) w->unsetPalette(); } @@ -677,7 +677,7 @@ void KThemeStyle::drawBaseButton( TQPainter *p, int x, int y, int w, int h, if ( gradientHint( type ) == GrReverseBevel ) { int i; - bitBlt( p->device(), x, y, TQT_TQPAINTDEVICE(scalePixmap( w, h, type )), 0, 0, w, h, + bitBlt( p->device(), x, y, scalePixmap( w, h, type ), 0, 0, w, h, TQt::CopyROP, true ); p->setPen( g.text() ); for ( i = 0; i < borderWidth( type ); ++i, ++x, ++y, w -= 2, h -= 2 ) @@ -717,7 +717,7 @@ void KThemeStyle::drawBaseButton( TQPainter *p, int x, int y, int w, int h, } if ( borderPixmap( type ) ) { - bitBlt( p->device(), x, y, TQT_TQPAINTDEVICE(scaleBorder( w, h, type )), 0, 0, w, h, + bitBlt( p->device(), x, y, scaleBorder( w, h, type ), 0, 0, w, h, TQt::CopyROP, false ); } else @@ -927,7 +927,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, TQPainter * p, const TQSt const TQBitmap * mask = uncached( ( flags & Style_On || flags & Style_Down ) ? ExIndicatorOn : ExIndicatorOff ) ->mask(); if ( mask ) { - p->setPen( Qt::color1 ); + p->setPen( TQt::color1 ); p->drawPixmap( x, y, *mask ); } else @@ -945,7 +945,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, TQPainter * p, const TQSt IndicatorOff ) ->mask(); if ( mask ) { - p->setPen( Qt::color1 ); + p->setPen( TQt::color1 ); p->drawPixmap( x, y, *mask ); } else @@ -1686,14 +1686,14 @@ void KThemeStyle::drawControl( ControlElement element, // Draw the pixmap if ( pixmap->depth() == 1 ) - p->setBackgroundMode( Qt::OpaqueMode ); + p->setBackgroundMode( TQt::OpaqueMode ); int diffw = ( ( w - pixmap->width() ) / 2 ) + ( ( w - pixmap->width() ) % 2 ); p->drawPixmap( x + diffw, y + itemFrame, *pixmap ); if ( pixmap->depth() == 1 ) - p->setBackgroundMode( Qt::TransparentMode ); + p->setBackgroundMode( TQt::TransparentMode ); } } @@ -1851,7 +1851,7 @@ void KThemeStyle::drawTDEStylePrimitive( TDEStylePrimitive kpe, if ( !roundSlider() ) { const TQSlider * slider = ( const TQSlider* ) widget; - bool horizontal = slider->orientation() == Qt::Horizontal; + bool horizontal = slider->orientation() == TQt::Horizontal; if ( horizontal ) { drawBaseButton( p, x, y, w, h, *colorGroup( cg, SliderGroove ), true, @@ -1867,7 +1867,7 @@ void KThemeStyle::drawTDEStylePrimitive( TDEStylePrimitive kpe, { //This code is from HighColorDefault.. const TQSlider* slider = ( const TQSlider* ) widget; - bool horizontal = slider->orientation() == Qt::Horizontal; + bool horizontal = slider->orientation() == TQt::Horizontal; int gcenter = ( horizontal ? r.height() : r.width() ) / 2; TQRect gr; @@ -1903,7 +1903,7 @@ void KThemeStyle::drawTDEStylePrimitive( TDEStylePrimitive kpe, if ( isPixmap( Slider ) ) { const TQSlider * slider = ( const TQSlider* ) widget; - bool horizontal = slider->orientation() == Qt::Horizontal; + bool horizontal = slider->orientation() == TQt::Horizontal; if ( horizontal ) { bitBlt( p->device(), x, y + ( h - uncached( Slider ) ->height() ) / 2, @@ -1928,7 +1928,7 @@ void KThemeStyle::drawTDEStylePrimitive( TDEStylePrimitive kpe, //This code again from HighColor.. //...except sans the gradient.. const TQSlider* slider = ( const TQSlider* ) widget; - bool horizontal = slider->orientation() == Qt::Horizontal; + bool horizontal = slider->orientation() == TQt::Horizontal; int x, y, w, h; r.rect( &x, &y, &w, &h ); int x2 = x + w - 1; @@ -2013,7 +2013,7 @@ void KThemeStyle::drawTDEStylePrimitive( TDEStylePrimitive kpe, -void KThemeStyle::drawComplexControl ( TQ_ComplexControl control, TQPainter * p, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, +void KThemeStyle::drawComplexControl ( ComplexControl control, TQPainter * p, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQRect & r, const TQColorGroup & g, SFlags how , SCFlags controls, SCFlags active, const TQStyleOption & opt, const TQWidget * widget ) const @@ -2115,7 +2115,7 @@ void KThemeStyle::drawComplexControl ( TQ_ComplexControl control, TQPainter * p, { const TQScrollBar *sb = ( const TQScrollBar* ) widget; bool maxedOut = ( sb->minValue() == sb->maxValue() ); - bool horizontal = ( sb->orientation() == Qt::Horizontal ); + bool horizontal = ( sb->orientation() == TQt::Horizontal ); SFlags sflags = ( ( horizontal ? Style_Horizontal : Style_Default ) | ( maxedOut ? Style_Default : Style_Enabled ) ); @@ -2374,7 +2374,7 @@ void KThemeStyle::drawShade( TQPainter *p, int x, int y, int w, int h, ++x, ++y; --x2, --y2; } - p->setPen( Qt::black ); + p->setPen( TQt::black ); p->drawPoints( bPntArray ); p->drawLineSegments( bLineArray ); p->setPen( highPen ); @@ -2456,4 +2456,3 @@ int KThemeStyle::popupMenuItemHeight( bool /*checkable*/, TQMenuItem *mi, } #include "kthemestyle.moc" -// kate: indent-width 4; replace-tabs off; tab-width 4; space-indent on; |
