diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-07 03:45:53 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-07 03:45:53 +0000 |
commit | 10308be19ef7fa44699562cc75946e7ea1fdf6b9 (patch) | |
tree | 4bc444c00a79e88105f2cfce5b6209994c413ca0 /kstyles/kthemestyle | |
parent | 307136d8eef0ba133b78ceee8e901138d4c996a1 (diff) | |
download | tdelibs-10308be19ef7fa44699562cc75946e7ea1fdf6b9.tar.gz tdelibs-10308be19ef7fa44699562cc75946e7ea1fdf6b9.zip |
Revert automated changes
Sorry guys, they are just not ready for prime time
Work will continue as always
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1212479 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kstyles/kthemestyle')
-rw-r--r-- | kstyles/kthemestyle/kthemebase.cpp | 126 | ||||
-rw-r--r-- | kstyles/kthemestyle/kthemebase.h | 42 | ||||
-rw-r--r-- | kstyles/kthemestyle/kthemestyle.cpp | 202 | ||||
-rw-r--r-- | kstyles/kthemestyle/kthemestyle.h | 14 |
4 files changed, 192 insertions, 192 deletions
diff --git a/kstyles/kthemestyle/kthemebase.cpp b/kstyles/kthemestyle/kthemebase.cpp index f2b133d23..6b5c0961d 100644 --- a/kstyles/kthemestyle/kthemebase.cpp +++ b/kstyles/kthemestyle/kthemebase.cpp @@ -77,8 +77,8 @@ static TQColor readColorEntry( TQSettings* s, const char *pKey, else { bool bOK; - // tqfind first part (red) - int nIndex = aValue.tqfind( ',' ); + // find first part (red) + int nIndex = aValue.find( ',' ); if ( nIndex == -1 ) { // return a sensible default -- Bernd @@ -89,9 +89,9 @@ static TQColor readColorEntry( TQSettings* s, const char *pKey, nRed = aValue.left( nIndex ).toInt( &bOK ); - // tqfind second part (green) + // find second part (green) int nOldIndex = nIndex; - nIndex = aValue.tqfind( ',', nOldIndex + 1 ); + nIndex = aValue.find( ',', nOldIndex + 1 ); if ( nIndex == -1 ) { @@ -103,7 +103,7 @@ static TQColor readColorEntry( TQSettings* s, const char *pKey, nGreen = aValue.mid( nOldIndex + 1, nIndex - nOldIndex - 1 ).toInt( &bOK ); - // tqfind third part (blue) + // find third part (blue) nBlue = aValue.right( aValue.length() - nIndex - 1 ).toInt( &bOK ); aRetColor.setRgb( nRed, nGreen, nBlue ); @@ -176,7 +176,7 @@ public: */ TQColor pixmapAveColor( const TQPixmap* p ) { - if ( colorCache.tqcontains( p ) ) + if ( colorCache.contains( p ) ) return colorCache[ p ]; TQImage to_ave = p->convertToImage(); @@ -209,7 +209,7 @@ public: -// This is used to encode the keys. I used to use tqmasks but I think this +// This is used to encode the keys. I used to use masks but I think this // bitfield is nicer :) I don't know why C++ coders don't use these more.. // (mosfet) struct kthemeKeyData @@ -222,7 +222,7 @@ unsigned int height : 12; unsigned int border : 1; -unsigned int tqmask : +unsigned int mask : 1; }; @@ -236,8 +236,8 @@ void KThemeBase::generateBorderPix( int i ) // separate pixmap into separate components if ( pbPixmaps[ i ] ) { - // evidently I have to do tqmasks manually... - const TQBitmap * srcMask = pbPixmaps[ i ] ->tqmask(); + // evidently I have to do masks manually... + const TQBitmap * srcMask = pbPixmaps[ i ] ->mask(); TQBitmap destMask( pbWidth[ i ], pbWidth[ i ] ); TQPixmap tmp( pbWidth[ i ], pbWidth[ i ] ); @@ -563,7 +563,7 @@ void KThemeBase::applyConfigFile( TQSettings& config ) { TQStringList keys = config.entryList( configFileName ); - if ( keys.tqcontains( "foreground" ) ) + if ( keys.contains( "foreground" ) ) { d->overrideForeground = true; d->overrideForegroundCol = readColorEntry( &config, ( configFileName + "foreground" ).latin1(), 0 ); @@ -571,7 +571,7 @@ void KThemeBase::applyConfigFile( TQSettings& config ) else d->overrideForeground = false; - if ( keys.tqcontains( "background" ) ) + if ( keys.contains( "background" ) ) { d->overrideBackground = true; d->overrideBackgroundCol = readColorEntry( &config, ( configFileName + "background" ).latin1(), 0 ); @@ -581,7 +581,7 @@ void KThemeBase::applyConfigFile( TQSettings& config ) - if ( keys.tqcontains( "selectForeground" ) ) + if ( keys.contains( "selectForeground" ) ) { d->overrideSelectForeground = true; d->overrideSelectForegroundCol = readColorEntry( &config, ( configFileName + "selectForeground" ).latin1(), 0 ); @@ -589,7 +589,7 @@ void KThemeBase::applyConfigFile( TQSettings& config ) else d->overrideSelectForeground = false; - if ( keys.tqcontains( "selectBackground" ) ) + if ( keys.contains( "selectBackground" ) ) { d->overrideSelectBackground = true; d->overrideSelectBackgroundCol = readColorEntry( &config, ( configFileName + "selectBackground" ).latin1(), 0 ); @@ -597,7 +597,7 @@ void KThemeBase::applyConfigFile( TQSettings& config ) else d->overrideSelectBackground = false; - if ( keys.tqcontains( "windowBackground" ) ) + if ( keys.contains( "windowBackground" ) ) { d->overrideWindowBackground = true; d->overrideWindowBackgroundCol = readColorEntry( &config, ( configFileName + "windowBackground" ).latin1(), 0 ); @@ -606,7 +606,7 @@ void KThemeBase::applyConfigFile( TQSettings& config ) d->overrideWindowBackground = false; - if ( keys.tqcontains( "windowForeground" ) ) + if ( keys.contains( "windowForeground" ) ) { d->overrideWindowForeground = true; d->overrideWindowForegroundCol = readColorEntry( &config, ( configFileName + "windowForeground" ).latin1(), 0 ); @@ -801,51 +801,51 @@ KThemePixmap* KThemeBase::scaleBorder( int w, int h, WidgetType widget ) const { pixmap = new KThemePixmap(); pixmap->resize( w, h ); - TQBitmap tqmask; - tqmask.resize( w, h ); - tqmask.fill( color0 ); + TQBitmap mask; + mask.resize( w, h ); + mask.fill( color0 ); TQPainter mPainter; - mPainter.begin( &tqmask ); + mPainter.begin( &mask ); TQPixmap *tmp = borderPixmap( widget ) ->border( KThemePixmap::TopLeft ); - const TQBitmap *srcMask = tmp->tqmask(); + const TQBitmap *srcMask = tmp->mask(); int bdWidth = tmp->width(); bitBlt( pixmap, 0, 0, tmp, 0, 0, bdWidth, bdWidth, Qt::CopyROP, false ); if ( srcMask ) - bitBlt( &tqmask, 0, 0, srcMask, 0, 0, bdWidth, bdWidth, + bitBlt( &mask, 0, 0, srcMask, 0, 0, bdWidth, bdWidth, Qt::CopyROP, false ); else mPainter.fillRect( 0, 0, bdWidth, bdWidth, color1 ); tmp = borderPixmap( widget ) ->border( KThemePixmap::TopRight ); - srcMask = tmp->tqmask(); + srcMask = tmp->mask(); bitBlt( pixmap, w - bdWidth, 0, tmp, 0, 0, bdWidth, bdWidth, Qt::CopyROP, false ); if ( srcMask ) - bitBlt( &tqmask, w - bdWidth, 0, srcMask, 0, 0, bdWidth, + bitBlt( &mask, w - bdWidth, 0, srcMask, 0, 0, bdWidth, bdWidth, Qt::CopyROP, false ); else mPainter.fillRect( w - bdWidth, 0, bdWidth, bdWidth, color1 ); tmp = borderPixmap( widget ) ->border( KThemePixmap::BottomLeft ); - srcMask = tmp->tqmask(); + srcMask = tmp->mask(); bitBlt( pixmap, 0, h - bdWidth, tmp, 0, 0, bdWidth, bdWidth, Qt::CopyROP, false ); if ( srcMask ) - bitBlt( &tqmask, 0, h - bdWidth, srcMask, 0, 0, bdWidth, + bitBlt( &mask, 0, h - bdWidth, srcMask, 0, 0, bdWidth, bdWidth, Qt::CopyROP, false ); else mPainter.fillRect( 0, h - bdWidth, bdWidth, bdWidth, color1 ); tmp = borderPixmap( widget ) ->border( KThemePixmap::BottomRight ); - srcMask = tmp->tqmask(); + srcMask = tmp->mask(); bitBlt( pixmap, w - bdWidth, h - bdWidth, tmp, 0, 0, bdWidth, bdWidth, Qt::CopyROP, false ); if ( srcMask ) - bitBlt( &tqmask, w - bdWidth, h - bdWidth, srcMask, 0, 0, + bitBlt( &mask, w - bdWidth, h - bdWidth, srcMask, 0, 0, bdWidth, bdWidth, Qt::CopyROP, false ); else mPainter.fillRect( w - bdWidth, h - bdWidth, bdWidth, bdWidth, color1 ); @@ -855,20 +855,20 @@ KThemePixmap* KThemeBase::scaleBorder( int w, int h, WidgetType widget ) const if ( w - bdWidth * 2 > 0 ) { tmp = borderPixmap( widget ) ->border( KThemePixmap::Top ); - srcMask = tmp->tqmask(); + srcMask = tmp->mask(); p.drawTiledPixmap( bdWidth, 0, w - bdWidth * 2, bdWidth, *tmp ); if ( srcMask ) - bitBlt( &tqmask, bdWidth, 0, srcMask, 0, 0, + bitBlt( &mask, bdWidth, 0, srcMask, 0, 0, w - bdWidth * 2, bdWidth, Qt::CopyROP, false ); else mPainter.fillRect( bdWidth, 0, w - bdWidth * 2, bdWidth, color1 ); tmp = borderPixmap( widget ) ->border( KThemePixmap::Bottom ); - srcMask = tmp->tqmask(); + srcMask = tmp->mask(); p.drawTiledPixmap( bdWidth, h - bdWidth, w - bdWidth * 2, bdWidth, *tmp ); if ( srcMask ) - bitBlt( &tqmask, bdWidth, h - bdWidth, srcMask, 0, 0, + bitBlt( &mask, bdWidth, h - bdWidth, srcMask, 0, 0, w - bdWidth * 2, bdWidth, Qt::CopyROP, false ); else mPainter.fillRect( bdWidth, h - bdWidth, w - bdWidth * 2, bdWidth, @@ -877,30 +877,30 @@ KThemePixmap* KThemeBase::scaleBorder( int w, int h, WidgetType widget ) const if ( h - bdWidth * 2 > 0 ) { tmp = borderPixmap( widget ) ->border( KThemePixmap::Left ); - srcMask = tmp->tqmask(); + srcMask = tmp->mask(); p.drawTiledPixmap( 0, bdWidth, bdWidth, h - bdWidth * 2, *tmp ); if ( srcMask ) - bitBlt( &tqmask, 0, bdWidth, srcMask, 0, 0, + bitBlt( &mask, 0, bdWidth, srcMask, 0, 0, bdWidth, h - bdWidth * 2, Qt::CopyROP, false ); else mPainter.fillRect( 0, bdWidth, bdWidth, h - bdWidth * 2, color1 ); tmp = borderPixmap( widget ) ->border( KThemePixmap::Right ); - srcMask = tmp->tqmask(); + srcMask = tmp->mask(); p.drawTiledPixmap( w - bdWidth, bdWidth, bdWidth, h - bdWidth * 2, *tmp ); if ( srcMask ) - bitBlt( &tqmask, w - bdWidth, bdWidth, srcMask, 0, 0, + bitBlt( &mask, w - bdWidth, bdWidth, srcMask, 0, 0, bdWidth, h - bdWidth * 2, Qt::CopyROP, false ); else mPainter.fillRect( w - bdWidth, bdWidth, bdWidth, h - bdWidth * 2, color1 ); } p.end(); mPainter.end(); - pixmap->setMask( tqmask ); + pixmap->setMask( mask ); cache->insert( pixmap, KThemeCache::FullScale, widget, true ); - if ( !pixmap->tqmask() ) - qWarning( "No tqmask for border pixmap!\n" ); + if ( !pixmap->mask() ) + qWarning( "No mask for border pixmap!\n" ); } return ( pixmap ); } @@ -1269,22 +1269,22 @@ void KThemeBase::applyResourceGroup( TQSettings *config, int i ) TQStringList keys = config->entryList( base ); // Gradient low color or blend background - if ( keys.tqcontains( "GradientLow" ) ) + if ( keys.contains( "GradientLow" ) ) prop[ "GrLow" ] = readColorEntry( config, TQString( base + "GradientLow" ).latin1(), &TQApplication::palette().active().background() ).name(); // Gradient high color - if ( keys.tqcontains( "GradientHigh" ) ) + if ( keys.contains( "GradientHigh" ) ) prop[ "GrHigh" ] = readColorEntry( config, TQString( base + "GradientHigh" ).latin1(), &TQApplication::palette().active().foreground() ).name(); // Extended color attributes - if ( keys.tqcontains( "Foreground" ) || keys.tqcontains( "Background" ) ) + if ( keys.contains( "Foreground" ) || keys.contains( "Background" ) ) { TQColor fg, bg; - if ( keys.tqcontains( "Background" ) ) + if ( keys.contains( "Background" ) ) bg = readColorEntry( config, TQString( base + "Background" ).latin1(), &bg ); - if ( keys.tqcontains( "Foreground" ) ) + if ( keys.contains( "Foreground" ) ) fg = readColorEntry( config, TQString( base + "Foreground" ).latin1(), &fg ); prop[ "Foreground" ] = fg.name(); prop[ "Background" ] = bg.name(); @@ -1318,7 +1318,7 @@ void KThemeBase::applyResourceGroup( TQSettings *config, int i ) prop[ "Width" ] = TQString::number( config->readNumEntry( base + "Width", 10 ) ); else if ( i == ComboBox || i == ComboBoxDown ) { - if ( keys.tqcontains( "Round" ) ) + if ( keys.contains( "Round" ) ) prop[ "Round" ] = TQString::number( config->readBoolEntry( base + "Round", false ) ); else prop[ "Round" ] = "5000"; // invalid, used w/multiple groups @@ -1326,25 +1326,25 @@ void KThemeBase::applyResourceGroup( TQSettings *config, int i ) } else if ( i == PushButton || i == PushButtonDown ) { - if ( keys.tqcontains( "XShift" ) ) + if ( keys.contains( "XShift" ) ) prop[ "XShift" ] = TQString::number( config->readNumEntry( base + "XShift", 0 ) ); else prop[ "XShift" ] = "5000"; - if ( keys.tqcontains( "YShift" ) ) + if ( keys.contains( "YShift" ) ) prop[ "YShift" ] = TQString::number( config->readNumEntry( base + "YShift", 0 ) ); else prop[ "YShift" ] = "5000"; - if ( keys.tqcontains( "3DFocusRect" ) ) + if ( keys.contains( "3DFocusRect" ) ) prop[ "3DFRect" ] = TQString::number( config-> readBoolEntry( base + "3DFocusRect", false ) ); else prop[ "3DFRect" ] = "5000"; - if ( keys.tqcontains( "3DFocusOffset" ) ) + if ( keys.contains( "3DFocusOffset" ) ) prop[ "3DFOffset" ] = TQString::number( config-> readBoolEntry( base + "3DFocusOffset", 0 ) ); else prop[ "3DFOffset" ] = "5000"; - if ( keys.tqcontains( "Round" ) ) + if ( keys.contains( "Round" ) ) prop[ "Round" ] = TQString::number( config->readBoolEntry( base + "Round", false ) ); else prop[ "Round" ] = "5000"; @@ -1411,7 +1411,7 @@ void KThemeBase::readResourceGroup( int i, TQString *pixnames, TQString *brdname // Blend intensity tmpStr = prop[ "Blend" ]; if ( tmpStr.isEmpty() ) - tmpStr = TQString::tqfromLatin1( "0.0" ); + tmpStr = TQString::fromLatin1( "0.0" ); blends[ i ] = tmpStr.toFloat(); // Bevel contrast @@ -1607,7 +1607,7 @@ TQPalette KThemeBase::overridePalette( const TQPalette& pal ) { if ( isColor( Background ) ) { - background = tqcolorGroup( pal.active(), Background ) + background = colorGroup( pal.active(), Background ) ->background(); } if ( isPixmap( Background ) ) @@ -1620,7 +1620,7 @@ TQPalette KThemeBase::overridePalette( const TQPalette& pal ) background.dark( lowlightVal ), background.dark( 120 ), baseText, buttonText /*CHECKME: BrightText*/, base, background ); - buttonText = tqcolorGroup( pre, PushButton ) ->foreground(); + buttonText = colorGroup( pre, PushButton ) ->foreground(); } TQColor disfg = foreground; @@ -1752,7 +1752,7 @@ void KThemeCache::flushTimeout() } KThemePixmap* KThemeCache::pixmap( int w, int h, int widgetID, bool border, - bool tqmask ) + bool mask ) { kthemeKey key; @@ -1761,9 +1761,9 @@ KThemePixmap* KThemeCache::pixmap( int w, int h, int widgetID, bool border, key.data.width = w; key.data.height = h; key.data.border = border; - key.data.tqmask = tqmask; + key.data.mask = mask; - KThemePixmap *pix = cache.tqfind( ( unsigned long ) key.cacheKey ); + KThemePixmap *pix = cache.find( ( unsigned long ) key.cacheKey ); if ( pix ) pix->updateAccessed(); return ( pix ); @@ -1777,8 +1777,8 @@ KThemePixmap* KThemeCache::horizontalPixmap( int w, int widgetID ) key.data.width = w; key.data.height = 0; key.data.border = false; - key.data.tqmask = false; - KThemePixmap *pix = cache.tqfind( ( unsigned long ) key.cacheKey ); + key.data.mask = false; + KThemePixmap *pix = cache.find( ( unsigned long ) key.cacheKey ); if ( pix ) pix->updateAccessed(); return ( pix ); @@ -1792,15 +1792,15 @@ KThemePixmap* KThemeCache::verticalPixmap( int h, int widgetID ) key.data.width = 0; key.data.height = h; key.data.border = false; - key.data.tqmask = false; - KThemePixmap *pix = cache.tqfind( ( unsigned long ) key.cacheKey ); + key.data.mask = false; + KThemePixmap *pix = cache.find( ( unsigned long ) key.cacheKey ); if ( pix ) pix->updateAccessed(); return ( pix ); } bool KThemeCache::insert( KThemePixmap *pixmap, ScaleHint scale, int widgetID, - bool border, bool tqmask ) + bool border, bool mask ) { kthemeKey key; key.cacheKey = 0; // shut up, gcc @@ -1810,9 +1810,9 @@ bool KThemeCache::insert( KThemePixmap *pixmap, ScaleHint scale, int widgetID, key.data.height = ( scale == FullScale || scale == VerticalScale ) ? pixmap->height() : 0; key.data.border = border; - key.data.tqmask = tqmask; + key.data.mask = mask; - if ( cache.tqfind( ( unsigned long ) key.cacheKey, true ) != NULL ) + if ( cache.find( ( unsigned long ) key.cacheKey, true ) != NULL ) { return ( true ); // a pixmap of this scale is already in there } diff --git a/kstyles/kthemestyle/kthemebase.h b/kstyles/kthemestyle/kthemebase.h index dab801573..6da89cc3e 100644 --- a/kstyles/kthemestyle/kthemebase.h +++ b/kstyles/kthemestyle/kthemebase.h @@ -107,7 +107,7 @@ inline bool KThemePixmap::isOld() * * This class is mostly just inline methods that do bit operations on a key * composed of the widget ID, width and/or height, and then calls - * TQIntCache::tqfind(). + * TQIntCache::find(). * * One other thing to note is that full, horizontal, and vertically scaled * pixmaps are not used interchangeably. For example, if you insert a fully @@ -120,7 +120,7 @@ inline bool KThemePixmap::isOld() * @author Daniel M. Duley <mosfet@kde.org> * */ -class KThemeCache : public TQObject +class KThemeCache : public QObject { Q_OBJECT public: @@ -145,12 +145,12 @@ public: * @param widgetID The widget ID of the pixmap, usually from KThemeBase's * WidgetType enum. * @param border True if the pixmap has a border. - * @param tqmask True if the pixmap has a tqmask. + * @param mask True if the pixmap has a mask. * * @return True if the insert was successful, false otherwise. */ bool insert( KThemePixmap *pixmap, ScaleHint scale, int widgetID, - bool border = false, bool tqmask = false ); + bool border = false, bool mask = false ); /** * Returns a fully scaled pixmap. * @@ -158,13 +158,13 @@ public: * @param h The pixmap height to search for. * @param widgetID The widget ID to search for. * @param border True if the pixmap has a border. - * @param tqmask True if the pixmap has a tqmask. + * @param mask True if the pixmap has a mask. * * @return True if a pixmap matching the width, height, and widget ID of * the pixmap exists, NULL otherwise. */ KThemePixmap* pixmap( int w, int h, int widgetID, bool border = false, - bool tqmask = false ); + bool mask = false ); /** * Returns a horizontally scaled pixmap. * @@ -234,7 +234,7 @@ public: */ enum ShadeStyle{Motif, Windows, Next, KDE}; /** - * The default scrollbar button tqlayout. BottomLeft is like what Next + * The default scrollbar button layout. BottomLeft is like what Next * uses, BottomRight is like Platinum, and Opposite it like Windows and * Motif. */ @@ -300,12 +300,12 @@ public: * If a color group is set in the theme configuration * that is used, otherwise defaultColor is returned. * - * @param defaultGroup The tqcolorGroup to set if one is available. + * @param defaultGroup The colorGroup to set if one is available. * * @param widget The widget whose color group to retrieve. * */ - const TQColorGroup* tqcolorGroup( const TQColorGroup &defaultGroup, + const TQColorGroup* colorGroup( const TQColorGroup &defaultGroup, WidgetType widget ) const; TQBrush pixmapBrush( const TQColorGroup &group, TQColorGroup::ColorRole role, @@ -356,7 +356,7 @@ public: */ int getSBExtent() const; /** - * The scrollbar button tqlayout. + * The scrollbar button layout. */ SButton scrollBarLayout() const; /** @@ -508,9 +508,9 @@ protected: /** These are included for fuuture extension purposes.. */ - virtual int tqpixelMetric ( PixelMetric metric, const TQWidget * widget = 0 ) const + virtual int pixelMetric ( PixelMetric metric, const TQWidget * widget = 0 ) const { - return KStyle::tqpixelMetric( metric, widget ); + return KStyle::pixelMetric( metric, widget ); } virtual void drawPrimitive ( PrimitiveElement pe, TQPainter * p, const TQRect & r, const TQColorGroup & cg, @@ -522,7 +522,7 @@ protected: } - virtual void tqdrawControl( ControlElement element, + virtual void drawControl( ControlElement element, TQPainter *p, const TQWidget *widget, const TQRect &r, @@ -530,21 +530,21 @@ protected: SFlags how = Style_Default, const TQStyleOption& opt = TQStyleOption::Default ) const { - KStyle::tqdrawControl( element, p, widget, + KStyle::drawControl( element, p, widget, r, cg, how, opt ); } - virtual void tqdrawControlMask( ControlElement element, + virtual void drawControlMask( ControlElement element, TQPainter *p, const TQWidget *widget, const TQRect &r, const TQStyleOption& opt = TQStyleOption::Default ) const { - KStyle::tqdrawControlMask( element, p, widget, r, opt ); + KStyle::drawControlMask( element, p, widget, r, opt ); } - virtual void tqdrawComplexControl( ComplexControl control, + virtual void drawComplexControl( ComplexControl control, TQPainter *p, const TQWidget* widget, const TQRect &r, @@ -554,7 +554,7 @@ protected: SCFlags active = SC_None, const TQStyleOption& opt = TQStyleOption::Default ) const { - KStyle::tqdrawComplexControl( control, p, widget, r, cg, flags, controls, active, opt ); + KStyle::drawComplexControl( control, p, widget, r, cg, flags, controls, active, opt ); } @@ -572,12 +572,12 @@ protected: } - virtual int tqstyleHint( StyleHint sh, + virtual int styleHint( StyleHint sh, const TQWidget *widget = 0, const TQStyleOption& opt = TQStyleOption::Default, QStyleHintReturn* returnData = 0 ) const { - return KStyle::tqstyleHint( sh, + return KStyle::styleHint( sh, widget, opt, returnData ); @@ -731,7 +731,7 @@ inline TQBrush KThemeBase::pixmapBrush( const TQColorGroup &group, return ( group.color( role ) ); } -inline const TQColorGroup* KThemeBase::tqcolorGroup( const TQColorGroup &defaultGroup, +inline const TQColorGroup* KThemeBase::colorGroup( const TQColorGroup &defaultGroup, WidgetType widget ) const { return ( ( colors[ widget ] ) ? colors[ widget ] : &defaultGroup ); diff --git a/kstyles/kthemestyle/kthemestyle.cpp b/kstyles/kthemestyle/kthemestyle.cpp index 26764f72e..4927c67bc 100644 --- a/kstyles/kthemestyle/kthemestyle.cpp +++ b/kstyles/kthemestyle/kthemestyle.cpp @@ -119,7 +119,7 @@ public: //####### (Fixes exit crashes with qt-only apps that occur on Linux) //####### This should be rethought after 3.0, //####### as it relies on the implementation-specific behavior - //####### of the glibc libdl (tqfinding already loaded libraries based on the + //####### of the glibc libdl (finding already loaded libraries based on the //####### soname) #endif } @@ -186,8 +186,8 @@ void kDrawWindowsArrow ( TQPainter *p, const TQStyle* style, TQStyle::PrimitiveE p->save(); if ( down ) { - p->translate( style->tqpixelMetric( TQStyle::PM_ButtonShiftHorizontal ), - style->tqpixelMetric( TQStyle::PM_ButtonShiftVertical ) ); + p->translate( style->pixelMetric( TQStyle::PM_ButtonShiftHorizontal ), + style->pixelMetric( TQStyle::PM_ButtonShiftVertical ) ); } if ( enabled ) @@ -226,8 +226,8 @@ TQSize KThemeStyle::sizeFromContents( ContentsType contents, const TQPushButton * button = ( const TQPushButton* ) widget; int w = contentSize.width(); int h = contentSize.height(); - int bm = tqpixelMetric( PM_ButtonMargin, widget ); - int fw = tqpixelMetric( PM_DefaultFrameWidth, widget ) * 2; + int bm = pixelMetric( PM_ButtonMargin, widget ); + int fw = pixelMetric( PM_DefaultFrameWidth, widget ) * 2; w += bm + fw + 6; // ### Add 6 to make way for bold font. h += bm + fw; @@ -260,8 +260,8 @@ TQSize KThemeStyle::sizeFromContents( ContentsType contents, if ( mi->custom() ) { - w = mi->custom() ->tqsizeHint().width(); - h = mi->custom() ->tqsizeHint().height(); + w = mi->custom() ->sizeHint().width(); + h = mi->custom() ->sizeHint().height(); if ( ! mi->custom() ->fullSpan() ) h += 2 * itemVMargin + 2 * itemFrame; } @@ -286,7 +286,7 @@ TQSize KThemeStyle::sizeFromContents( ContentsType contents, 2 * itemFrame ); } - if ( ! mi->text().isNull() && mi->text().tqfind( '\t' ) >= 0 ) + if ( ! mi->text().isNull() && mi->text().find( '\t' ) >= 0 ) w += 12; else if ( mi->popup() ) w += 2 * arrowHMargin; @@ -320,8 +320,8 @@ TQRect KThemeStyle::subRect(SubRect sr, const TQWidget* widget) const { TQRect bounding = cb->rect(); - int cw = tqpixelMetric(PM_IndicatorWidth, widget); - int ch = tqpixelMetric(PM_IndicatorHeight, widget); + int cw = pixelMetric(PM_IndicatorWidth, widget); + int ch = pixelMetric(PM_IndicatorHeight, widget); TQRect checkbox(bounding.x() + 2, bounding.y() + 2 + (bounding.height() - ch)/2, cw - 4, ch - 4); @@ -331,7 +331,7 @@ TQRect KThemeStyle::subRect(SubRect sr, const TQWidget* widget) const return KStyle::subRect(sr, widget); } -int KThemeStyle::tqpixelMetric ( PixelMetric metric, const TQWidget * widget ) const +int KThemeStyle::pixelMetric ( PixelMetric metric, const TQWidget * widget ) const { switch ( metric ) { @@ -361,26 +361,26 @@ int KThemeStyle::tqpixelMetric ( PixelMetric metric, const TQWidget * widget ) c if ( isPixmap( ExIndicatorOn ) ) return ( uncached( ExIndicatorOn ) ->size().width() ); else - return KThemeBase::tqpixelMetric ( metric, widget ); + return KThemeBase::pixelMetric ( metric, widget ); case PM_ExclusiveIndicatorHeight: if ( isPixmap( ExIndicatorOn ) ) return ( uncached( ExIndicatorOn ) ->size().height() ); else - return KThemeBase::tqpixelMetric ( metric, widget ); + return KThemeBase::pixelMetric ( metric, widget ); case PM_IndicatorWidth: if ( isPixmap( IndicatorOn ) ) return ( uncached( IndicatorOn ) ->size().width() ); else - return KThemeBase::tqpixelMetric ( metric, widget ); + return KThemeBase::pixelMetric ( metric, widget ); case PM_IndicatorHeight: if ( isPixmap( IndicatorOn ) ) return ( uncached( IndicatorOn ) ->size().height() ); else - return KThemeBase::tqpixelMetric ( metric, widget ); + return KThemeBase::pixelMetric ( metric, widget ); case PM_SliderLength: return ( sliderButtonLength() ); @@ -389,7 +389,7 @@ int KThemeStyle::tqpixelMetric ( PixelMetric metric, const TQWidget * widget ) c return ( splitWidth() ); default: - return KThemeBase::tqpixelMetric ( metric, widget ); + return KThemeBase::pixelMetric ( metric, widget ); } } @@ -470,7 +470,7 @@ bool KThemeStyle::eventFilter( TQObject* object, TQEvent* event ) { TQWidget *w = static_cast<TQWidget*>(object); TQPoint pos(0, 0); - pos = w->mapTo(w->tqtopLevelWidget(), pos); + pos = w->mapTo(w->topLevelWidget(), pos); TQPixmap pix(uncached( Background )->size()); TQPainter p; p.begin(&pix); @@ -559,12 +559,12 @@ void KThemeStyle::polish( TQWidget *w ) TQPalette newPal( w->palette() ); if ( isColor( MenuItem ) ) { - newPal.setActive( *tqcolorGroup( newPal.active(), MenuItem ) ); - newPal.setDisabled( *tqcolorGroup( newPal.active(), MenuItem ) ); + newPal.setActive( *colorGroup( newPal.active(), MenuItem ) ); + newPal.setDisabled( *colorGroup( newPal.active(), MenuItem ) ); } if ( isColor( MenuItemDown ) ) { - newPal.setActive( *tqcolorGroup( newPal.active(), MenuItemDown ) ); + newPal.setActive( *colorGroup( newPal.active(), MenuItemDown ) ); } w->setPalette( newPal ); } @@ -578,11 +578,11 @@ void KThemeStyle::polish( TQWidget *w ) TQPalette newPal( w->palette() ); if ( isColor( IndicatorOff ) ) { - newPal.setActive( *tqcolorGroup( newPal.active(), IndicatorOff ) ); - newPal.setDisabled( *tqcolorGroup( newPal.active(), IndicatorOff ) ); + newPal.setActive( *colorGroup( newPal.active(), IndicatorOff ) ); + newPal.setDisabled( *colorGroup( newPal.active(), IndicatorOff ) ); } if ( isColor( IndicatorOn ) ) - newPal.setActive( *tqcolorGroup( newPal.active(), IndicatorOn ) ); + newPal.setActive( *colorGroup( newPal.active(), IndicatorOn ) ); w->setPalette( newPal ); } } @@ -593,12 +593,12 @@ void KThemeStyle::polish( TQWidget *w ) TQPalette newPal( w->palette() ); if ( isColor( ExIndicatorOff ) ) { - newPal.setActive( *tqcolorGroup( newPal.active(), ExIndicatorOff ) ); - newPal.setDisabled( *tqcolorGroup( newPal.active(), + newPal.setActive( *colorGroup( newPal.active(), ExIndicatorOff ) ); + newPal.setDisabled( *colorGroup( newPal.active(), ExIndicatorOff ) ); } if ( isColor( ExIndicatorOn ) ) - newPal.setActive( *tqcolorGroup( newPal.active(), ExIndicatorOn ) ); + newPal.setActive( *colorGroup( newPal.active(), ExIndicatorOn ) ); w->setPalette( newPal ); } } @@ -757,7 +757,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, TQPainter * p, const TQRe return ; } - const TQColorGroup *cg = tqcolorGroup( g, widget ); + const TQColorGroup *cg = colorGroup( g, widget ); // Standard arrow types if ( arrowType() == MotifArrow ) { @@ -791,8 +791,8 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, TQPainter * p, const TQRe p->save(); if ( flags & Style_Down ) - p->translate( tqpixelMetric( PM_ButtonShiftHorizontal ), - tqpixelMetric( PM_ButtonShiftVertical ) ); + p->translate( pixelMetric( PM_ButtonShiftHorizontal ), + pixelMetric( PM_ButtonShiftVertical ) ); if ( flags & Style_Enabled ) { @@ -846,7 +846,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, TQPainter * p, const TQRe case PE_ButtonBevel: { WidgetType type = ( sunken || on || down ) ? BevelDown : Bevel; - drawBaseButton( p, x, y, w, h, *tqcolorGroup( g, type ), ( sunken || on || down ), false, type ); + drawBaseButton( p, x, y, w, h, *colorGroup( g, type ), ( sunken || on || down ), false, type ); handled = true; break; } @@ -859,7 +859,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, TQPainter * p, const TQRe } case PE_PanelDockWindow: { - drawBaseButton( p, x, y, w, h, *tqcolorGroup( g, ToolBar ), false, false, + drawBaseButton( p, x, y, w, h, *colorGroup( g, ToolBar ), false, false, ToolBar ); handled = true; break; @@ -895,11 +895,11 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, TQPainter * p, const TQRe { if ( isPixmap( ( flags & Style_On || flags & Style_Down ) ? ExIndicatorOn : ExIndicatorOff ) ) { - const TQBitmap * tqmask = uncached( ( flags & Style_On || flags & Style_Down ) ? ExIndicatorOn : ExIndicatorOff ) ->tqmask(); - if ( tqmask ) + const TQBitmap * mask = uncached( ( flags & Style_On || flags & Style_Down ) ? ExIndicatorOn : ExIndicatorOff ) ->mask(); + if ( mask ) { p->setPen( Qt::color1 ); - p->drawPixmap( x, y, *tqmask ); + p->drawPixmap( x, y, *mask ); } else p->fillRect( x, y, w, h, TQBrush( color1, SolidPattern ) ); @@ -912,12 +912,12 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, TQPainter * p, const TQRe { if ( isPixmap( ( flags & Style_On ) ? IndicatorOn : IndicatorOff ) ) { - const TQBitmap * tqmask = uncached( ( flags & Style_On ) ? IndicatorOn : - IndicatorOff ) ->tqmask(); - if ( tqmask ) + const TQBitmap * mask = uncached( ( flags & Style_On ) ? IndicatorOn : + IndicatorOff ) ->mask(); + if ( mask ) { p->setPen( Qt::color1 ); - p->drawPixmap( x, y, *tqmask ); + p->drawPixmap( x, y, *mask ); } else p->fillRect( x, y, w, h, TQBrush( color1, SolidPattern ) ); @@ -938,7 +938,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, TQPainter * p, const TQRe } case PE_Splitter: { - drawBaseButton( p, x, y, w, h, *tqcolorGroup( g, Splitter ), false, false, + drawBaseButton( p, x, y, w, h, *colorGroup( g, Splitter ), false, false, Splitter ); handled = true; break; @@ -977,10 +977,10 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, TQPainter * p, const TQRe if ( !isPixmap( widget ) ) { - p->fillRect( r, tqcolorGroup( g, widget ) ->brush( TQColorGroup::Background ) ); + p->fillRect( r, colorGroup( g, widget ) ->brush( TQColorGroup::Background ) ); // Do the borders and frame drawShade( p, r.x(), r.y(), r.width(), - r.height(), *tqcolorGroup( g, widget ), true, false, + r.height(), *colorGroup( g, widget ), true, false, highlightWidth( widget ), borderWidth( widget ), shade() ); } else @@ -991,7 +991,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, TQPainter * p, const TQRe *scalePixmap( r.width(), r.height(), widget ) ); drawShade( p, r.x(), r.y(), r.width(), - r.height(), *tqcolorGroup( g, widget ), true, false, + r.height(), *colorGroup( g, widget ), true, false, highlightWidth( widget ), borderWidth( widget ), shade() ); } @@ -1002,12 +1002,12 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, TQPainter * p, const TQRe { bool horizontal = ( flags & Style_Horizontal ); drawBaseButton( p, r.x(), r.y(), r.width(), r.height(), - *tqcolorGroup( g, down ? ScrollButtonDown : ScrollButton ), + *colorGroup( g, down ? ScrollButtonDown : ScrollButton ), down, false, down ? ScrollButtonDown : ScrollButton ); drawPrimitive( ( horizontal ) ? PE_ArrowRight : PE_ArrowDown, p , TQRect( r.x() + 3, r.y() + 3, r.width() - 6, r.height() - 6 ), - *tqcolorGroup( g, down ? ScrollButtonDown : ScrollButton ), + *colorGroup( g, down ? ScrollButtonDown : ScrollButton ), flags ); handled = true; @@ -1017,12 +1017,12 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, TQPainter * p, const TQRe { bool horizontal = ( flags & Style_Horizontal ); drawBaseButton( p, r.x(), r.y(), r.width(), r.height(), - *tqcolorGroup( g, down ? ScrollButtonDown : ScrollButton ), + *colorGroup( g, down ? ScrollButtonDown : ScrollButton ), down, false, down ? ScrollButtonDown : ScrollButton ); drawPrimitive( ( horizontal ) ? PE_ArrowLeft : PE_ArrowUp, p , TQRect( r.x() + 3, r.y() + 3, r.width() - 6, r.height() - 6 ), - *tqcolorGroup( g, down ? ScrollButtonDown : ScrollButton ), + *colorGroup( g, down ? ScrollButtonDown : ScrollButton ), flags ); handled = true; break; @@ -1038,7 +1038,7 @@ void KThemeStyle::drawPrimitive ( PrimitiveElement pe, TQPainter * p, const TQRe active ? HScrollBarSliderDown : HScrollBarSlider : active ? VScrollBarSliderDown : VScrollBarSlider; drawBaseButton( p, r.x()+offsetH, r.y()+offsetV, r.width()-2*offsetH, - r.height()-2*offsetV, *tqcolorGroup( g, widget ), active, false, + r.height()-2*offsetV, *colorGroup( g, widget ), active, false, widget ); int spaceW = horizontal ? r.width() - decoWidth( widget ) - 4 : @@ -1086,7 +1086,7 @@ TQPixmap* KThemeStyle::makeMenuBarCache(int w, int h) const return menuCache; } - const TQColorGroup *g = tqcolorGroup( TQApplication::palette().active(), MenuBar); + const TQColorGroup *g = colorGroup( TQApplication::palette().active(), MenuBar); menuCache = new TQPixmap ( w, h ); TQPainter p(menuCache); @@ -1096,7 +1096,7 @@ TQPixmap* KThemeStyle::makeMenuBarCache(int w, int h) const } -void KThemeStyle::tqdrawControl( ControlElement element, +void KThemeStyle::drawControl( ControlElement element, TQPainter *p, const TQWidget *widget, const TQRect &r, @@ -1115,9 +1115,9 @@ void KThemeStyle::tqdrawControl( ControlElement element, { const TQPushButton * btn = ( const TQPushButton* ) widget; bool sunken = btn->isOn() || btn->isDown(); - int diw = tqpixelMetric( PM_ButtonDefaultIndicator, btn ); + int diw = pixelMetric( PM_ButtonDefaultIndicator, btn ); drawBaseButton( p, diw, diw, w - 2 * diw, h - 2 * diw, - *tqcolorGroup( btn->tqcolorGroup(), sunken ? PushButtonDown : + *colorGroup( btn->colorGroup(), sunken ? PushButtonDown : PushButton ), sunken, roundButton(), sunken ? PushButtonDown : PushButton ); // TODO if diw, draw fancy default button indicator @@ -1134,15 +1134,15 @@ void KThemeStyle::tqdrawControl( ControlElement element, // Shift button contents if pushed. if ( active ) { - x += tqpixelMetric( PM_ButtonShiftHorizontal, widget ); - y += tqpixelMetric( PM_ButtonShiftVertical, widget ); + x += pixelMetric( PM_ButtonShiftHorizontal, widget ); + y += pixelMetric( PM_ButtonShiftVertical, widget ); how |= Style_Sunken; } // Does the button have a popup menu? if ( button->isMenuButton() ) { - int dx = tqpixelMetric( PM_MenuButtonIndicator, widget ); + int dx = pixelMetric( PM_MenuButtonIndicator, widget ); drawPrimitive( PE_ArrowDown, p, TQRect( x + w - dx - 2, y + 2, dx, h - 4 ), cg, how, opt ); w -= dx; @@ -1177,49 +1177,49 @@ void KThemeStyle::tqdrawControl( ControlElement element, if ( active || button->isDefault() && button->isEnabled() ) { // Draw "fake" bold text - this enables the font metrics to remain - // the same as computed in TQPushButton::tqsizeHint(), but gives + // the same as computed in TQPushButton::sizeHint(), but gives // a reasonable bold effect. int i; // Text shadow for ( i = 0; i < 2; i++ ) drawItem( p, TQRect( x + i + 1, y + 1, w, h ), AlignCenter | ShowPrefix, - button->tqcolorGroup(), button->isEnabled(), NULL, + button->colorGroup(), button->isEnabled(), NULL, button->text(), -1, - active ? &button->tqcolorGroup().dark() : &button->tqcolorGroup().mid() ); + active ? &button->colorGroup().dark() : &button->colorGroup().mid() ); // Normal Text for ( i = 0; i < 2; i++ ) drawItem( p, TQRect( x + i, y, w, h ), AlignCenter | ShowPrefix, - button->tqcolorGroup(), true, i == 0 ? button->pixmap() : NULL, + button->colorGroup(), true, i == 0 ? button->pixmap() : NULL, button->text(), -1, - active ? &button->tqcolorGroup().light() : &button->tqcolorGroup().buttonText() ); + active ? &button->colorGroup().light() : &button->colorGroup().buttonText() ); } else { if ( button->isEnabled() ) { - drawItem( p, TQRect( x, y, w, h ), AlignCenter | ShowPrefix, button->tqcolorGroup(), + drawItem( p, TQRect( x, y, w, h ), AlignCenter | ShowPrefix, button->colorGroup(), true, button->pixmap(), button->text(), -1, - active ? &button->tqcolorGroup().light() : &button->tqcolorGroup().buttonText() ); + active ? &button->colorGroup().light() : &button->colorGroup().buttonText() ); } else { //TODO: Handle reversed - drawItem( p, TQRect( x + 1, y + 1, w, h ), AlignCenter | ShowPrefix, button->tqcolorGroup(), + drawItem( p, TQRect( x + 1, y + 1, w, h ), AlignCenter | ShowPrefix, button->colorGroup(), true, button->pixmap(), button->text(), -1, - &button->tqcolorGroup().light() ); + &button->colorGroup().light() ); - drawItem( p, TQRect( x, y, w, h ), AlignCenter | ShowPrefix, button->tqcolorGroup(), + drawItem( p, TQRect( x, y, w, h ), AlignCenter | ShowPrefix, button->colorGroup(), true, button->pixmap(), button->text(), -1, - &button->tqcolorGroup().buttonText() ); + &button->colorGroup().buttonText() ); } } // Draw a focus rect if the button has focus if ( how & Style_HasFocus ) drawPrimitive( PE_FocusRect, p, - TQStyle::tqvisualRect( subRect( SR_PushButtonFocusRect, widget ), widget ), + TQStyle::visualRect( subRect( SR_PushButtonFocusRect, widget ), widget ), cg, how ); handled = true; break; @@ -1238,10 +1238,10 @@ void KThemeStyle::tqdrawControl( ControlElement element, case CE_TabBarTab: { const TQTabBar* tb = ( const TQTabBar* ) widget; - TQTabBar::Shape tbs = tb->tqshape(); + TQTabBar::Shape tbs = tb->shape(); bool selected = how & Style_Selected; WidgetType widget = selected ? ActiveTab : InactiveTab; - const TQColorGroup *cg = tqcolorGroup( tb->tqcolorGroup(), widget ); + const TQColorGroup *cg = colorGroup( tb->colorGroup(), widget ); int i; int x2 = x + w - 1, y2 = y + h - 1; int bWidth = borderWidth( widget ); @@ -1314,8 +1314,8 @@ void KThemeStyle::tqdrawControl( ControlElement element, else p->fillRect( x, y, x2 - x + 1, y2 - y + 1, cg->background() ); } - else if ( tb->tqshape() == TQTabBar::RoundedBelow || - tb->tqshape() == TQTabBar::TriangularBelow ) + else if ( tb->shape() == TQTabBar::RoundedBelow || + tb->shape() == TQTabBar::TriangularBelow ) { if ( widget == ActiveTab ) widget = RotActiveTab; @@ -1397,7 +1397,7 @@ void KThemeStyle::tqdrawControl( ControlElement element, TQRect pr = mb->rect(); bool active = how & Style_Active; //bool focused = how & Style_HasFocus; - const TQColorGroup *g = tqcolorGroup( cg, active ? MenuBarItem : MenuBar ); + const TQColorGroup *g = colorGroup( cg, active ? MenuBarItem : MenuBar ); TQColor btext = g->buttonText(); TQPixmap* cache = makeMenuBarCache(pr.width(), pr.height()); @@ -1439,10 +1439,10 @@ void KThemeStyle::tqdrawControl( ControlElement element, bool enabled = (mi? mi->isEnabled():true); bool checkable = popupmenu->isCheckable(); bool active = how & Style_Active; - bool etchtext = tqstyleHint( SH_EtchDisabledText, 0 ); + bool etchtext = styleHint( SH_EtchDisabledText, 0 ); bool reverse = TQApplication::reverseLayout(); - const TQColorGroup& cg_ours = *tqcolorGroup( cg, active ? MenuItemDown : MenuItem ); + const TQColorGroup& cg_ours = *colorGroup( cg, active ? MenuItemDown : MenuItem ); //TQColor btext = cg_ours.buttonText(); @@ -1464,7 +1464,7 @@ void KThemeStyle::tqdrawControl( ControlElement element, drawBaseButton( p, x, y, w, h, cg_ours, true, false, MenuItemDown ); else { - drawShade( p, x, y, w, h, *tqcolorGroup( cg_ours, MenuItem ), false, false, + drawShade( p, x, y, w, h, *colorGroup( cg_ours, MenuItem ), false, false, highlightWidth( MenuItem ), borderWidth( MenuItem ), shade() ); int dw = decoWidth( MenuItem ); @@ -1474,7 +1474,7 @@ void KThemeStyle::tqdrawControl( ControlElement element, x + dw, y + dw, w - dw * 2, h - dw * 2, cg_ours.brush( TQColorGroup::Background ) ); //cg.brush( TQColorGroup::Background )); - //tqcolorGroup( cg_ours, MenuItem ) ->brush( TQColorGroup::Background ) ); + //colorGroup( cg_ours, MenuItem ) ->brush( TQColorGroup::Background ) ); } else { @@ -1492,7 +1492,7 @@ void KThemeStyle::tqdrawControl( ControlElement element, if ( mi->iconSet() ) { TQIconSet::Mode mode; - TQRect cr = tqvisualRect( TQRect( x, y, checkcol, h ), r ); + TQRect cr = visualRect( TQRect( x, y, checkcol, h ), r ); // Select the correct icon from the iconset if ( active ) @@ -1503,7 +1503,7 @@ void KThemeStyle::tqdrawControl( ControlElement element, // Do we have an icon and are checked at the same time? // Then draw a "pressed" background behind the icon if ( checkable && mi->isChecked() ) //!active && -- ?? - drawBaseButton( p, cr.x(), cr.y(), cr.width(), cr.height(), *tqcolorGroup( cg_ours, BevelDown ), true, false, BevelDown ); + drawBaseButton( p, cr.x(), cr.y(), cr.width(), cr.height(), *colorGroup( cg_ours, BevelDown ), true, false, BevelDown ); // Draw the icon TQPixmap pixmap = mi->iconSet() ->pixmap( TQIconSet::Small, mode ); @@ -1580,7 +1580,7 @@ void KThemeStyle::tqdrawControl( ControlElement element, // Does the menu item have a text label? if ( !s.isNull() ) { - int t = s.tqfind( '\t' ); + int t = s.find( '\t' ); int m = itemVMargin; int text_flags = AlignVCenter | ShowPrefix | DontClip | SingleLine; text_flags |= reverse ? AlignRight : AlignLeft; @@ -1643,7 +1643,7 @@ void KThemeStyle::tqdrawControl( ControlElement element, { PrimitiveElement arrow = reverse ? PE_ArrowLeft : PE_ArrowRight; int dim = 10 - itemFrame; //We're not very useful to inherit off, so just hardcode.. - TQRect vr = tqvisualRect( TQRect( x + w - arrowHMargin - itemFrame - dim, + TQRect vr = visualRect( TQRect( x + w - arrowHMargin - itemFrame - dim, y + h / 2 - dim / 2, dim, dim ), r ); // Draw an arrow at the far end of the menu item @@ -1667,7 +1667,7 @@ void KThemeStyle::tqdrawControl( ControlElement element, case CE_ProgressBarGroove: { TQBrush bg; - const TQColorGroup * cg2 = tqcolorGroup( cg, ProgressBg ); + const TQColorGroup * cg2 = colorGroup( cg, ProgressBg ); qDrawWinPanel( p, r, *cg2, true ); bg.setColor( cg2->color( TQColorGroup::Background ) ); if ( isPixmap( ProgressBg ) ) @@ -1714,13 +1714,13 @@ void KThemeStyle::tqdrawControl( ControlElement element, } if ( !reverse ) - drawBaseButton( p, x + pstep, y, width, h, *tqcolorGroup( cg, ProgressBar ), false, false, ProgressBar ); + drawBaseButton( p, x + pstep, y, width, h, *colorGroup( cg, ProgressBar ), false, false, ProgressBar ); else { //TODO:Optimize TQPixmap buf( width, h ); TQPainter p2( &buf ); - drawBaseButton( &p2, 0, 0, width, h, *tqcolorGroup( cg, ProgressBar ), false, false, ProgressBar ); + drawBaseButton( &p2, 0, 0, width, h, *colorGroup( cg, ProgressBar ), false, false, ProgressBar ); p2.end(); TQPixmap mirroredPix = TQPixmap( buf.convertToImage().mirror( true, false ) ); bitBlt( p->device(), x + w - width - pstep, y, &mirroredPix ); @@ -1735,12 +1735,12 @@ void KThemeStyle::tqdrawControl( ControlElement element, }; if ( !handled ) - KThemeBase::tqdrawControl( element, + KThemeBase::drawControl( element, p, widget, r, cg, how, opt ); } -void KThemeStyle::tqdrawControlMask( ControlElement element, +void KThemeStyle::drawControlMask( ControlElement element, TQPainter *p, const TQWidget *widget, const TQRect &r, @@ -1764,7 +1764,7 @@ void KThemeStyle::tqdrawControlMask( ControlElement element, }; if ( !handled ) - KThemeBase::tqdrawControlMask( element, + KThemeBase::drawControlMask( element, p, widget, r, opt ); } @@ -1791,12 +1791,12 @@ void KThemeStyle::drawKStylePrimitive( KStylePrimitive kpe, bool horizontal = slider->orientation() == Horizontal; if ( horizontal ) { - drawBaseButton( p, x, y, w, h, *tqcolorGroup( cg, SliderGroove ), true, + drawBaseButton( p, x, y, w, h, *colorGroup( cg, SliderGroove ), true, false, SliderGroove ); } else { - drawBaseButton( p, x, y, w, h, *tqcolorGroup( cg, RotSliderGroove ), true, + drawBaseButton( p, x, y, w, h, *colorGroup( cg, RotSliderGroove ), true, false, RotSliderGroove ); } } @@ -1853,8 +1853,8 @@ void KThemeStyle::drawKStylePrimitive( KStylePrimitive kpe, TQWMatrix r270; r270.rotate( 270 ); vsliderCache = new TQPixmap( uncached( Slider ) ->xForm( r270 ) ); - if ( uncached( Slider ) ->tqmask() ) - vsliderCache->setMask( uncached( Slider ) ->tqmask() ->xForm( r270 ) ); + if ( uncached( Slider ) ->mask() ) + vsliderCache->setMask( uncached( Slider ) ->mask() ->xForm( r270 ) ); } bitBlt( p->device(), x + ( w - vsliderCache->width() ) / 2, y, vsliderCache ); @@ -1925,10 +1925,10 @@ void KThemeStyle::drawKStylePrimitive( KStylePrimitive kpe, case KPE_GeneralHandle: { if ( w > h ) - drawBaseButton( p, x, y, w, h, *tqcolorGroup( cg, HBarHandle ), false, false, + drawBaseButton( p, x, y, w, h, *colorGroup( cg, HBarHandle ), false, false, HBarHandle ); else - drawBaseButton( p, x, y, w, h, *tqcolorGroup( cg, VBarHandle ), false, false, + drawBaseButton( p, x, y, w, h, *colorGroup( cg, VBarHandle ), false, false, VBarHandle ); handled = true; @@ -1950,7 +1950,7 @@ void KThemeStyle::drawKStylePrimitive( KStylePrimitive kpe, -void KThemeStyle::tqdrawComplexControl ( ComplexControl control, TQPainter * p, const TQWidget * widget, +void KThemeStyle::drawComplexControl ( ComplexControl control, TQPainter * p, const TQWidget * widget, const TQRect & r, const TQColorGroup & g, SFlags how , SCFlags controls, SCFlags active, const TQStyleOption & opt ) const @@ -1977,7 +1977,7 @@ void KThemeStyle::tqdrawComplexControl ( ComplexControl control, TQPainter * p, { WidgetType widget = ( down || on ) ? ToolButtonDown : ToolButton; - drawBaseButton( p, button.x(), button.y(), button.width(), button.height(), *tqcolorGroup( g, widget ), down || on, false, + drawBaseButton( p, button.x(), button.y(), button.width(), button.height(), *colorGroup( g, widget ), down || on, false, widget ); // int m = decoWidth( widget ); @@ -2013,7 +2013,7 @@ void KThemeStyle::tqdrawComplexControl ( ComplexControl control, TQPainter * p, bool sunken = ( active == SC_ComboBoxArrow ); //No frame, edit box and button for now? WidgetType widget = sunken ? ComboBoxDown : ComboBox; - drawBaseButton( p, x, y, w, h, *tqcolorGroup( g, widget ), sunken, + drawBaseButton( p, x, y, w, h, *colorGroup( g, widget ), sunken, roundComboBox(), widget ); controls ^= SC_ComboBoxFrame; @@ -2022,7 +2022,7 @@ void KThemeStyle::tqdrawComplexControl ( ComplexControl control, TQPainter * p, if ( controls & SC_ComboBoxArrow ) { bool sunken = ( active == SC_ComboBoxArrow ); - TQRect ar = TQStyle::tqvisualRect( + TQRect ar = TQStyle::visualRect( querySubControlMetrics( CC_ComboBox, widget, SC_ComboBoxArrow ), widget ); ar.rect( &x, &y, &w, &h ); @@ -2041,8 +2041,8 @@ void KThemeStyle::tqdrawComplexControl ( ComplexControl control, TQPainter * p, else { - mtfstyle->drawPrimitive( PE_ArrowDown, p, TQRect( x, y, w, h ), *tqcolorGroup( g, widget ), sunken ? ( how | Style_Sunken ) : how, opt ); - qDrawShadeRect( p, x, y, w, h, *tqcolorGroup( g, widget ) ); //w-14, y+7+(h-15), 10, 3, + mtfstyle->drawPrimitive( PE_ArrowDown, p, TQRect( x, y, w, h ), *colorGroup( g, widget ), sunken ? ( how | Style_Sunken ) : how, opt ); + qDrawShadeRect( p, x, y, w, h, *colorGroup( g, widget ) ); //w-14, y+7+(h-15), 10, 3, } controls ^= SC_ComboBoxArrow; } @@ -2115,7 +2115,7 @@ void KThemeStyle::tqdrawComplexControl ( ComplexControl control, TQPainter * p, if ( !handled ) { - KThemeBase::tqdrawComplexControl ( control, p, widget, + KThemeBase::drawComplexControl ( control, p, widget, r, g, how , controls, active, opt ); @@ -2184,7 +2184,7 @@ void KThemeStyle::drawBaseMask( TQPainter *p, int x, int y, int w, int h, p->fillRect( x, y, w, h, fillBrush ); } -int KThemeStyle::tqstyleHint( StyleHint sh, const TQWidget *w, const TQStyleOption &opt, QStyleHintReturn *shr ) const +int KThemeStyle::styleHint( StyleHint sh, const TQWidget *w, const TQStyleOption &opt, QStyleHintReturn *shr ) const { switch ( sh ) { @@ -2206,7 +2206,7 @@ int KThemeStyle::tqstyleHint( StyleHint sh, const TQWidget *w, const TQStyleOpti return NoBackground; default: - return KThemeBase::tqstyleHint( sh, w, opt, shr ); + return KThemeBase::styleHint( sh, w, opt, shr ); }; } @@ -2381,4 +2381,4 @@ int KThemeStyle::popupMenuItemHeight( bool /*checkable*/, TQMenuItem *mi, } #include "kthemestyle.moc" -// kate: indent-width 4; tqreplace-tabs off; tab-width 4; space-indent on; +// kate: indent-width 4; replace-tabs off; tab-width 4; space-indent on; diff --git a/kstyles/kthemestyle/kthemestyle.h b/kstyles/kthemestyle/kthemestyle.h index 37483a804..00d6256e7 100644 --- a/kstyles/kthemestyle/kthemestyle.h +++ b/kstyles/kthemestyle/kthemestyle.h @@ -79,13 +79,13 @@ public: KThemeStyle( const TQString& configDir, const TQString &configFile = TQString::null ); ~KThemeStyle(); - virtual int tqpixelMetric ( PixelMetric metric, const TQWidget * widget = 0 ) const; + virtual int pixelMetric ( PixelMetric metric, const TQWidget * widget = 0 ) const; virtual void drawPrimitive ( PrimitiveElement pe, TQPainter * p, const TQRect & r, const TQColorGroup & cg, SFlags flags = Style_Default, const TQStyleOption& = TQStyleOption::Default ) const; - virtual void tqdrawControl( ControlElement element, + virtual void drawControl( ControlElement element, TQPainter *p, const TQWidget *widget, const TQRect &r, @@ -93,14 +93,14 @@ public: SFlags how = Style_Default, const TQStyleOption& = TQStyleOption::Default ) const; - virtual void tqdrawControlMask( ControlElement element, + virtual void drawControlMask( ControlElement element, TQPainter *p, const TQWidget *widget, const TQRect &r, const TQStyleOption& = TQStyleOption::Default ) const; - virtual void tqdrawComplexControl( ComplexControl control, + virtual void drawComplexControl( ComplexControl control, TQPainter *p, const TQWidget* widget, const TQRect &r, @@ -119,7 +119,7 @@ public: const TQStyleOption& = TQStyleOption::Default ) const; - virtual int tqstyleHint( StyleHint sh, + virtual int styleHint( StyleHint sh, const TQWidget *widget = 0, const TQStyleOption& = TQStyleOption::Default, QStyleHintReturn* returnData = 0 ) const; @@ -165,7 +165,7 @@ public: const TQColorGroup &g, bool sunken = false, bool rounded = false, WidgetType type = Bevel ) const; /** - * Draw a tqmask with for widgets that may be rounded. + * Draw a mask with for widgets that may be rounded. * *Currently used * by pushbuttons and comboboxes. @@ -192,7 +192,7 @@ public: * @param w The rectangle width. * @param h The rectangle height. * @param sunken Draws a sunken style if @p true. - * @param rounded Draws a rounded tqshape if @p true. Requires bWidth to be + * @param rounded Draws a rounded shape if @p true. Requires bWidth to be * at least 1. * @param hWidth The highlight width. * @param bWidth The border width. |