diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2016-03-25 20:03:28 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2016-03-25 20:03:28 +0100 |
commit | 2ee99ab520931c5efe91123c85ba10064a45e95d (patch) | |
tree | a367666e410de28d0f258aed77b11e17cafb28e4 /style/baghira.cpp | |
parent | cfa36e1a95e82492c17225ff376911abb3688f62 (diff) | |
download | tde-style-baghira-2ee99ab520931c5efe91123c85ba10064a45e95d.tar.gz tde-style-baghira-2ee99ab520931c5efe91123c85ba10064a45e95d.zip |
Initial TQt conversion
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'style/baghira.cpp')
-rw-r--r-- | style/baghira.cpp | 930 |
1 files changed, 465 insertions, 465 deletions
diff --git a/style/baghira.cpp b/style/baghira.cpp index bae1611..bb61570 100644 --- a/style/baghira.cpp +++ b/style/baghira.cpp @@ -3,54 +3,54 @@ #include "pixmaps.h" //#include "../deco/baghiradecobuttons.h" -#include <qapplication.h> -#include <qbitmap.h> -#include <qbrush.h> -#include <qbutton.h> -#include <qcleanuphandler.h> -#include <qcolor.h> -#include <qcombobox.h> -//#include <qevent.h> -#include <qfont.h> -#include <qframe.h> -#include <qgroupbox.h> -#include <qheader.h> -#include <qiconset.h> -#include <qimage.h> -#include <qlayout.h> -#include <qlistbox.h> -#include <qlistview.h> -#include <qmenubar.h> -#include <qobject.h> -#include <qobjectlist.h> -#include <qpaintdevice.h> -#include <qpainter.h> -#include <qpalette.h> -#include <qpen.h> -#include <qpoint.h> -#include <qpopupmenu.h> -#include <qpushbutton.h> -//#include <qrangecontrol.h> -#include <qrect.h> -#include <qscrollbar.h> -#include <qscrollview.h> -#include <qsize.h> -#include <qslider.h> -#include <qstring.h> -#include <qstyleplugin.h> -#include <qtabbar.h> -#include <qtabwidget.h> -#include <qvariant.h> +#include <tqapplication.h> +#include <tqbitmap.h> +#include <tqbrush.h> +#include <tqbutton.h> +#include <tqcleanuphandler.h> +#include <tqcolor.h> +#include <tqcombobox.h> +//#include <tqevent.h> +#include <tqfont.h> +#include <tqframe.h> +#include <tqgroupbox.h> +#include <tqheader.h> +#include <tqiconset.h> +#include <tqimage.h> +#include <tqlayout.h> +#include <tqlistbox.h> +#include <tqlistview.h> +#include <tqmenubar.h> +#include <tqobject.h> +#include <tqobjectlist.h> +#include <tqpaintdevice.h> +#include <tqpainter.h> +#include <tqpalette.h> +#include <tqpen.h> +#include <tqpoint.h> +#include <tqpopupmenu.h> +#include <tqpushbutton.h> +//#include <tqrangecontrol.h> +#include <tqrect.h> +#include <tqscrollbar.h> +#include <tqscrollview.h> +#include <tqsize.h> +#include <tqslider.h> +#include <tqstring.h> +#include <tqstyleplugin.h> +#include <tqtabbar.h> +#include <tqtabwidget.h> +#include <tqvariant.h> #include <ktoolbar.h> #include <ktoolbarbutton.h> #include <kwordwrap.h> #include "config.h" -#define PRINTDEVICE(p) qWarning("device is %s", (p->device()->devType() == QInternal::Widget) ?\ -"Widget": (p->device()->devType() == QInternal::Pixmap) ?\ -"Pixmap": (p->device()->devType() == QInternal::Printer) ?\ -"Printer": (p->device()->devType() == QInternal::Picture) ?\ -"Picture": (p->device()->devType() == QInternal::UndefinedDevice) ?\ +#define PRINTDEVICE(p) tqWarning("device is %s", (p->device()->devType() == TQInternal::Widget) ?\ +"Widget": (p->device()->devType() == TQInternal::Pixmap) ?\ +"Pixmap": (p->device()->devType() == TQInternal::Printer) ?\ +"Printer": (p->device()->devType() == TQInternal::Picture) ?\ +"Picture": (p->device()->devType() == TQInternal::UndefinedDevice) ?\ "UndefinedDevice": "fuckdevice!" ); #define GCC_VERSION (__GNUC__ * 10000 \ @@ -73,19 +73,19 @@ int OptionHandler::menuOpacity; bool OptionHandler::menuColorButton; bool OptionHandler::shadowText; //color -QColor OptionHandler::customButtonColor, OptionHandler::menuStripeColor_; +TQColor OptionHandler::customButtonColor, OptionHandler::menuStripeColor_; //widgets bool OptionHandler::customWidgetColor; -QColor OptionHandler::customColors[ 10 ]; +TQColor OptionHandler::customColors[ 10 ]; //menu bool OptionHandler::useCustomMenuColor; -QColor OptionHandler::color, OptionHandler::color2, OptionHandler::colorHigh, OptionHandler::fgColor, OptionHandler::fgColorHigh; +TQColor OptionHandler::color, OptionHandler::color2, OptionHandler::colorHigh, OptionHandler::fgColor, OptionHandler::fgColorHigh; //Panel // bool OptionHandler::panelCustom; -// QColor OptionHandler::customPanelColor; +// TQColor OptionHandler::customPanelColor; //incativeButton int OptionHandler::inactiveButtonColor; -QColor OptionHandler::customInactiveButtonColor; +TQColor OptionHandler::customInactiveButtonColor; //Design //stipples @@ -98,7 +98,7 @@ int OptionHandler::shadowDarkness; //istviews; bool OptionHandler::drawDotlines, OptionHandler::useCustomExpanderColor; int OptionHandler::expanderStyle; -QColor OptionHandler::expanderColor, OptionHandler::dotlineColor; +TQColor OptionHandler::expanderColor, OptionHandler::dotlineColor; int OptionHandler::dotlineStyle; //slider bool OptionHandler::squeezesbslider; @@ -117,18 +117,18 @@ int OptionHandler::progressBar; bool OptionHandler::removeKickerBevel; Style OptionHandler::_toolbuttonStyle; bool OptionHandler::drawProgressLabel; -QColor OptionHandler::brushTint; -QColor OptionHandler::aDecoColor1_; -QColor OptionHandler::aDecoColor2_; -QColor OptionHandler::titleColor_[2]; -QColor OptionHandler::titleButtonColor_[3]; +TQColor OptionHandler::brushTint; +TQColor OptionHandler::aDecoColor1_; +TQColor OptionHandler::aDecoColor2_; +TQColor OptionHandler::titleColor_[2]; +TQColor OptionHandler::titleButtonColor_[3]; bool OptionHandler::tintBrush; tabStyle OptionHandler::tabStyle_; unsigned long OptionHandler::wmDesign; bool OptionHandler::animateButton; int OptionHandler::custCols[8]; -QPixmap LiquidStyle::popupBack; +TQPixmap LiquidStyle::popupBack; //============ @@ -137,12 +137,12 @@ class KAccessToolBarButton : public KToolBarButton // to get me access to the toolbbar friend class LiquidStyle; public: - KAccessToolBarButton( QWidget* parent=0, const char* name=0 ) + KAccessToolBarButton( TQWidget* parent=0, const char* name=0 ) : KToolBarButton( parent, name ) {} }; -class LiquidStylePlugin : public QStylePlugin { +class LiquidStylePlugin : public TQStylePlugin { public: LiquidStylePlugin() { ; @@ -151,13 +151,13 @@ class LiquidStylePlugin : public QStylePlugin { ; } - QStringList keys() const { - return ( QStringList() << "Baghira" ); + TQStringList keys() const { + return ( TQStringList() << "Baghira" ); } - QStyle *create( const QString & ); + TQStyle *create( const TQString & ); }; -QStyle *LiquidStylePlugin::create( const QString &s ) { +TQStyle *LiquidStylePlugin::create( const TQString &s ) { if ( s.lower() == "baghira" ) return ( new LiquidStyle() ); return ( 0 ); @@ -174,10 +174,10 @@ static const int rightBorder = 12; LiquidStyle::LiquidStyle() : KStyle( AllowMenuTransparency | FilledFrameWorkaround, ThreeButtonScrollBar ) { - QIntDict<ButtonFadeInfo>bfi(31);// assuming 31 btns will be enough - a pointer list would be more accurate, but we need to lookup this every 50ms... - QIntDict<ButtonTile>btnShadowedDict(223);// we need around 10/color, 3 colors/button assuming 10 different colors (e.g. kcalc) - QIntDict<ButtonTile>buttonGlowDict(109); - QIntDict<ButtonTile>buttonDict(331); + TQIntDict<ButtonFadeInfo>bfi(31);// assuming 31 btns will be enough - a pointer list would be more accurate, but we need to lookup this every 50ms... + TQIntDict<ButtonTile>btnShadowedDict(223);// we need around 10/color, 3 colors/button assuming 10 different colors (e.g. kcalc) + TQIntDict<ButtonTile>buttonGlowDict(109); + TQIntDict<ButtonTile>buttonDict(331); headerHoverID = -1; headerSortID = -1; hoveredTabIndex = -1; @@ -206,16 +206,16 @@ LiquidStyle::LiquidStyle() : KStyle( AllowMenuTransparency | FilledFrameWorkarou progAnimShift = 0; prog2AnimShift = 0; sliderAnimShift = 0; - QTimer* timer = new QTimer( this ); + TQTimer* timer = new TQTimer( this ); timer->start(50, false); // if (optionHandler->AnimateProgress()) connect(timer, SIGNAL(timeout()), this, SLOT(updateProgressPos())); activeScroller = NULL; //-------------------------------------- - tooltipPalette = qApp->palette(); - tooltipPalette.setBrush( QColorGroup::Background, QColor( 255, 255, 220 ) ); - tooltipPalette.setBrush( QColorGroup::Foreground, Qt::black ); + tooltipPalette = tqApp->palette(); + tooltipPalette.setBrush( TQColorGroup::Background, TQColor( 255, 255, 220 ) ); + tooltipPalette.setBrush( TQColorGroup::Foreground, TQt::black ); rMatrix.rotate( 90.0 ); lMatrix.rotate( 270.0 ); @@ -232,58 +232,58 @@ LiquidStyle::LiquidStyle() : KStyle( AllowMenuTransparency | FilledFrameWorkarou switch (optionHandler->buttonStyle()) { case Jaguar: - btnBorderImg = new QImage( uic_findImage("button-jaguar") ); - btnShadowImg = new QImage( uic_findImage( "button-shadow" ) ); - buttonGlow = new QImage( uic_findImage( "button-glow" ) ); - combo = new QImage( uic_findImage("combo-jaguar") ); - comboShadow = new QImage( uic_findImage( "combo-shadow" ) ); + btnBorderImg = new TQImage( uic_findImage("button-jaguar") ); + btnShadowImg = new TQImage( uic_findImage( "button-shadow" ) ); + buttonGlow = new TQImage( uic_findImage( "button-glow" ) ); + combo = new TQImage( uic_findImage("combo-jaguar") ); + comboShadow = new TQImage( uic_findImage( "combo-shadow" ) ); if (optionHandler->toolbuttonStyle() == Brushed || !optionHandler->SmoothListViewHeaders()) - rectbutton = new QImage( uic_findImage( "rectbutton" ) ); + rectbutton = new TQImage( uic_findImage( "rectbutton" ) ); else rectbutton = 0L; break; case Panther: case Tiger: - btnBorderImg = new QImage( uic_findImage("button-base") ); - btnShadowImg = new QImage( uic_findImage( "button-shadow" ) ); - buttonGlow = new QImage( uic_findImage( "button-glow" ) ); - combo = new QImage( uic_findImage("combo") ); - comboShadow = new QImage( uic_findImage( "combo-shadow" ) ); + btnBorderImg = new TQImage( uic_findImage("button-base") ); + btnShadowImg = new TQImage( uic_findImage( "button-shadow" ) ); + buttonGlow = new TQImage( uic_findImage( "button-glow" ) ); + combo = new TQImage( uic_findImage("combo") ); + comboShadow = new TQImage( uic_findImage( "combo-shadow" ) ); if (optionHandler->toolbuttonStyle() == Brushed || !optionHandler->SmoothListViewHeaders()) - rectbutton = new QImage( uic_findImage( "rectbutton" ) ); + rectbutton = new TQImage( uic_findImage( "rectbutton" ) ); else rectbutton = 0L; break; case Brushed: btnBorderImg = 0L; btnShadowImg = 0L; buttonGlow = 0L; - rectbutton = new QImage( uic_findImage( "rectbutton" ) ); + rectbutton = new TQImage( uic_findImage( "rectbutton" ) ); switch (optionHandler->toolbuttonStyle()) { case Jaguar: - combo = new QImage( uic_findImage("combo-jaguar") ); - comboShadow = new QImage( uic_findImage( "combo-shadow" ) ); + combo = new TQImage( uic_findImage("combo-jaguar") ); + comboShadow = new TQImage( uic_findImage( "combo-shadow" ) ); break; case Panther: case Tiger: case Brushed: - combo = new QImage( uic_findImage("combo") ); - comboShadow = new QImage( uic_findImage( "combo-shadow" ) ); + combo = new TQImage( uic_findImage("combo") ); + comboShadow = new TQImage( uic_findImage( "combo-shadow" ) ); break; case Milk: - combo = new QImage( uic_findImage("combo-milk") ); - comboShadow = new QImage( uic_findImage( "combo-shadow" ) ); + combo = new TQImage( uic_findImage("combo-milk") ); + comboShadow = new TQImage( uic_findImage( "combo-shadow" ) ); default: break; } break; case Milk: - btnBorderImg = new QImage( uic_findImage("button-milk") ); + btnBorderImg = new TQImage( uic_findImage("button-milk") ); btnShadowImg = 0L; buttonGlow = 0L; - combo = new QImage( uic_findImage("combo-milk") ); - comboShadow = new QImage( uic_findImage( "combo-shadow" ) ); + combo = new TQImage( uic_findImage("combo-milk") ); + comboShadow = new TQImage( uic_findImage( "combo-shadow" ) ); if (optionHandler->toolbuttonStyle() == Brushed || !optionHandler->SmoothListViewHeaders()) - rectbutton = new QImage( uic_findImage( "rectbutton" ) ); + rectbutton = new TQImage( uic_findImage( "rectbutton" ) ); else rectbutton = 0L; default: break; @@ -309,13 +309,13 @@ LiquidStyle::LiquidStyle() : KStyle( AllowMenuTransparency | FilledFrameWorkarou if (optionHandler->style() == Milk) { - slider_top = new QImage( uic_findImage( "sbslider_top-milk" ) ); - slider_btm = new QImage( uic_findImage( "sbslider_btm-milk" ) ); + slider_top = new TQImage( uic_findImage( "sbslider_top-milk" ) ); + slider_btm = new TQImage( uic_findImage( "sbslider_btm-milk" ) ); } else { - slider_top = new QImage( uic_findImage( "sbslider_top" ) ); - slider_btm = new QImage( uic_findImage( "sbslider_btm" ) ); + slider_top = new TQImage( uic_findImage( "sbslider_top" ) ); + slider_btm = new TQImage( uic_findImage( "sbslider_btm" ) ); } if ( slider_top->depth() < 32 ) @@ -326,11 +326,11 @@ LiquidStyle::LiquidStyle() : KStyle( AllowMenuTransparency | FilledFrameWorkarou if (optionHandler->shadowSbSlider()) { - slider_top_shd = new QImage( uic_findImage( "sbslider_top_shd" ) ); + slider_top_shd = new TQImage( uic_findImage( "sbslider_top_shd" ) ); if ( slider_top_shd->depth() < 32 ) * slider_top_shd = slider_top_shd->convertDepth( 32 ); - slider_btm_shd = new QImage( uic_findImage( "sbslider_btm_shd" ) ); + slider_btm_shd = new TQImage( uic_findImage( "sbslider_btm_shd" ) ); if ( slider_btm_shd->depth() < 32 ) * slider_btm_shd = slider_btm_shd->convertDepth( 32 ); } @@ -340,7 +340,7 @@ LiquidStyle::LiquidStyle() : KStyle( AllowMenuTransparency | FilledFrameWorkarou slider_btm_shd = 0L; } - roundFrame = new QImage( uic_findImage( "roundFrame" ) ); + roundFrame = new TQImage( uic_findImage( "roundFrame" ) ); if ( roundFrame->depth() < 32 ) * roundFrame = roundFrame->convertDepth( 32 ); @@ -352,28 +352,28 @@ LiquidStyle::LiquidStyle() : KStyle( AllowMenuTransparency | FilledFrameWorkarou pixmaps[ i ] = NULL; } - sbLeft = new QBitmap( 6, 7, sbarrow_left_bits, true ); + sbLeft = new TQBitmap( 6, 7, sbarrow_left_bits, true ); sbLeft->setMask( *sbLeft ); - sbRight = new QBitmap( 6, 7, sbarrow_right_bits, true ); + sbRight = new TQBitmap( 6, 7, sbarrow_right_bits, true ); sbRight->setMask( *sbRight ); - sbUp = new QBitmap( 7, 6, sbarrow_up_bits, true ); + sbUp = new TQBitmap( 7, 6, sbarrow_up_bits, true ); sbUp->setMask( *sbUp ); - sbDown = new QBitmap( 7, 6, sbarrow_down_bits, true ); + sbDown = new TQBitmap( 7, 6, sbarrow_down_bits, true ); sbDown->setMask( *sbDown ); - checkmark = new QBitmap( 6, 7, checkmark_bits, true ); + checkmark = new TQBitmap( 6, 7, checkmark_bits, true ); checkmark->setMask( *checkmark ); - isKicker = ( qstrcmp( qApp->argv() [ 0 ], "kicker" ) == 0 ) || - ( qstrcmp( qApp->argv() [ 0 ], "appletproxy" ) == 0 ); - isOOO = !qstrcmp( qApp->argv() [ 0 ], "soffice.bin" ); + isKicker = ( qstrcmp( tqApp->argv() [ 0 ], "kicker" ) == 0 ) || + ( qstrcmp( tqApp->argv() [ 0 ], "appletproxy" ) == 0 ); + isOOO = !qstrcmp( tqApp->argv() [ 0 ], "soffice.bin" ); - groupShadow = new QPixmap( 64, 64 ); - QColor c; - optionHandler->custCols[0] != -1 ? c = QColor(optionHandler->custCols[0]) : c= QColor(qApp->palette().color(QPalette::Active, isKicker?QColorGroup::Button:QColorGroup::Background)); + groupShadow = new TQPixmap( 64, 64 ); + TQColor c; + optionHandler->custCols[0] != -1 ? c = TQColor(optionHandler->custCols[0]) : c= TQColor(tqApp->palette().color(TQPalette::Active, isKicker?TQColorGroup::Button:TQColorGroup::Background)); groupShadow->fill( ( c.dark( 100 + optionHandler->ShadowDarkness() ) ).rgb() ); if ( (optionHandler->style() != Brushed) && optionHandler->useBgStipple() ) { - QPainter p; + TQPainter p; p.begin( groupShadow ); p.setPen( c.dark( 100 + optionHandler->ShadowDarkness() + (int)(optionHandler->stippleContrast()/2) ) ); for ( int i = 1; i < 64; i += 4 ) { @@ -468,10 +468,10 @@ inline void LiquidStyle::updateProgressPos() progAnimShift = (progAnimShift + 1) % 20; prog2AnimShift = (prog2AnimShift + 1) % 38; //Update the registered progressbars. - QMap<QWidget*, int>::iterator iter; + TQMap<TQWidget*, int>::iterator iter; for (iter = progAnimWidgets.begin(); iter != progAnimWidgets.end(); iter++) { - if ( !::qt_cast<QProgressBar*>(iter.key()) ) + if ( !::tqt_cast<TQProgressBar*>(iter.key()) ) continue; (iter.key())->repaint(false); } @@ -483,8 +483,8 @@ inline void LiquidStyle::updateSliderPos(){ activeScroller->repaint(false); } -void LiquidStyle::progressBarDestroyed(QObject* obj){ - progAnimWidgets.remove(static_cast<QWidget*>(obj)); +void LiquidStyle::progressBarDestroyed(TQObject* obj){ + progAnimWidgets.remove(static_cast<TQWidget*>(obj)); } bool LiquidStyle::isPlain() const { @@ -492,9 +492,9 @@ bool LiquidStyle::isPlain() const { } -void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, - const QRect &r, const QColorGroup &cg, - SFlags flags, const QStyleOption &opt ) const +void LiquidStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, + const TQRect &r, const TQColorGroup &cg, + SFlags flags, const TQStyleOption &opt ) const { bool down = flags & Style_Down; bool on = flags & Style_On; @@ -504,34 +504,34 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, case PE_TabBarBase: { bool isDialog = false; - if (p->device() && p->device()->devType() == QInternal::Widget) + if (p->device() && p->device()->devType() == TQInternal::Widget) { - QWidget *w = (QWidget*)p->device(); - if (w && ::qt_cast<QTabWidget*>(w) && w->children()) + TQWidget *w = (TQWidget*)p->device(); + if (w && ::tqt_cast<TQTabWidget*>(w) && w->children()) { - QObjectListIt it( *w->children() ); // iterate over the buttons - QObject *obj; - QTabBar *tabBar = 0L; + TQObjectListIt it( *w->children() ); // iterate over the buttons + TQObject *obj; + TQTabBar *tabBar = 0L; while ( (obj = it.current()) != 0 ) { ++it; - if (::qt_cast<QTabBar*>(obj)) + if (::tqt_cast<TQTabBar*>(obj)) { - tabBar = (QTabBar*)obj; + tabBar = (TQTabBar*)obj; break; } } if (!tabBar || !tabBar->isVisible()) break; } - isDialog = optionHandler->TabStyle() == Clever && w->topLevelWidget()->inherits("QDialog"); + isDialog = optionHandler->TabStyle() == Clever && w->topLevelWidget()->inherits("TQDialog"); } if (isDialog || optionHandler->TabStyle() == Chooser) { int x = r.x(); int right = r.right(); int bottom = r.bottom(); int y2 = r.y() + 1; - QColor bright( cg.background().dark( 110 ) ); - QColor mid( cg.background().dark( 130 ) ); - QColor dark( cg.background().dark( 150 ) ); + TQColor bright( cg.background().dark( 110 ) ); + TQColor mid( cg.background().dark( 130 ) ); + TQColor dark( cg.background().dark( 150 ) ); p->setPen( dark ); p->drawLine( x + 6, y2, right - 6, y2 ); p->drawPoint(x+3,y2+1);p->drawPoint(x+4,y2+1); @@ -569,11 +569,11 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, else { drawCombo( p, cg, cg.button(), r.x()+1, r.y()+1, r.width()-2, r.height()+1, false, false, false, center); - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); // p->setClipping ( false ); p->setPen( cg.button().dark( 158 ) ); p->drawRect(r); -// p->fillRect(r, Qt::red); +// p->fillRect(r, TQt::red); // p->flush(); p->setPen(oldPen); } @@ -585,10 +585,10 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, bool sunken = on || down; bool hover = flags & Style_MouseOver; bool focused = flags & Style_HasFocus; - QColor newColor = sunken ? cg.button().dark( 110 ) : hover || focused ? cg.button() : optionHandler->InactiveButtonColor(); + TQColor newColor = sunken ? cg.button().dark( 110 ) : hover || focused ? cg.button() : optionHandler->InactiveButtonColor(); if (optionHandler->AnimateButton() && (sunken || hover || focused)) { - ButtonFadeInfo *bfi_ = /*(::qt_cast<QWidget*>(*/opt.widget()/*))*/ ? bfi[opt.widget()->winId()] : 0L; + ButtonFadeInfo *bfi_ = /*(::tqt_cast<TQWidget*>(*/opt.widget()/*))*/ ? bfi[opt.widget()->winId()] : 0L; if (bfi_) { int index = bfi_->index; @@ -603,7 +603,7 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, else if ( ( r.width() < 21 || r.height() < 25 )) { drawCombo( p, cg, newColor, r.x(), r.y(), r.width(), r.height()+2, sunken, hover, false, center, isHTMLButton ); - QPen oldpen(p->pen()); + TQPen oldpen(p->pen()); p->setPen( newColor.dark(150)); p->drawRect(r.x(), r.y(), r.width(), r.height()); if (sunken) @@ -647,7 +647,7 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, { bool sunken = on || down; bool hover = flags & Style_MouseOver; - QPen oldpen(p->pen()); + TQPen oldpen(p->pen()); if ( isTaskContainer ) // is kicker? { if (optionHandler->SmoothListViewHeaders()) @@ -675,16 +675,16 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, } else { - if ( (p->device() && p->device()->devType() == QInternal::Widget) && ::qt_cast<QHeader*>((QWidget*)p->device()) ) + if ( (p->device() && p->device()->devType() == TQInternal::Widget) && ::tqt_cast<TQHeader*>((TQWidget*)p->device()) ) { - QHeader *header = (QHeader*)p->device(); - int id = header->orientation() == Qt::Horizontal ? header->sectionAt( r.x() + 2 + header->offset() ) : header->sectionAt( r.y() + 2 + header->offset() ); + TQHeader *header = (TQHeader*)p->device(); + int id = header->orientation() == TQt::Horizontal ? header->sectionAt( r.x() + 2 + header->offset() ) : header->sectionAt( r.y() + 2 + header->offset() ); hover = ((id != -1) && ((currentHeader == header && id == headerHoverID ) || id == headerSortID)); if (header->mapToIndex(id) == header->count()-1 && (r.bottom() < header->rect().bottom() || r.right() < header->rect().right())) { bool hadClip = p->hasClipping(); p->setClipping( false ); - if (header->orientation() == Qt::Horizontal) + if (header->orientation() == TQt::Horizontal) p->fillRect(r.right()+1, r.y(), header->width()-r.right(), r.height(), cg.base()); else p->fillRect(r.x(), r.bottom()+1, r.width(), header->height()-r.bottom(), cg.base()); @@ -710,9 +710,9 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, case PE_ScrollBarAddPage: case PE_ScrollBarSubPage: { - QColor sbBgColor = optionHandler->useCustomColors() ? + TQColor sbBgColor = optionHandler->useCustomColors() ? optionHandler->customColor( CustomSBGroove ) : - qApp->palette().active().background(); + tqApp->palette().active().background(); bool isActive = optionHandler->ScrollerActive(); bool isHover = currentScrollBar->hasMouse(); @@ -723,10 +723,10 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, if ( flags & Style_Horizontal ) { int extent = currentScrollBar->height(); - QRect bgR( extent, 0, currentScrollBar->width() - extent * 3 + 1, extent ); + TQRect bgR( extent, 0, currentScrollBar->width() - extent * 3 + 1, extent ); if ( sbBuffer.size() != currentScrollBar->size() ) const_cast<LiquidStyle*>( this )->sbBuffer.resize( currentScrollBar->size() ); - QPainter painter; + TQPainter painter; painter.begin( &sbBuffer ); // pixmaps if (drawSlider) @@ -758,7 +758,7 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, (isHover || isActive || isOOO) ? *getPixmap( HSBSliderTopActive ) : *getPixmap( HSBSliderTop ) ); // mid part last, as i have to redefine clip section - painter.setClipRect(r.x() + 7 + offset2, r.y() + 1, r.width() - 14 - 2*offset2, 13, QPainter::CoordPainter); + painter.setClipRect(r.x() + 7 + offset2, r.y() + 1, r.width() - 14 - 2*offset2, 13, TQPainter::CoordPainter); painter.drawTiledPixmap( r.x() + 7 + offset2 + ((isHover && !isPressed) ? (sliderAnimShift - 32) : 0), r.y() + 1, r.width() - 14 - 2*offset2 - ((isHover && !isPressed) ? (sliderAnimShift - 32) : 0), 13, isPressed ? *getPixmap( HSBSliderMidPressed ) : (isHover || isActive || isOOO) ? *getPixmap( HSBSliderMidActive ) : @@ -772,11 +772,11 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, else { int extent = currentScrollBar->width(); - QRect bgR( 0, extent, extent, currentScrollBar->height() - extent * 3 + 1 ); + TQRect bgR( 0, extent, extent, currentScrollBar->height() - extent * 3 + 1 ); if ( sbBuffer.size() != currentScrollBar->size() ) const_cast<LiquidStyle*>( this ) -> sbBuffer.resize( currentScrollBar->size() ); - QPainter painter; + TQPainter painter; painter.begin( &sbBuffer ); // set painter to pixelbuffer if (drawSlider) { @@ -809,7 +809,7 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, (isHover || isActive || isOOO) ? *getPixmap( VSBSliderBtmActive ) : *getPixmap( VSBSliderBtm ) ); // mid part last, as i have to redefine clipping section - painter.setClipRect(r.x() + 1, r.y() + 7+offset2, 13, r.height() - 14 - 2*offset2, QPainter::CoordPainter); + painter.setClipRect(r.x() + 1, r.y() + 7+offset2, 13, r.height() - 14 - 2*offset2, TQPainter::CoordPainter); painter.drawTiledPixmap( r.x() + 1, r.y() + 7 + offset2 - ((isHover && !isPressed) ? sliderAnimShift : 0), 13, r.height() - 14 - 2*offset2 + ((isHover && !isPressed) ? sliderAnimShift : 0), isPressed ? *getPixmap( VSBSliderMidPressed ) : @@ -823,10 +823,10 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, } case PE_ScrollBarAddLine: { - QColor c( optionHandler->useCustomColors() ? + TQColor c( optionHandler->useCustomColors() ? optionHandler->customColor( CustomSBGroove ) : - qApp->palette().active().background() ); - QColor pixColor = flags & Style_Down ? qApp->palette().active().button() : c; + tqApp->palette().active().background() ); + TQColor pixColor = flags & Style_Down ? tqApp->palette().active().button() : c; bool drawSlider = currentScrollBar->minValue() < currentScrollBar->maxValue(); @@ -846,18 +846,18 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, } if (drawSlider) { - p->setPen( flags & Style_Down ? cg.button() : QColor(85,85,85) ); - p->setBrush( flags & Style_Down ? cg.button() : QColor(85,85,85) ); + p->setPen( flags & Style_Down ? cg.button() : TQColor(85,85,85) ); + p->setBrush( flags & Style_Down ? cg.button() : TQColor(85,85,85) ); p->drawPixmap( r.x() + 4, r.y() + 4, flags & Style_Horizontal ? *sbRight : *sbDown ); } break; } case PE_ScrollBarSubLine: { - QColor c( optionHandler->useCustomColors() ? + TQColor c( optionHandler->useCustomColors() ? optionHandler->customColor( CustomSBGroove ) : - qApp->palette().active().background() ); - QColor pixColor = flags & Style_Down ? qApp->palette().active().button() : c; + tqApp->palette().active().background() ); + TQColor pixColor = flags & Style_Down ? tqApp->palette().active().button() : c; bool top = flags & Style_Horizontal ? r.x() == 0 : r.y() == 0; bool drawSlider = currentScrollBar->minValue() < currentScrollBar->maxValue(); @@ -892,8 +892,8 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, } if (drawSlider) { - p->setPen( flags & Style_Down ? cg.button() : QColor(85,85,85) ); - p->setBrush( flags & Style_Down ? cg.button() : QColor(85,85,85) ); + p->setPen( flags & Style_Down ? cg.button() : TQColor(85,85,85) ); + p->setBrush( flags & Style_Down ? cg.button() : TQColor(85,85,85) ); if (currentScrollBar->minValue() < currentScrollBar->maxValue()) p->drawPixmap( r.x() + 4, r.y() + 4, flags & Style_Horizontal ? *sbLeft : *sbUp ); } break; @@ -902,7 +902,7 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, { bool hover = flags & Style_MouseOver; bool pressed = flags & Style_Down; -// bool isMasked = p->device() && p->device() ->devType() == QInternal::Widget && ( ( QWidget * ) p->device() ) ->autoMask(); +// bool isMasked = p->device() && p->device() ->devType() == TQInternal::Widget && ( ( TQWidget * ) p->device() ) ->autoMask(); #if 0 if ( isMasked ) { @@ -937,7 +937,7 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, } case PE_IndicatorMask: { - p->fillRect( r, Qt::color1 ); + p->fillRect( r, TQt::color1 ); break; } case PE_ExclusiveIndicator: @@ -964,8 +964,8 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, case PE_Splitter: case PE_DockWindowResizeHandle: { - QPen oldpen(p->pen()); - QBrush oldbrush(p->brush()); + TQPen oldpen(p->pen()); + TQBrush oldbrush(p->brush()); if (highlightWidget == p->device()) { if (flags & Style_Horizontal) @@ -1017,17 +1017,17 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, case PE_PanelGroupBox: case PE_GroupBoxFrame: { - QColor bgColor; - QWidget* w = (p->device() && p->device()->devType() == QInternal::Widget) ? - (QWidget*)(p->device()) : 0; - QGroupBox* gb = ::qt_cast<QGroupBox*>(w); + TQColor bgColor; + TQWidget* w = (p->device() && p->device()->devType() == TQInternal::Widget) ? + (TQWidget*)(p->device()) : 0; + TQGroupBox* gb = ::tqt_cast<TQGroupBox*>(w); optionHandler->drawGroupBoxShadow() ? - bgColor = QColor(cg.background().dark( 100 + optionHandler->ShadowDarkness() )) : - bgColor = QColor(cg.background()); - QColor bright( bgColor.dark( 110 ) ); - QColor mid( bgColor.dark( 130 ) ); - QColor dark( bgColor.dark( 150 ) ); + bgColor = TQColor(cg.background().dark( 100 + optionHandler->ShadowDarkness() )) : + bgColor = TQColor(cg.background()); + TQColor bright( bgColor.dark( 110 ) ); + TQColor mid( bgColor.dark( 130 ) ); + TQColor dark( bgColor.dark( 150 ) ); int titleHeight = (gb && !gb->title().isEmpty() && pe == PE_PanelGroupBox) ? p->fontMetrics().height()+(gb->isCheckable()?4:1) : 0; @@ -1045,44 +1045,44 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, if (gb && titleHeight) { bool hadClip = p->hasClipping(); - QRegion oldClip = p->clipRegion(); + TQRegion oldClip = p->clipRegion(); if (gb->parentWidget()) { - const QPixmap *pix = gb->parentWidget()->paletteBackgroundPixmap(); + const TQPixmap *pix = gb->parentWidget()->paletteBackgroundPixmap(); if (optionHandler->drawGroupBoxShadow()) { - QPointArray pa1(3); + TQPointArray pa1(3); pa1.setPoint(0, x,y2); pa1.setPoint(1, x+5,y2); pa1.setPoint(2, x,y2+5); - QPointArray pa2(3); + TQPointArray pa2(3); pa2.setPoint(0, right-5,y2); pa2.setPoint(1, right,y2); pa2.setPoint(2, right,y2+5); - QPointArray pa3(3); + TQPointArray pa3(3); pa3.setPoint(0, right,bottom-5); pa3.setPoint(1, right,bottom); pa3.setPoint(2, right-5,bottom); - QPointArray pa4(3); + TQPointArray pa4(3); pa4.setPoint(0, x+5,bottom); pa4.setPoint(1, x,bottom); pa4.setPoint(2, x,bottom-5); - QRegion reg2(0,0, r.right(), titleHeight); - p->setClipRegion(QRegion(pa1)+QRegion(pa2)+QRegion(pa3)+QRegion(pa4)+reg2); + TQRegion reg2(0,0, r.right(), titleHeight); + p->setClipRegion(TQRegion(pa1)+TQRegion(pa2)+TQRegion(pa3)+TQRegion(pa4)+reg2); } else p->setClipRect(0,0,r.right(),titleHeight); - pix ? p->drawTiledPixmap( QRect( 0, 0, w->width(), w->height()), *pix, w->backgroundOffset()) : p->fillRect(QRect(0, 0, w->width(), w->height()),w->parentWidget()->backgroundBrush()); + pix ? p->drawTiledPixmap( TQRect( 0, 0, w->width(), w->height()), *pix, w->backgroundOffset()) : p->fillRect(TQRect(0, 0, w->width(), w->height()),w->parentWidget()->backgroundBrush()); } if (gb && !gb->isCheckable()) { - QString title = gb->title(); - QFont font( p->font() ); + TQString title = gb->title(); + TQFont font( p->font() ); font.setBold( true ); p->setFont( font ); - drawItem( p, QRect(10,0,r.width(),titleHeight), ShowPrefix, cg, flags & Style_Enabled, 0, title, -1, &cg.text() ); + drawItem( p, TQRect(10,0,r.width(),titleHeight), ShowPrefix, cg, flags & Style_Enabled, 0, title, -1, &cg.text() ); } p->setClipRegion(oldClip); p->setClipping(hadClip); @@ -1185,12 +1185,12 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, { // don't ask bool isDialog = optionHandler->TabStyle() == Clever && - (p->device() && p->device()->devType() == QInternal::Widget)&& - ((QWidget*)p->device())->topLevelWidget()->inherits("QDialog"); + (p->device() && p->device()->devType() == TQInternal::Widget)&& + ((TQWidget*)p->device())->topLevelWidget()->inherits("TQDialog"); - QColor bright( cg.background().dark( 110 ) ); - QColor mid( cg.background().dark( 130 ) ); - QColor dark( cg.background().dark( 150 ) ); + TQColor bright( cg.background().dark( 110 ) ); + TQColor mid( cg.background().dark( 130 ) ); + TQColor dark( cg.background().dark( 150 ) ); int x = r.x(); int right = r.right(); int bottom = r.bottom(); int y2 = r.y(); if (isDialog || optionHandler->TabStyle() == Chooser) { @@ -1238,7 +1238,7 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, case PE_PanelLineEdit: { bool focused = flags & Style_HasFocus; - bool isHTML = p->device() && p->device()->devType() == QInternal::Widget && isHTMLWidget((QWidget*)p->device()); + bool isHTML = p->device() && p->device()->devType() == TQInternal::Widget && isHTMLWidget((TQWidget*)p->device()); drawEditFrame( p, r, cg, isHTML, focused, false); break; } @@ -1246,7 +1246,7 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, { int x, y, w , h; r.rect( &x, &y, &w, &h ); - QColor c( optionHandler->UseCustomMenuColor()? + TQColor c( optionHandler->UseCustomMenuColor()? optionHandler->Color(): optionHandler->MenuColorButton()? optionHandler->buttonColor(): @@ -1269,7 +1269,7 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, case PE_DockWindowSeparator: { break; //don't draw anything - if (!(p->device() && p->device()->devType() == QInternal::Widget && ::qt_cast<QToolBar*>((QWidget*)p->device()))) + if (!(p->device() && p->device()->devType() == TQInternal::Widget && ::tqt_cast<TQToolBar*>((TQWidget*)p->device()))) { if ( !( flags & Style_Horizontal ) ) { @@ -1295,8 +1295,8 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, bool hover = flags & Style_MouseOver; int x = r.x() + ( r.width() - 7 ) / 2; int y = pe == PE_SpinWidgetDown ? r.y() + 1 : r.bottom() - 7; - QPen oldPen( p->pen() ); - QBrush oldBrush( p->brush() ); + TQPen oldPen( p->pen() ); + TQBrush oldBrush( p->brush() ); p->setPen( sunken ? cg.button() : hover ? cg.mid() : cg.text() ); p->setBrush( sunken ? cg.button() : hover ? cg.mid() : cg.text() ); p->drawPixmap( x, y, pe == PE_SpinWidgetUp ? *sbUp : *sbDown ); @@ -1306,7 +1306,7 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, } case PE_CheckMark: { - QPen oldPen( p->pen() ); + TQPen oldPen( p->pen() ); p->setPen( flags & Style_On ? cg.highlightedText() : optionHandler->textColor() ); p->drawPixmap(r.x() + r.width()/2 - 4,r.y() + r.height()/2 - 4,*checkmark); p->setPen( oldPen ); @@ -1316,9 +1316,9 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, { if ( (pe >= PE_ArrowUp && pe <= PE_ArrowLeft ) || pe == PE_HeaderArrow) { - QBrush oldBrush(p->brush()); - QColor tmpC = flags & Style_Enabled ? (flags & Style_Down || flags & Style_Sunken) && pe != PE_HeaderArrow ? cg.light() : cg.buttonText() : cg.mid(); - if (tmpC == Qt::black) tmpC = QColor(85,85,85); + TQBrush oldBrush(p->brush()); + TQColor tmpC = flags & Style_Enabled ? (flags & Style_Down || flags & Style_Sunken) && pe != PE_HeaderArrow ? cg.light() : cg.buttonText() : cg.mid(); + if (tmpC == TQt::black) tmpC = TQColor(85,85,85); p->setBrush(tmpC); int x = r.width() > 7 ? r.x() + r.width()/2 - 4 : r.right() - 7; int y = r.height() > 7 ? r.y() + r.height()/2 - 4 : r.bottom() - 7; @@ -1362,10 +1362,10 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, } // general switch } -void LiquidStyle::drawKStylePrimitive( KStylePrimitive kpe, QPainter* p, - const QWidget* widget, const QRect &r, - const QColorGroup &cg, SFlags flags, - const QStyleOption &opt ) const +void LiquidStyle::drawKStylePrimitive( KStylePrimitive kpe, TQPainter* p, + const TQWidget* widget, const TQRect &r, + const TQColorGroup &cg, SFlags flags, + const TQStyleOption &opt ) const { switch ( kpe ) { @@ -1376,7 +1376,7 @@ void LiquidStyle::drawKStylePrimitive( KStylePrimitive kpe, QPainter* p, int x, y, w, h; r.rect( &x, &y, &w, &h ); w = (int)((w-3)/2); - QColor c( (optionHandler->style() == Brushed) ? cg.background() : cg.background().dark(120) ); + TQColor c( (optionHandler->style() == Brushed) ? cg.background() : cg.background().dark(120) ); p->setPen(c); p->setBrush(c); for (int i = 0; i < h-3; i += 5 ) @@ -1393,7 +1393,7 @@ void LiquidStyle::drawKStylePrimitive( KStylePrimitive kpe, QPainter* p, int x, y, w, h; r.rect( &x, &y, &w, &h ); w = (int)((w-3)/2); - QColor c( widget->hasMouse() ? cg.button() : cg.background().dark(110) ); + TQColor c( widget->hasMouse() ? cg.button() : cg.background().dark(110) ); p->setPen(c); p->setBrush(c); for (int i = 0; i < h-3; i += 5 ) @@ -1431,8 +1431,8 @@ void LiquidStyle::drawKStylePrimitive( KStylePrimitive kpe, QPainter* p, { int x, y, w, h; r.rect( &x, &y, &w, &h ); - if (qstrcmp( qApp->argv() [ 0 ], "kmix" ) == 0) x = x+3; - if ( ( ( const QSlider * ) widget ) ->orientation() == Qt::Horizontal ) + if (qstrcmp( tqApp->argv() [ 0 ], "kmix" ) == 0) x = x+3; + if ( ( ( const TQSlider * ) widget ) ->orientation() == TQt::Horizontal ) { int x2 = x + w - 1; y = y + ( h - 5 ) / 2; @@ -1471,18 +1471,18 @@ void LiquidStyle::drawKStylePrimitive( KStylePrimitive kpe, QPainter* p, p->drawPixmap( r.x(), r.y(), *getPixmap( flags & Style_Enabled ? RadioOffHover : RadioOff)); break; } - if ((( const QSlider * ) widget ) ->orientation() == Qt::Horizontal) + if ((( const TQSlider * ) widget ) ->orientation() == TQt::Horizontal) (widget && widget->height() < 17) ? p->drawPixmap( r.x(), r.y(), *getPixmap( flags & Style_Enabled ? RadioOffHover : RadioOff)) : p->drawPixmap( r.x(), (optionHandler->style() == Milk) ? r.y() : r.y()+2, *getPixmap( flags & Style_Enabled ? HSlider : HSliderInactive)); else { - bool right = (( const QSlider * ) widget )->tickmarks() == QSlider::NoMarks || (( const QSlider * ) widget )->tickmarks() == QSlider::Right; + bool right = (( const TQSlider * ) widget )->tickmarks() == TQSlider::NoMarks || (( const TQSlider * ) widget )->tickmarks() == TQSlider::Right; (widget && widget->width() < 17) ? p->drawPixmap( r.x()+2, r.y(), *getPixmap( flags & Style_Enabled ? RadioOffHover : RadioOff)) : p->drawPixmap( (optionHandler->style() == Milk) ? r.x() : right ? r.x()+5 : r.x()-3, r.y(), *getPixmap( flags & Style_Enabled ? (right ? VSlider : VSliderAbove) : (right ? VSliderInactive : VSliderAboveInactive))); } break; } case KPE_ListViewExpander: { - p->fillRect(r,Qt::green); + p->fillRect(r,TQt::green); // int radius = ( r.width() - 4 ) / 2; // int centerx = r.x() + r.width() / 2; // int centery = r.y() + r.height() / 2; @@ -1491,7 +1491,7 @@ void LiquidStyle::drawKStylePrimitive( KStylePrimitive kpe, QPainter* p, // red = ( cg.dark().red() >> 1 ) + ( cg.base().red() >> 1 ); // green = ( cg.dark().green() >> 1 ) + ( cg.base().green() >> 1 ); // blue = ( cg.dark().blue() >> 1 ) + ( cg.base().blue() >> 1 ); - // QColor blendColor( red, green, blue ); + // TQColor blendColor( red, green, blue ); // // p->setPen( cg.dark() ); // p->drawLine( r.x() + 1, r.y(), r.right() - 1, r.y() ); @@ -1518,10 +1518,10 @@ void LiquidStyle::drawKStylePrimitive( KStylePrimitive kpe, QPainter* p, } } -void LiquidStyle::drawControl( ControlElement element, QPainter *p, - const QWidget *widget, const QRect &r, - const QColorGroup &cg, SFlags flags, - const QStyleOption &opt ) const +void LiquidStyle::drawControl( ControlElement element, TQPainter *p, + const TQWidget *widget, const TQRect &r, + const TQColorGroup &cg, SFlags flags, + const TQStyleOption &opt ) const { switch ( element ) { @@ -1534,30 +1534,30 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, } case CE_ProgressBarContents: { -// qWarning("%s - %s,%s : %s,%s",qApp->argv()[0],widget->className(),widget->name(),widget->parentWidget()->className(),widget->parentWidget()->name()); - const QProgressBar *progress = ( const QProgressBar * ) widget; - QRect contentsR( subRect( SR_ProgressBarContents, widget ) ); +// tqWarning("%s - %s,%s : %s,%s",tqApp->argv()[0],widget->className(),widget->name(),widget->parentWidget()->className(),widget->parentWidget()->name()); + const TQProgressBar *progress = ( const TQProgressBar * ) widget; + TQRect contentsR( subRect( SR_ProgressBarContents, widget ) ); double val = progress->progress(); - bool reverse = QApplication::reverseLayout(); + bool reverse = TQApplication::reverseLayout(); val = val / progress->totalSteps(); if ( val > 0.0 ) { - int w = QMIN( contentsR.width(), ( int ) (val * contentsR.width() ) ); + int w = TQMIN( contentsR.width(), ( int ) (val * contentsR.width() ) ); if ( w > 1 ) { int x = contentsR.x(); int y = contentsR.y(); - QRect progressRect; + TQRect progressRect; if (reverse) - progressRect = QRect(x+(contentsR.width()-w), y, w, contentsR.height()+1); + progressRect = TQRect(x+(contentsR.width()-w), y, w, contentsR.height()+1); else - progressRect = QRect(x, y, w, contentsR.height()+1); + progressRect = TQRect(x, y, w, contentsR.height()+1); if (optionHandler->ProgressBar() == liquid) { int x2 = x + w - 1; int y2 = contentsR.bottom(); //Clip to the old rectangle - p->setClipRect(progressRect, QPainter::CoordPainter); + p->setClipRect(progressRect, TQPainter::CoordPainter); //Expand progressRect.setLeft(progressRect.x() - progAnimShift); p->setPen(cg.button().dark(120)); @@ -1567,7 +1567,7 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, p->setPen(cg.button().dark(110)); p->drawLine(x2, y, x2, y2); p->drawLine(x, y2, x2, y2); - QPixmap * pix = getPixmap( Progress ); + TQPixmap * pix = getPixmap( Progress ); p->drawTiledPixmap(/*x+1, y+1, w-2, contentsR.height()-2*/progressRect, *pix); } else if (optionHandler->ProgressBar() == baghira) @@ -1579,11 +1579,11 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, ButtonTile *progress2Tile = progress2Dict.find( cg.button().rgb() ); if ( !progress2Tile ) { - QPixmap *pix = getPixmap(progress2); + TQPixmap *pix = getPixmap(progress2); progress2Tile = separateTiles( pix, 0, 15, 38, 1, 0, true); if ( !progress2Tile ) { - qWarning( "Progress tile is NULL!" ); + tqWarning( "Progress tile is NULL!" ); return ; } else @@ -1593,7 +1593,7 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, } } //Clip to the old rectangle - p->setClipRect(progressRect, QPainter::CoordPainter); + p->setClipRect(progressRect, TQPainter::CoordPainter); //Expand progressRect.setLeft(progressRect.x() - 38 + prog2AnimShift); int h; /*x, y, w;*/ @@ -1610,10 +1610,10 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, }/* case CE_ToolButtonLabel: { - const QToolButton *toolbutton = (const QToolButton *) widget; - QRect rect = r; - Qt::ArrowType arrowType = opt.isDefault() - ? Qt::DownArrow : opt.arrowType(); + const TQToolButton *toolbutton = (const TQToolButton *) widget; + TQRect rect = r; + TQt::ArrowType arrowType = opt.isDefault() + ? TQt::DownArrow : opt.arrowType(); int shiftX = 0; int shiftY = 0; @@ -1627,11 +1627,11 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, PrimitiveElement pe; switch (arrowType) { - case Qt::LeftArrow: pe = PE_ArrowLeft; break; - case Qt::RightArrow: pe = PE_ArrowRight; break; - case Qt::UpArrow: pe = PE_ArrowUp; break; + case TQt::LeftArrow: pe = PE_ArrowLeft; break; + case TQt::RightArrow: pe = PE_ArrowRight; break; + case TQt::UpArrow: pe = PE_ArrowUp; break; default: - case Qt::DownArrow: pe = PE_ArrowDown; break; + case TQt::DownArrow: pe = PE_ArrowDown; break; } rect.moveBy(shiftX, shiftY); @@ -1639,13 +1639,13 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, } else { - QColor btext = Qt::black;//(flags & (Style_Down | Style_On)) ? qApp->palette().color(QPalette::Active,QColorGroup::ButtonText) : toolbutton->paletteForegroundColor(); + TQColor btext = TQt::black;//(flags & (Style_Down | Style_On)) ? tqApp->palette().color(TQPalette::Active,TQColorGroup::ButtonText) : toolbutton->paletteForegroundColor(); if (toolbutton->iconSet().isNull() && ! toolbutton->text().isNull() && ! toolbutton->usesTextLabel()) { int alignment = AlignCenter | ShowPrefix; - if (!styleHint(SH_UnderlineAccelerator, widget, QStyleOption::Default, 0)) + if (!styleHint(SH_UnderlineAccelerator, widget, TQStyleOption::Default, 0)) alignment |= NoAccel; rect.moveBy(shiftX, shiftY); @@ -1653,36 +1653,36 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, flags & Style_Enabled, 0, toolbutton->text(), toolbutton->text().length(), &btext); } else { - QPixmap pm; - QIconSet::Size size = - toolbutton->usesBigPixmap() ? QIconSet::Large : QIconSet::Small; - QIconSet::State state = - toolbutton->isOn() ? QIconSet::On : QIconSet::Off; - QIconSet::Mode mode; + TQPixmap pm; + TQIconSet::Size size = + toolbutton->usesBigPixmap() ? TQIconSet::Large : TQIconSet::Small; + TQIconSet::State state = + toolbutton->isOn() ? TQIconSet::On : TQIconSet::Off; + TQIconSet::Mode mode; if (! toolbutton->isEnabled()) - mode = QIconSet::Disabled; + mode = TQIconSet::Disabled; else if (flags & (Style_Down | Style_On) || (flags & Style_Raised) && (flags & Style_AutoRaise)) - mode = QIconSet::Active; + mode = TQIconSet::Active; else - mode = QIconSet::Normal; + mode = TQIconSet::Normal; pm = toolbutton->iconSet().pixmap( size, mode, state ); if ( toolbutton->usesTextLabel() ) { p->setFont( toolbutton->font() ); - QRect pr = rect, tr = rect; + TQRect pr = rect, tr = rect; int alignment = ShowPrefix; - if (!styleHint(SH_UnderlineAccelerator, widget, QStyleOption::Default, 0)) + if (!styleHint(SH_UnderlineAccelerator, widget, TQStyleOption::Default, 0)) alignment |= NoAccel; - if ( toolbutton->textPosition() == QToolButton::Under ) + if ( toolbutton->textPosition() == TQToolButton::Under ) { int fh = p->fontMetrics().height(); pr.addCoords( 0, 1, 0, -fh-3 ); tr.addCoords( 0, pr.bottom(), 0, -3 ); pr.moveBy(shiftX, shiftY); - drawItem( p, pr, AlignCenter, cg, TRUE, &pm, QString::null ); + drawItem( p, pr, AlignCenter, cg, TRUE, &pm, TQString::null ); alignment |= AlignCenter; } else @@ -1691,7 +1691,7 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, tr.addCoords( pr.right(), 0, 0, 0 ); pr.moveBy(shiftX, shiftY); - drawItem( p, pr, AlignCenter, cg, TRUE, &pm, QString::null ); + drawItem( p, pr, AlignCenter, cg, TRUE, &pm, TQString::null ); alignment |= AlignLeft | AlignVCenter; } @@ -1703,7 +1703,7 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, else { rect.moveBy(shiftX, shiftY); - drawItem( p, rect, AlignCenter, cg, TRUE, &pm, QString::null ); + drawItem( p, rect, AlignCenter, cg, TRUE, &pm, TQString::null ); } } } @@ -1714,42 +1714,42 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, /* case CE_HeaderLabel: { - QRect rect = r; - const QHeader* header = (const QHeader *) widget; + TQRect rect = r; + const TQHeader* header = (const TQHeader *) widget; int section = opt.headerSection(); - QIconSet* icon = header->iconSet( section ); + TQIconSet* icon = header->iconSet( section ); if ( icon ) { - QPixmap pixmap = icon->pixmap( QIconSet::Small, + TQPixmap pixmap = icon->pixmap( TQIconSet::Small, flags & Style_Enabled ? - QIconSet::Normal : QIconSet::Disabled ); + TQIconSet::Normal : TQIconSet::Disabled ); int pixw = pixmap.width(); int pixh = pixmap.height(); // "pixh - 1" because of tricky integer division - QRect pixRect = rect; + TQRect pixRect = rect; pixRect.setY( rect.center().y() - (pixh - 1) / 2 ); drawItem ( p, pixRect, AlignVCenter, cg, flags & Style_Enabled, - &pixmap, QString::null ); + &pixmap, TQString::null ); rect.setLeft( rect.left() + pixw + 2 ); } drawItem ( p, rect, AlignVCenter, cg, flags & Style_Enabled, - 0, header->label( section ), -1, (isTaskContainer && (flags & Style_MouseOver)) ? &(qApp->palette().color(QPalette::Active,QColorGroup::ButtonText)) : &(cg.buttonText()) ); + 0, header->label( section ), -1, (isTaskContainer && (flags & Style_MouseOver)) ? &(tqApp->palette().color(TQPalette::Active,TQColorGroup::ButtonText)) : &(cg.buttonText()) ); break; }*/ case CE_ProgressBarLabel: { if (optionHandler->DrawProgressLabel()) { - QRect contentsR( subRect( SR_ProgressBarContents, widget ) ); + TQRect contentsR( subRect( SR_ProgressBarContents, widget ) ); if ( !contentsR.isValid() ) return ; - QFont font( p->font() ); + TQFont font( p->font() ); font.setBold( true ); p->setFont( font ); p->setPen( widget->colorGroup().buttonText() ); - p->setClipRect(r, QPainter::CoordPainter); - p->drawText( contentsR, AlignCenter, ( ( const QProgressBar * ) widget ) ->progressString() ); + p->setClipRect(r, TQPainter::CoordPainter); + p->drawText( contentsR, AlignCenter, ( ( const TQProgressBar * ) widget ) ->progressString() ); } break; } @@ -1757,7 +1757,7 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, { // new style with tiled pixmaps if ( !widget || !widget->parentWidget(true) ) break; - const QTabBar *tabBar = ( const QTabBar * ) widget; + const TQTabBar *tabBar = ( const TQTabBar * ) widget; bool selected = flags & Style_Selected; bool hover = currentTabBar && currentTabBar == tabBar && tabBar->indexOf(opt.tab()->identifier()) == hoveredTabIndex; @@ -1771,7 +1771,7 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, else pos = center; - QColor c; + TQColor c; if (hover || selected) { if (optionHandler->useCustomColors()) @@ -1787,14 +1787,14 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, c = optionHandler->InactiveButtonColor(); } - bool isDialog = optionHandler->TabStyle() == Clever && widget->topLevelWidget()->inherits("QDialog"); + bool isDialog = optionHandler->TabStyle() == Clever && widget->topLevelWidget()->inherits("TQDialog"); if (isDialog || optionHandler->TabStyle() == Chooser) drawCombo( p, cg, c, r.x(), r.y(), r.width(), r.height(), false, false, false, pos ); else { LiquidStyle *ptr = const_cast<LiquidStyle*>( this ); - bool above = tabBar->shape() == QTabBar::RoundedAbove || tabBar->shape() == QTabBar::TriangularAbove; - QPixmap *pix; + bool above = tabBar->shape() == TQTabBar::RoundedAbove || tabBar->shape() == TQTabBar::TriangularAbove; + TQPixmap *pix; if (above) pix = selected ? getPixmap( TabDown ) : getPixmap( Tab ); else @@ -1804,7 +1804,7 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, tabTile = separateTiles( pix, 9, 15, 67, 1, 0, false); if ( !tabTile ) { - qWarning( "Tab tile is NULL!" ); + tqWarning( "Tab tile is NULL!" ); return ; } else @@ -1850,38 +1850,38 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, { if ( opt.isDefault() ) return ; - QTab *t = opt.tab(); - const QTabBar * tb = ( const QTabBar * ) widget; + TQTab *t = opt.tab(); + const TQTabBar * tb = ( const TQTabBar * ) widget; if ( ( tb->currentTab() != t->identifier() )) { if (optionHandler->TabStyle() == TrueTab || - (optionHandler->TabStyle() == Clever && !(widget->topLevelWidget()->inherits("QDialog")))) + (optionHandler->TabStyle() == Clever && !(widget->topLevelWidget()->inherits("TQDialog")))) { - drawItem( p, QRect( r.x(), r.y() + 1, r.width(), r.height() ), AlignCenter | ShowPrefix, cg, flags & Style_Enabled, 0, t->text(), -1/*, &cg.text()*/ ); + drawItem( p, TQRect( r.x(), r.y() + 1, r.width(), r.height() ), AlignCenter | ShowPrefix, cg, flags & Style_Enabled, 0, t->text(), -1/*, &cg.text()*/ ); break; } - drawItem( p, QRect( r.x(), r.y(), r.width(), r.height() ), AlignCenter | ShowPrefix, cg, flags & Style_Enabled, 0, t->text(), -1/*, &cg.text()*/ ); + drawItem( p, TQRect( r.x(), r.y(), r.width(), r.height() ), AlignCenter | ShowPrefix, cg, flags & Style_Enabled, 0, t->text(), -1/*, &cg.text()*/ ); break; } - drawItem( p, QRect( r.x(), r.y(), r.width(), r.height() ), AlignCenter | ShowPrefix, cg, flags & Style_Enabled, 0, t->text(), -1/*, &cg.text()*/ ); + drawItem( p, TQRect( r.x(), r.y(), r.width(), r.height() ), AlignCenter | ShowPrefix, cg, flags & Style_Enabled, 0, t->text(), -1/*, &cg.text()*/ ); break; } case CE_PushButton: { // if (_htmlWidgetWId == widget->winId()) // return; - QPushButton *btn = ( QPushButton* ) widget; + TQPushButton *btn = ( TQPushButton* ) widget; const_cast<LiquidStyle*>( this ) ->isHTMLButton = isHTMLWidget( btn ); ButtonFadeInfo *bfi_ = bfi[btn->winId()]; if ( widget == highlightWidget || (bfi_ && !bfi_->fadeIn) ) flags |= Style_MouseOver; if (btn->isDefault()) flags |= Style_HasFocus; - // Qt messes this up with WindowOrigin, so we do it ourselves :P + // TQt messes this up with WindowOrigin, so we do it ourselves :P if ( !isPlain() && !btn->autoMask() ) const_cast<LiquidStyle*>( this ) ->btnOffset = btn->backgroundOffset(); - const_cast<LiquidStyle*>( this ) ->paintWidget = const_cast<QWidget*>( widget ); - drawPrimitive( PE_ButtonDefault, p, r, cg, flags, QStyleOption( btn )); + const_cast<LiquidStyle*>( this ) ->paintWidget = const_cast<TQWidget*>( widget ); + drawPrimitive( PE_ButtonDefault, p, r, cg, flags, TQStyleOption( btn )); const_cast<LiquidStyle*>( this ) ->paintWidget = 0L; const_cast<LiquidStyle*>( this ) ->isHTMLButton = false; break; @@ -1890,7 +1890,7 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, { // if (_htmlWidgetWId == widget->winId()) // return; - const QPushButton *btn = ( const QPushButton* ) widget; + const TQPushButton *btn = ( const TQPushButton* ) widget; int x, y, w, h; r.rect( &x, &y, &w, &h ); @@ -1900,15 +1900,15 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, int xoff = x; if ( btn->iconSet() && !btn->iconSet() ->isNull() ) { - QIconSet::Mode mode = btn->isEnabled() ? QIconSet::Normal : QIconSet::Disabled; - if ( mode == QIconSet::Normal && btn->hasFocus() ) - mode = QIconSet::Active; + TQIconSet::Mode mode = btn->isEnabled() ? TQIconSet::Normal : TQIconSet::Disabled; + if ( mode == TQIconSet::Normal && btn->hasFocus() ) + mode = TQIconSet::Active; - QIconSet::State state = QIconSet::Off; + TQIconSet::State state = TQIconSet::Off; if ( btn->isToggleButton() && btn->isOn() ) - state = QIconSet::On; + state = TQIconSet::On; - QPixmap pix( btn->iconSet() ->pixmap( QIconSet::Small, mode, state ) ); + TQPixmap pix( btn->iconSet() ->pixmap( TQIconSet::Small, mode, state ) ); xoff += (x<6?8:2); if (btn->text().isEmpty() && !btn->pixmap()) p->drawPixmap( x + w/2 - pix.width()/2, y + h / 2 - pix.height() / 2, pix ); @@ -1918,18 +1918,18 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, if ( btn->isMenuButton() ) { - drawPrimitive( PE_ArrowDown, p, QRect( w-14, (int)(h/2), 7, 7 ) , cg, flags, opt ); + drawPrimitive( PE_ArrowDown, p, TQRect( w-14, (int)(h/2), 7, 7 ) , cg, flags, opt ); w -= 14; } - QColor tmp; + TQColor tmp; tmp = btn->isDown() && !optionHandler->IcyButtons() ? btn->colorGroup().highlightedText() : btn->colorGroup().buttonText(); - drawItem( p, QRect( xoff, optionHandler->style() == Milk ? y-1 : y, w, h ), AlignCenter | ShowPrefix, cg, btn->isEnabled(), btn->pixmap(), btn->text(), -1, &tmp ); + drawItem( p, TQRect( xoff, optionHandler->style() == Milk ? y-1 : y, w, h ), AlignCenter | ShowPrefix, cg, btn->isEnabled(), btn->pixmap(), btn->text(), -1, &tmp ); break; } case CE_MenuBarItem: { - QMenuItem *mi = opt.menuItem(); + TQMenuItem *mi = opt.menuItem(); bool active = flags & Style_Active; bool focused = flags & Style_HasFocus; @@ -1940,13 +1940,13 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, p->fillRect(r,cg.highlight()); } - // QColor tmpColor( cg.background().dark( 120 ) ); + // TQColor tmpColor( cg.background().dark( 120 ) ); if ( optionHandler->useShadowText() && !( active && focused )) { p->setPen(cg.background().dark( 120 )); p->drawText(r, AlignCenter | AlignVCenter | ShowPrefix | DontClip | SingleLine, mi->text()); } - // drawItem( p, QRect( r.x() + 1, r.y() + 1, r.width(), r.height() ), AlignCenter | AlignVCenter | ShowPrefix | DontClip | SingleLine, cg, flags & Style_Enabled, mi->pixmap(), mi->text(), -1, &tmpColor ); + // drawItem( p, TQRect( r.x() + 1, r.y() + 1, r.width(), r.height() ), AlignCenter | AlignVCenter | ShowPrefix | DontClip | SingleLine, cg, flags & Style_Enabled, mi->pixmap(), mi->text(), -1, &tmpColor ); // drawItem( p, r, AlignCenter | AlignVCenter | ShowPrefix | DontClip | SingleLine, cg, flags & Style_Enabled, mi->pixmap(), mi->text(), -1, active && focused ? &(cg.highlightedText()) : &(cg.text()) ); p->setPen(active && focused ? cg.highlightedText() : cg.text()); @@ -1958,8 +1958,8 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, int x,y,w, h; r.rect( &x, &y, &w, &h ); - const QPopupMenu *popupmenu = ( const QPopupMenu * ) widget; - QMenuItem *mi = opt.menuItem(); + const TQPopupMenu *popupmenu = ( const TQPopupMenu * ) widget; + TQMenuItem *mi = opt.menuItem(); int tab = opt.tabWidth(); int maxpmw = opt.maxIconWidth(); @@ -1969,10 +1969,10 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, bool enabled = flags & Style_Enabled; int checkcol = maxpmw; - QColor menuBgColor( optionHandler->UseCustomMenuColor() ? optionHandler->Color() : optionHandler->bgColor() ); + TQColor menuBgColor( optionHandler->UseCustomMenuColor() ? optionHandler->Color() : optionHandler->bgColor() ); if ( checkable ) - checkcol = QMAX( maxpmw, 20 ); + checkcol = TQMAX( maxpmw, 20 ); if ( mi && mi->isSeparator() ) { @@ -2004,10 +2004,10 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, if ( !mi ) return ; - // Menu contents drawing code based on Qt's styles. Qt is property of + // Menu contents drawing code based on TQt's styles. TQt is property of // TrollTech: www.trolltech.com. Used with permission. int xpos = x; - QRect vrect = visualRect( QRect( xpos, y, checkcol, h ), r ); + TQRect vrect = visualRect( TQRect( xpos, y, checkcol, h ), r ); int xvis = vrect.x(); // icon @@ -2015,17 +2015,17 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, p->fillRect(x,y,h,h, optionHandler->menuStripeColor()); if ( mi->iconSet() ) { - QIconSet::Mode mode = dis ? QIconSet::Disabled : QIconSet::Normal; + TQIconSet::Mode mode = dis ? TQIconSet::Disabled : TQIconSet::Normal; if ( act && !dis ) - mode = QIconSet::Active; - QPixmap pixmap; + mode = TQIconSet::Active; + TQPixmap pixmap; if ( checkable && mi->isChecked() ) - pixmap = mi->iconSet() ->pixmap( QIconSet::Small, mode, QIconSet::On ); + pixmap = mi->iconSet() ->pixmap( TQIconSet::Small, mode, TQIconSet::On ); else - pixmap = mi->iconSet() ->pixmap( QIconSet::Small, mode ); + pixmap = mi->iconSet() ->pixmap( TQIconSet::Small, mode ); int pixw = pixmap.width(); int pixh = pixmap.height(); - QRect pmr( 0, 0, pixw, pixh ); + TQRect pmr( 0, 0, pixw, pixh ); pmr.moveCenter( vrect.center() ); p->setPen( cg.text() ); p->drawPixmap( pmr.topLeft(), pixmap ); @@ -2041,10 +2041,10 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, cflags |= Style_Enabled; if ( act ) cflags |= Style_On; - drawPrimitive( PE_CheckMark, p, visualRect( QRect( xp, y + windowsItemFrame, checkcol - 2 * windowsItemFrame, h - 2 * windowsItemFrame ), r ), cg, cflags ); + drawPrimitive( PE_CheckMark, p, visualRect( TQRect( xp, y + windowsItemFrame, checkcol - 2 * windowsItemFrame, h - 2 * windowsItemFrame ), r ), cg, cflags ); } } - QColor discol; + TQColor discol; if ( dis ) { discol = cg.text(); @@ -2054,7 +2054,7 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, int xm = windowsItemFrame + checkcol + windowsItemHMargin; xpos += xm; - vrect = visualRect( QRect( xpos, y + windowsItemVMargin, w - xm - tab + 1, h - 2 * windowsItemVMargin ), r ); + vrect = visualRect( TQRect( xpos, y + windowsItemVMargin, w - xm - tab + 1, h - 2 * windowsItemVMargin ), r ); xvis = vrect.x(); if ( mi->custom() ) { @@ -2070,10 +2070,10 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, } // Text - QString s = mi->text(); + TQString s = mi->text(); if ( !s.isNull() ) { - QColor textColor, shadowColor; + TQColor textColor, shadowColor; shadowColor = optionHandler->bgColor().dark( 130 ); if ( dis ) @@ -2087,12 +2087,12 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, int t = s.find( '\t' ); int text_flags = AlignVCenter | ShowPrefix | DontClip | SingleLine; - text_flags |= ( QApplication::reverseLayout() ? AlignRight : AlignLeft ); + text_flags |= ( TQApplication::reverseLayout() ? AlignRight : AlignLeft ); if ( t >= 0 ) { // draw tab text int xp; xp = x + w - tab - 20 - windowsItemHMargin - windowsItemFrame + 1; - QString tabStr( s.right( s.length() - t - 1 ) ); + TQString tabStr( s.right( s.length() - t - 1 ) ); if ( !tabStr.isEmpty() ) { if ( optionHandler->useShadowText() ) @@ -2116,7 +2116,7 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, else if ( mi->pixmap() ) // draw pixmap { - QPixmap * pixmap = mi->pixmap(); + TQPixmap * pixmap = mi->pixmap(); if ( pixmap->depth() == 1 ) p->setBackgroundMode( OpaqueMode ); p->drawPixmap( xvis, y + windowsItemFrame, *pixmap ); @@ -2128,21 +2128,21 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, { int dim = (int)((float)( h - 2 * windowsItemFrame ) / 2); PrimitiveElement arrow; - arrow = ( QApplication::reverseLayout() ? PE_ArrowLeft : PE_ArrowRight ); + arrow = ( TQApplication::reverseLayout() ? PE_ArrowLeft : PE_ArrowRight ); xpos = x + w - windowsArrowHMargin - windowsItemFrame/* - dim*/-8; - vrect = visualRect( QRect( xpos, y + h / 2 - dim / 2, /*dim*/8, dim ), r ); + vrect = visualRect( TQRect( xpos, y + h / 2 - dim / 2, /*dim*/8, dim ), r ); if ( act ) { if ( !dis ) discol = cg.highlightedText(); - QColorGroup g2( discol, cg.highlight(), white, white, dis ? discol : white, discol, white ); + TQColorGroup g2( discol, cg.highlight(), white, white, dis ? discol : white, discol, white ); drawPrimitive( arrow, p, vrect, g2, Style_Enabled ); } else { if ( !dis ) discol = optionHandler->textColor(); - QColorGroup g2( discol, cg.background(), white, white, dis ? discol : white, discol, white ); + TQColorGroup g2( discol, cg.background(), white, white, dis ? discol : white, discol, white ); drawPrimitive( arrow, p, vrect, g2, mi->isEnabled() ? Style_Enabled : Style_Default ); } } @@ -2159,10 +2159,10 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, } -// void LiquidStyle::drawControlMask( ControlElement element, QPainter *p, const QWidget *widget, const QRect &r, const QStyleOption& opt ) const { +// void LiquidStyle::drawControlMask( ControlElement element, TQPainter *p, const TQWidget *widget, const TQRect &r, const TQStyleOption& opt ) const { // switch ( element ) { // case CE_PushButton: { -// p->fillRect( r, Qt::color1 ); +// p->fillRect( r, TQt::color1 ); // break; // } // default: @@ -2171,7 +2171,7 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, // } // } -// void LiquidStyle::drawComplexControlMask( ComplexControl control, QPainter *p, const QWidget *widget, const QRect &r, const QStyleOption &opt ) const { +// void LiquidStyle::drawComplexControlMask( ComplexControl control, TQPainter *p, const TQWidget *widget, const TQRect &r, const TQStyleOption &opt ) const { // // switch ( control ) { // // case CC_ComboBox: { // // drawControlMask( CE_PushButton, p, widget, r, opt ); @@ -2182,7 +2182,7 @@ void LiquidStyle::drawControl( ControlElement element, QPainter *p, // // } // } -void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const QWidget *widget, const QRect &r, const QColorGroup &cg, SFlags flags, SCFlags controls, SCFlags active, const QStyleOption &opt ) const +void LiquidStyle::drawComplexControl( ComplexControl control, TQPainter *p, const TQWidget *widget, const TQRect &r, const TQColorGroup &cg, SFlags flags, SCFlags controls, SCFlags active, const TQStyleOption &opt ) const { switch ( control ) { @@ -2191,11 +2191,11 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const bool sunken = (active & SC_ComboBoxArrow);// || (flags & Style_Active) || (flags & Style_Sunken) || (active & SC_ComboBoxListBoxPopup); bool hovered = (widget == highlightWidget) || (flags & Style_HasFocus); // bool isHtml = isHTMLWidget( widget ); - const_cast<LiquidStyle*>( this ) ->paintWidget = const_cast<QWidget*>( widget ); - QPen oldPen( p->pen() ); + const_cast<LiquidStyle*>( this ) ->paintWidget = const_cast<TQWidget*>( widget ); + TQPen oldPen( p->pen() ); if ( controls & SC_ComboBoxArrow ) { - if ( controls & SC_ComboBoxEditField && ( ( const QComboBox * ) widget ) ->editable()) + if ( controls & SC_ComboBoxEditField && ( ( const TQComboBox * ) widget ) ->editable()) { // editable? #if 0 if ( optionHandler->buttonStyle() == Brushed ) @@ -2245,13 +2245,13 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const } case CC_ToolButton: { - const QToolButton *toolbutton = ( const QToolButton * ) widget; - const_cast<LiquidStyle*>( this ) ->paintWidget = const_cast<QWidget*>( widget ); + const TQToolButton *toolbutton = ( const TQToolButton * ) widget; + const_cast<LiquidStyle*>( this ) ->paintWidget = const_cast<TQWidget*>( widget ); const KAccessToolBarButton *toolbutton2 = 0L; - QRect button, menuarea; + TQRect button, menuarea; button = querySubControlMetrics( control, widget, SC_ToolButton, opt ); menuarea = querySubControlMetrics( control, widget, SC_ToolButtonMenu, opt ); - if (::qt_cast<KToolBarButton*>(toolbutton)) + if (::tqt_cast<KToolBarButton*>(toolbutton)) { toolbutton2 = (const KAccessToolBarButton*)toolbutton; #if GCC_VERSION < 40000 @@ -2259,7 +2259,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const button.setBottom(button.bottom() - p->fontMetrics().height() - 1); #endif } - else if (toolbutton->usesTextLabel() && toolbutton->textPosition() == QToolButton::BelowIcon) + else if (toolbutton->usesTextLabel() && toolbutton->textPosition() == TQToolButton::BelowIcon) button.setBottom(button.bottom() - p->fontMetrics().height()); menuarea.setX(menuarea.x() - 1); SFlags bflags = flags, mflags = flags; @@ -2276,11 +2276,11 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const bool sunken = mflags & ( Style_Down /*| Style_On*/ ); bool hover = bflags & (Style_MouseOver | Style_On ); - if ( !optionHandler->useToolButtonFrame())// || !(toolbutton->parentWidget() && ( ::qt_cast<QToolBar*>(toolbutton->parentWidget()) || toolbutton->parentWidget()->inherits("KonqFrameTabs")))) + if ( !optionHandler->useToolButtonFrame())// || !(toolbutton->parentWidget() && ( ::tqt_cast<TQToolBar*>(toolbutton->parentWidget()) || toolbutton->parentWidget()->inherits("KonqFrameTabs")))) { - if ((!(hover || sunken) || (toolbutton->usesTextLabel() && toolbutton->textPosition() == QToolButton::BelowIcon)) && toolbutton->parentWidget() && !::qt_cast<QToolBar*>(toolbutton->parent()) && toolbutton->parentWidget()->paletteBackgroundPixmap() && !toolbutton->parentWidget()->paletteBackgroundPixmap()->isNull()) + if ((!(hover || sunken) || (toolbutton->usesTextLabel() && toolbutton->textPosition() == TQToolButton::BelowIcon)) && toolbutton->parentWidget() && !::tqt_cast<TQToolBar*>(toolbutton->parent()) && toolbutton->parentWidget()->paletteBackgroundPixmap() && !toolbutton->parentWidget()->paletteBackgroundPixmap()->isNull()) { - QPixmap pixmap = *(toolbutton->parentWidget()->paletteBackgroundPixmap()); + TQPixmap pixmap = *(toolbutton->parentWidget()->paletteBackgroundPixmap()); if (hover || sunken) p->drawTiledPixmap( r.x(), button.bottom()+1, r.width(), p->fontMetrics().height(), pixmap, toolbutton->x(), toolbutton->y()+button.height() ); else @@ -2288,10 +2288,10 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const } if (hover || sunken) { - const_cast<LiquidStyle*>( this ) ->paintWidget = const_cast<QWidget*>( widget ); + const_cast<LiquidStyle*>( this ) ->paintWidget = const_cast<TQWidget*>( widget ); if (optionHandler->toolbuttonStyle() != Brushed) drawCombo( p, cg, sunken ? cg.button().light( 110 ) : - (hover || (cg.button() != qApp->palette().active().button())) ? cg.button() : + (hover || (cg.button() != tqApp->palette().active().button())) ? cg.button() : optionHandler->InactiveButtonColor(), button.x(), button.y(), button.width(), button.height(), sunken, hover, false, full ); else @@ -2306,7 +2306,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const myPosition pos = full; KToolBar *bar = NULL; - if (toolbutton2 && toolbutton2->parentWidget() && ::qt_cast<KToolBar*>(toolbutton2->parentWidget()) ) + if (toolbutton2 && toolbutton2->parentWidget() && ::tqt_cast<KToolBar*>(toolbutton2->parentWidget()) ) { //position calculation - would be nice if ktoolbarbutton provided this as flag bar = (KToolBar*)toolbutton2->parentWidget(); int buttonId = toolbutton2->id(); @@ -2328,7 +2328,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const pos = right : pos = center; } - else if (bar->orientation() == Qt::Horizontal) + else if (bar->orientation() == TQt::Horizontal) { if (buttonIndex == 0) { @@ -2380,15 +2380,15 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const if (optionHandler->toolbuttonStyle() != Brushed) { - (bar && bar->orientation() == Qt::Vertical) ? - drawCombo( p, cg, sunken ? cg.button().light( 110 ) : (hover || (cg.button() != qApp->palette().active().button())) ? cg.button() : optionHandler->InactiveButtonColor(), button.x(), (pos == full || pos == left) ? button.y() : button.y() - 7, button.width(), (pos == full) ? button.height()+2 : (pos == center) ? button.height()+16 : button.height()+9, sunken, hover, false, center ) : - drawCombo( p, cg, sunken ? cg.button().light( 110 ) : (hover || (cg.button() != qApp->palette().active().button())) ? cg.button() : optionHandler->InactiveButtonColor(), button.x(), button.y(), button.width(), button.height()/*+2*/, sunken, hover, false, pos ); + (bar && bar->orientation() == TQt::Vertical) ? + drawCombo( p, cg, sunken ? cg.button().light( 110 ) : (hover || (cg.button() != tqApp->palette().active().button())) ? cg.button() : optionHandler->InactiveButtonColor(), button.x(), (pos == full || pos == left) ? button.y() : button.y() - 7, button.width(), (pos == full) ? button.height()+2 : (pos == center) ? button.height()+16 : button.height()+9, sunken, hover, false, center ) : + drawCombo( p, cg, sunken ? cg.button().light( 110 ) : (hover || (cg.button() != tqApp->palette().active().button())) ? cg.button() : optionHandler->InactiveButtonColor(), button.x(), button.y(), button.width(), button.height()/*+2*/, sunken, hover, false, pos ); } else { - (bar && bar->orientation() == Qt::Vertical) ? - drawRectangularButton( p, cg, sunken ? cg.button().light( 110 ) : (hover || (cg.button() != qApp->palette().active().button())) ? cg.button() : optionHandler->InactiveButtonColor(), button.x(), (pos == full || pos == left) ? button.y() : button.y()-4, button.width(), (pos == full) ? button.height() : (pos == center) ? button.height()+8 : button.height()+4, sunken, hover, false) : - drawRectangularButton( p, cg, sunken ? cg.button().light( 110 ) : (hover || (cg.button() != qApp->palette().active().button())) ? cg.button() : optionHandler->InactiveButtonColor(), button.x(), button.y(), button.width(), button.height(), sunken, hover, false, pos); + (bar && bar->orientation() == TQt::Vertical) ? + drawRectangularButton( p, cg, sunken ? cg.button().light( 110 ) : (hover || (cg.button() != tqApp->palette().active().button())) ? cg.button() : optionHandler->InactiveButtonColor(), button.x(), (pos == full || pos == left) ? button.y() : button.y()-4, button.width(), (pos == full) ? button.height() : (pos == center) ? button.height()+8 : button.height()+4, sunken, hover, false) : + drawRectangularButton( p, cg, sunken ? cg.button().light( 110 ) : (hover || (cg.button() != tqApp->palette().active().button())) ? cg.button() : optionHandler->InactiveButtonColor(), button.x(), button.y(), button.width(), button.height(), sunken, hover, false, pos); } } } @@ -2402,7 +2402,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const #if 0 if ( toolbutton->hasFocus() && !toolbutton->focusProxy() ) { - QRect fr = toolbutton->rect(); + TQRect fr = toolbutton->rect(); fr.addCoords( 3, 3, -3, -3 ); drawPrimitive( PE_FocusRect, p, fr, cg ); } @@ -2412,12 +2412,12 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const } case CC_ScrollBar: { - const_cast<LiquidStyle*>( this ) ->currentScrollBar = ( QScrollBar * ) widget; + const_cast<LiquidStyle*>( this ) ->currentScrollBar = ( TQScrollBar * ) widget; KStyle::drawComplexControl( control, p, widget, r, cg, flags, controls, active, opt ); break; } case CC_SpinWidget: { - const QSpinWidget * sw = (const QSpinWidget *) widget; + const TQSpinWidget * sw = (const TQSpinWidget *) widget; SFlags flags; PrimitiveElement pe; @@ -2433,8 +2433,8 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const flags |= Style_Raised; pe = PE_SpinWidgetUp; - QRect re = sw->upRect(); - QColorGroup ucg = sw->isUpEnabled() ? cg : sw->palette().disabled(); + TQRect re = sw->upRect(); + TQColorGroup ucg = sw->isUpEnabled() ? cg : sw->palette().disabled(); p->fillRect(re, ucg.base()); drawPrimitive(pe, p, re, ucg, flags); } @@ -2448,8 +2448,8 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const flags |= Style_Raised; pe = PE_SpinWidgetDown; - QRect re = sw->downRect(); - QColorGroup dcg = sw->isDownEnabled() ? cg : sw->palette().disabled(); + TQRect re = sw->downRect(); + TQColorGroup dcg = sw->isDownEnabled() ? cg : sw->palette().disabled(); p->fillRect(re, dcg.base()); drawPrimitive(pe, p, re, dcg, flags); } @@ -2458,19 +2458,19 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const // SLIDER - KDE code for double buffering // ------------------------------------------------------------------- case CC_Slider: { - const QSlider* slider = (const QSlider*)widget; - QRect groove = querySubControlMetrics(CC_Slider, widget, SC_SliderGroove, opt); - QRect handle = querySubControlMetrics(CC_Slider, widget, SC_SliderHandle, opt); + const TQSlider* slider = (const TQSlider*)widget; + TQRect groove = querySubControlMetrics(CC_Slider, widget, SC_SliderGroove, opt); + TQRect handle = querySubControlMetrics(CC_Slider, widget, SC_SliderHandle, opt); // Double-buffer slider for no flicker - QPixmap pix(widget->size()); - QPainter p2; + TQPixmap pix(widget->size()); + TQPainter p2; p2.begin(&pix); if ( slider->parentWidget() && (slider->parentWidget()->paletteBackgroundPixmap() && !slider->parentWidget()->paletteBackgroundPixmap()->isNull() )) { - QPixmap pixmap = *(slider->parentWidget()->backgroundPixmap()); - if (QWidget *topDaddy = slider->topLevelWidget()){ - QPoint zero = QPoint(0,0); + TQPixmap pixmap = *(slider->parentWidget()->backgroundPixmap()); + if (TQWidget *topDaddy = slider->topLevelWidget()){ + TQPoint zero = TQPoint(0,0); #if 0 zero = slider->mapTo(topDaddy, zero); int zxmpw = zero.x()%pixmap.width(); @@ -2520,7 +2520,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const // Draw the tickmarks if (controls & SC_SliderTickmarks) - QCommonStyle::drawComplexControl(control, &p2, widget, + TQCommonStyle::drawComplexControl(control, &p2, widget, r, cg, flags, SC_SliderTickmarks, active, opt); // Draw the slider handle @@ -2531,35 +2531,35 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const } p2.end(); - bitBlt((QWidget*)widget, r.x(), r.y(), &pix); + bitBlt((TQWidget*)widget, r.x(), r.y(), &pix); break; } #ifndef QT_NO_LISTVIEW case CC_ListView: { if ( controls & SC_ListView ) { - QCommonStyle::drawComplexControl( control, p, widget, r, cg, flags, controls, active, opt ); + TQCommonStyle::drawComplexControl( control, p, widget, r, cg, flags, controls, active, opt ); } if ( controls & ( SC_ListViewBranch | SC_ListViewExpand ) ) { if ( opt.isDefault() ) break; - QListViewItem *item = opt.listViewItem(); - QListViewItem *child = item->firstChild(); - QListView* v = item->listView(); + TQListViewItem *item = opt.listViewItem(); + TQListViewItem *child = item->firstChild(); + TQListView* v = item->listView(); bool drawDotlines = optionHandler->DrawDotlines(); - static QBitmap *verticalLine = 0, *horizontalLine = 0; - static QCleanupHandler<QBitmap> qlv_cleanup_bitmap; + static TQBitmap *verticalLine = 0, *horizontalLine = 0; + static TQCleanupHandler<TQBitmap> qlv_cleanup_bitmap; int dotoffset = 0; if (drawDotlines && (optionHandler->DotlineStyle() == Dots)){ if ( !verticalLine ) { // make 128*1 and 1*128 bitmaps that can be used for // drawing the right sort of lines. - verticalLine = new QBitmap( 1, 128, TRUE ); - horizontalLine = new QBitmap( 128, 1, TRUE ); - QPointArray a( 64 ); - QPainter p; + verticalLine = new TQBitmap( 1, 128, TRUE ); + horizontalLine = new TQBitmap( 128, 1, TRUE ); + TQPointArray a( 64 ); + TQPainter p; p.begin( verticalLine ); int i; for( i=0; i<64; i++ ) @@ -2567,7 +2567,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const p.setPen( optionHandler->DotlineColor() ); p.drawPoints( a ); p.end(); - QApplication::flushX(); + TQApplication::flushX(); verticalLine->setMask( *verticalLine ); p.begin( horizontalLine ); for( i=0; i<64; i++ ) @@ -2575,7 +2575,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const p.setPen( optionHandler->DotlineColor() ); p.drawPoints( a ); p.end(); - QApplication::flushX(); + TQApplication::flushX(); horizontalLine->setMask( *horizontalLine ); qlv_cleanup_bitmap.add( &verticalLine ); qlv_cleanup_bitmap.add( &horizontalLine ); @@ -2585,12 +2585,12 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const int y = r.y(); int c; - QPointArray dotlines; + TQPointArray dotlines; if ( drawDotlines && active == SC_All && controls == SC_ListViewExpand ) { c = 2; dotlines.resize( 2 ); - dotlines[ 0 ] = QPoint( r.right(), r.top() ); - dotlines[ 1 ] = QPoint( r.right(), r.bottom() ); + dotlines[ 0 ] = TQPoint( r.right(), r.top() ); + dotlines[ 1 ] = TQPoint( r.right(), r.bottom() ); } else { int linetop = 0, linebot = 0; @@ -2614,7 +2614,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const lh = child ? child->height() : 0; else lh = p->fontMetrics().height() + 2 * v->itemMargin(); - lh = QMAX( lh, QApplication::globalStrut().height() ); + lh = TQMAX( lh, TQApplication::globalStrut().height() ); if ( lh % 2 > 0 ) lh++; linebot = y + lh / 2; @@ -2629,7 +2629,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const if ( !child->isOpen() ) p->drawLine( bx, linebot - 2, bx, linebot + 2 ); } else { // ultracool triangles ;-) - QPointArray a; + TQPointArray a; p->setPen( optionHandler->UseCustomExpanderColor() ? optionHandler->CustomExpanderColor() : cg.text() ); if ( child->isOpen() ) { a.setPoints( 3, bx - 4, linebot - 2, @@ -2648,17 +2648,17 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const } // dotlinery if ( drawDotlines ) { - dotlines[ c++ ] = QPoint( bx, linetop ); - dotlines[ c++ ] = QPoint( bx, linebot - (/* optionHandler->plusMinus() ? 4 : */5 ) ); - dotlines[ c++ ] = QPoint( bx + 5, linebot ); - dotlines[ c++ ] = QPoint( r.width(), linebot ); + dotlines[ c++ ] = TQPoint( bx, linetop ); + dotlines[ c++ ] = TQPoint( bx, linebot - (/* optionHandler->plusMinus() ? 4 : */5 ) ); + dotlines[ c++ ] = TQPoint( bx + 5, linebot ); + dotlines[ c++ ] = TQPoint( r.width(), linebot ); linetop = linebot + 5; } } else { // just dotlinery if ( drawDotlines ) { - dotlines[ c++ ] = QPoint( bx + 2, linebot ); - dotlines[ c++ ] = QPoint( r.width(), linebot ); + dotlines[ c++ ] = TQPoint( bx + 2, linebot ); + dotlines[ c++ ] = TQPoint( r.width(), linebot ); } } @@ -2674,8 +2674,8 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const if ( drawDotlines ) { if ( linetop < linebot ) { - dotlines[ c++ ] = QPoint( bx, linetop ); - dotlines[ c++ ] = QPoint( bx, linebot ); + dotlines[ c++ ] = TQPoint( bx, linetop ); + dotlines[ c++ ] = TQPoint( bx, linebot ); } } } @@ -2761,14 +2761,14 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const } if ( controls & SC_TitleBarLabel ) { - QRect ir = visualRect( querySubControlMetrics( CC_TitleBar, widget, SC_TitleBarLabel ), widget ); + TQRect ir = visualRect( querySubControlMetrics( CC_TitleBar, widget, SC_TitleBarLabel ), widget ); p->setPen( cg.text() ); p->drawText(ir.x()+2, ir.y(), ir.width()-2, ir.height(), AlignCenter | AlignVCenter | SingleLine, widget->caption() ); } - QRect ir; + TQRect ir; bool down = FALSE; - QPixmap pm; + TQPixmap pm; if ( controls & SC_TitleBarCloseButton ) { @@ -2848,16 +2848,16 @@ void LiquidStyle::drawComplexControl( ComplexControl control, QPainter *p, const } } -int LiquidStyle::styleHint(StyleHint sh, const QWidget * w, const QStyleOption & opt, QStyleHintReturn * shr) const +int LiquidStyle::styleHint(StyleHint sh, const TQWidget * w, const TQStyleOption & opt, TQStyleHintReturn * shr) const { switch (sh) { - case QStyle::SH_GUIStyle: - // if (w && ::qt_cast<QMenuBar*>(w)) + case TQStyle::SH_GUIStyle: + // if (w && ::tqt_cast<TQMenuBar*>(w)) // return WindowsStyle; return MacStyle; - case QStyle::SH_TabBar_Alignment: - if (optionHandler->CenterTabs() && !QApplication::reverseLayout()) + case TQStyle::SH_TabBar_Alignment: + if (optionHandler->CenterTabs() && !TQApplication::reverseLayout()) return AlignHCenter; else return KStyle::styleHint(sh, w, opt, shr); @@ -2866,14 +2866,14 @@ int LiquidStyle::styleHint(StyleHint sh, const QWidget * w, const QStyleOption & } } -QRect LiquidStyle::subRect( SubRect r, const QWidget *widget ) const { +TQRect LiquidStyle::subRect( SubRect r, const TQWidget *widget ) const { if (r == SR_ComboBoxFocusRect){ return querySubControlMetrics( CC_ComboBox, widget, SC_ComboBoxEditField ); } return ( KStyle::subRect( r, widget ) ); } -int LiquidStyle::pixelMetric( PixelMetric m, const QWidget *widget ) const +int LiquidStyle::pixelMetric( PixelMetric m, const TQWidget *widget ) const { switch ( m ) { @@ -2906,49 +2906,49 @@ int LiquidStyle::pixelMetric( PixelMetric m, const QWidget *widget ) const case PM_DefaultFrameWidth: { /* - if (widget && ::qt_cast<QFrame*>(widget) && ((QFrame*)widget)->frameShape() == QFrame::LineEditPanel) + if (widget && ::tqt_cast<TQFrame*>(widget) && ((TQFrame*)widget)->frameShape() == TQFrame::LineEditPanel) return 6;*/ - if (widget && widget->parentWidget() && ::qt_cast<QTabWidget*>(widget->parentWidget()) && widget->parentWidget()->parentWidget() && (widget->parentWidget()->parentWidget()->inherits("KonqMainWindow") || widget->parentWidget()->parentWidget()->inherits("KonqFrameContainer"))) //for the konqueror statusbar offset, thanks konqueror team... ... ... f***f***f***!!! + if (widget && widget->parentWidget() && ::tqt_cast<TQTabWidget*>(widget->parentWidget()) && widget->parentWidget()->parentWidget() && (widget->parentWidget()->parentWidget()->inherits("KonqMainWindow") || widget->parentWidget()->parentWidget()->inherits("KonqFrameContainer"))) //for the konqueror statusbar offset, thanks konqueror team... ... ... f***f***f***!!! return 0; return 2; } case PM_TabBarBaseOverlap: case PM_TabBarBaseHeight: { - if (!widget || !::qt_cast<QTabWidget*>(widget) || !widget->children()) + if (!widget || !::tqt_cast<TQTabWidget*>(widget) || !widget->children()) return 0; - QObjectListIt it( *widget->children() ); // iterate over the buttons - QObject *obj; - QTabBar *tabBar = 0L; + TQObjectListIt it( *widget->children() ); // iterate over the buttons + TQObject *obj; + TQTabBar *tabBar = 0L; while ( (obj = it.current()) != 0 ) { ++it; - if (::qt_cast<QTabBar*>(obj)) + if (::tqt_cast<TQTabBar*>(obj)) { - tabBar = (QTabBar*)obj; + tabBar = (TQTabBar*)obj; break; } } if (!tabBar || !tabBar->isVisible()) return 0; - if (optionHandler->TabStyle() == Chooser || (optionHandler->TabStyle() == Clever && widget && widget->topLevelWidget()->inherits("QDialog"))) + if (optionHandler->TabStyle() == Chooser || (optionHandler->TabStyle() == Clever && widget && widget->topLevelWidget()->inherits("TQDialog"))) return 12; if (m == PM_TabBarBaseOverlap) return 2; return 7; } case PM_TabBarTabHSpace: - if (optionHandler->TabStyle() == Chooser || (optionHandler->TabStyle() == Clever && widget && widget->topLevelWidget()->inherits("QDialog"))) return 18; + if (optionHandler->TabStyle() == Chooser || (optionHandler->TabStyle() == Clever && widget && widget->topLevelWidget()->inherits("TQDialog"))) return 18; return 24; case PM_TabBarTabVSpace: { - if (optionHandler->TabStyle() == Chooser || (optionHandler->TabStyle() == Clever && widget && widget->topLevelWidget()->inherits("QDialog"))) return 6; + if (optionHandler->TabStyle() == Chooser || (optionHandler->TabStyle() == Clever && widget && widget->topLevelWidget()->inherits("TQDialog"))) return 6; return 10; } case PM_TabBarTabShiftHorizontal: return 0; case PM_TabBarTabShiftVertical: - if (optionHandler->TabStyle() == Chooser || (optionHandler->TabStyle() == Clever && widget && widget->topLevelWidget()->inherits("QDialog"))) return 0; + if (optionHandler->TabStyle() == Chooser || (optionHandler->TabStyle() == Clever && widget && widget->topLevelWidget()->inherits("TQDialog"))) return 0; return 2; case PM_ButtonShiftHorizontal: return 0; @@ -2959,61 +2959,61 @@ int LiquidStyle::pixelMetric( PixelMetric m, const QWidget *widget ) const } } -QSize LiquidStyle::sizeFromContents( ContentsType contents, - const QWidget *widget, - const QSize &contentSize, - const QStyleOption& opt ) const { +TQSize LiquidStyle::sizeFromContents( ContentsType contents, + const TQWidget *widget, + const TQSize &contentSize, + const TQStyleOption& opt ) const { switch ( contents ) { case CT_PushButton: { // this is a little funky - we give values not based on pixelMetric // because we want a custom width/height and we can only give one // value in pixelMetric (used in sizeHint). Odd but works well - const QPushButton * button = ( const QPushButton* ) widget; + const TQPushButton * button = ( const TQPushButton* ) widget; int w = contentSize.width() + 26 > 80 ? contentSize.width() + 26 : 80; int h = contentSize.height() > 24 ? contentSize.height() : 25; if ( button->text().isEmpty() ) - return ( QSize( contentSize.width() + 2 * pixelMetric( PM_ButtonMargin, widget ), h ) ); + return ( TQSize( contentSize.width() + 2 * pixelMetric( PM_ButtonMargin, widget ), h ) ); - return ( QSize( w, h ) ); + return ( TQSize( w, h ) ); } case CT_ToolButton: { - if (widget->parentWidget() && ::qt_cast<QTabWidget*>(widget->parentWidget())){ - return QSize(contentSize.width() + 6, contentSize.height() + 5); + if (widget->parentWidget() && ::tqt_cast<TQTabWidget*>(widget->parentWidget())){ + return TQSize(contentSize.width() + 6, contentSize.height() + 5); } else{ int w = contentSize.width() + 6; int sh = contentSize.height() + 5; int sw = (int)(1.3*sh); if (w < sw) - return QSize(sw, sh); + return TQSize(sw, sh); else - return QSize(w, sh); + return TQSize(w, sh); } } case CT_Slider: { int h = contentSize.height() > 24 ? contentSize.height() : 24; - return ( QSize( contentSize.width(), h ) ); + return ( TQSize( contentSize.width(), h ) ); } case CT_ComboBox: { - // QSize sz = KStyle::sizeFromContents( contents, widget, contentSize, opt ); - // return ( QSize( sz.width()+3, sz.height() > 25 ? sz.height() : 25 ) ); - if ( ::qt_cast<const QComboBox *>(widget) && ((const QComboBox *)widget)->editable()) - return ( QSize( contentSize.width()+27, contentSize.height() + 4 > 22 ? contentSize.height() + 4 : 26 ) ); + // TQSize sz = KStyle::sizeFromContents( contents, widget, contentSize, opt ); + // return ( TQSize( sz.width()+3, sz.height() > 25 ? sz.height() : 25 ) ); + if ( ::tqt_cast<const TQComboBox *>(widget) && ((const TQComboBox *)widget)->editable()) + return ( TQSize( contentSize.width()+27, contentSize.height() + 4 > 22 ? contentSize.height() + 4 : 26 ) ); else - return ( QSize( contentSize.width()+27, contentSize.height() + 2 > 24 ? contentSize.height() + 2 : 24 ) ); + return ( TQSize( contentSize.width()+27, contentSize.height() + 2 > 24 ? contentSize.height() + 2 : 24 ) ); } case CT_PopupMenuItem: { if ( ! widget || opt.isDefault() ) break; - const QPopupMenu *popup = ( const QPopupMenu * ) widget; + const TQPopupMenu *popup = ( const TQPopupMenu * ) widget; bool checkable = popup->isCheckable(); - QMenuItem *mi = opt.menuItem(); + TQMenuItem *mi = opt.menuItem(); int maxpmw = opt.maxIconWidth(); int w = contentSize.width(); int h = contentSize.height(); @@ -3029,13 +3029,13 @@ QSize LiquidStyle::sizeFromContents( ContentsType contents, h = windowsSepHeight; } else { if ( mi->pixmap() ) - h = QMAX( h, mi->pixmap() ->height() + 2 * windowsItemFrame ); + h = TQMAX( h, mi->pixmap() ->height() + 2 * windowsItemFrame ); else if ( ! mi->text().isNull() ) - h = QMAX( h, popup->fontMetrics().height() + 2 * windowsItemVMargin + + h = TQMAX( h, popup->fontMetrics().height() + 2 * windowsItemVMargin + 2 * windowsItemFrame ); if ( mi->iconSet() != 0 ) - h = QMAX( h, mi->iconSet() ->pixmap( QIconSet::Small, - QIconSet::Normal ).height() + + h = TQMAX( h, mi->iconSet() ->pixmap( TQIconSet::Small, + TQIconSet::Normal ).height() + 2 * windowsItemFrame ); } if ( !mi->text().isNull() && mi->text().find( '\t' ) >= 0 ) @@ -3049,7 +3049,7 @@ QSize LiquidStyle::sizeFromContents( ContentsType contents, if ( checkable || maxpmw > 0 ) w += windowsCheckMarkHMargin; w += 20; - return ( QSize( w, h ) ); + return ( TQSize( w, h ) ); } default: break; @@ -3058,38 +3058,38 @@ QSize LiquidStyle::sizeFromContents( ContentsType contents, } -QPixmap LiquidStyle::stylePixmap( StylePixmap stylepixmap, - const QWidget* widget, - const QStyleOption& opt ) const { +TQPixmap LiquidStyle::stylePixmap( StylePixmap stylepixmap, + const TQWidget* widget, + const TQStyleOption& opt ) const { return KStyle::stylePixmap( stylepixmap, widget, opt ); } #include "eventfilter.cpp" -QRect LiquidStyle::querySubControlMetrics( ComplexControl control, const QWidget *widget, SubControl subcontrol, const QStyleOption &opt ) const +TQRect LiquidStyle::querySubControlMetrics( ComplexControl control, const TQWidget *widget, SubControl subcontrol, const TQStyleOption &opt ) const { if ( control == CC_ComboBox && subcontrol == SC_ComboBoxEditField ) - return QRect( 8, 3, widget->width() - 32, widget->height() - 7 ); + return TQRect( 8, 3, widget->width() - 32, widget->height() - 7 ); if (control == CC_TitleBar) { switch (subcontrol) { case SC_TitleBarSysMenu: - return QRect( widget->width() - 24, 1, 16, 16 ); + return TQRect( widget->width() - 24, 1, 16, 16 ); case SC_TitleBarMinButton: - return QRect( 26, 1, 16, 16 ); + return TQRect( 26, 1, 16, 16 ); case SC_TitleBarMaxButton: - return QRect( 47, 1, 16, 16 ); + return TQRect( 47, 1, 16, 16 ); case SC_TitleBarCloseButton: - return QRect( 5, 1, 16, 16 ); + return TQRect( 5, 1, 16, 16 ); case SC_TitleBarLabel: - return QRect( 68, 1, widget->width() - 107, 16 ); + return TQRect( 68, 1, widget->width() - 107, 16 ); case SC_TitleBarNormalButton: - return QRect( 26, 1, 16, 16 ); + return TQRect( 26, 1, 16, 16 ); case SC_TitleBarShadeButton: - return QRect( widget->width() - 29, 1, 24, 16 ); + return TQRect( widget->width() - 29, 1, 24, 16 ); case SC_TitleBarUnshadeButton: - return QRect( widget->width() - 29, 1, 24, 16 ); + return TQRect( widget->width() - 29, 1, 24, 16 ); default: return ( KStyle::querySubControlMetrics( control, widget, subcontrol, opt ) ); } @@ -3098,18 +3098,18 @@ QRect LiquidStyle::querySubControlMetrics( ComplexControl control, const QWidget return ( KStyle::querySubControlMetrics( control, widget, subcontrol, opt ) ); } -QImage LiquidStyle::fetchImage( const char *name ){ +TQImage LiquidStyle::fetchImage( const char *name ){ return uic_findImage( name ); } -QColor LiquidStyle::mapFadeColor(QColor &color, int index) const +TQColor LiquidStyle::mapFadeColor(TQColor &color, int index) const { - QRgb **rgb = fadeColorMap.find(color.rgb()); + TQRgb **rgb = fadeColorMap.find(color.rgb()); if (rgb) - return QColor((*rgb)[index]); + return TQColor((*rgb)[index]); // no color map found, create one and return the queried value - rgb = new QRgb*; - *rgb = new QRgb[10]; + rgb = new TQRgb*; + *rgb = new TQRgb[10]; int iRed = optionHandler->InactiveButtonColor().red(); int iGreen = optionHandler->InactiveButtonColor().green(); int iBlue = optionHandler->InactiveButtonColor().blue(); @@ -3118,37 +3118,37 @@ QColor LiquidStyle::mapFadeColor(QColor &color, int index) const int cBlue = color.blue(); for (int i = 10; i < 20; i++) { - (*rgb)[i-10] = qRgb( iRed + (cRed-iRed)*(i)/20, iGreen + (cGreen-iGreen)*(i)/20, iBlue + (cBlue-iBlue)*(i)/20); + (*rgb)[i-10] = tqRgb( iRed + (cRed-iRed)*(i)/20, iGreen + (cGreen-iGreen)*(i)/20, iBlue + (cBlue-iBlue)*(i)/20); } LiquidStyle *ptr = const_cast<LiquidStyle*>( this ); ptr->fadeColorMap.insert(color.rgb(), rgb); - return QColor((*rgb)[index]); + return TQColor((*rgb)[index]); } -QPixmap* LiquidStyle::processEmbedded( const char *label, const QColor &c, bool blend, const QColor *bg ) const { - QImage img( uic_findImage( label ) ); +TQPixmap* LiquidStyle::processEmbedded( const char *label, const TQColor &c, bool blend, const TQColor *bg ) const { + TQImage img( uic_findImage( label ) ); img.detach(); if ( img.isNull() ) { // shouldn't happen, been tested - qWarning( "Invalid embedded label %s", label ); + tqWarning( "Invalid embedded label %s", label ); return ( NULL ); } return ( adjustHSV( img, c, bg ) ); } -QPixmap* LiquidStyle::getPixmap( BitmapData item ) const +TQPixmap* LiquidStyle::getPixmap( BitmapData item ) const { if ( pixmaps[ item ] ) return ( pixmaps[ item ] ); - QColor bgColor( optionHandler->InactiveButtonColor() ); - QColor btnColor( isOOO ? optionHandler->CustomButtonColor() : qApp->palette().active().button() ); - QColor btnHoverColor( isOOO ? optionHandler->CustomButtonColor().light(120) : btnColor.light( 120 ) ); - QColor sbGrooveColor( optionHandler->useCustomColors() ? + TQColor bgColor( optionHandler->InactiveButtonColor() ); + TQColor btnColor( isOOO ? optionHandler->CustomButtonColor() : tqApp->palette().active().button() ); + TQColor btnHoverColor( isOOO ? optionHandler->CustomButtonColor().light(120) : btnColor.light( 120 ) ); + TQColor sbGrooveColor( optionHandler->useCustomColors() ? optionHandler->customColor( CustomSBGroove ) : bgColor ); - QColor sbSliderColor( optionHandler->useCustomColors() ? + TQColor sbSliderColor( optionHandler->useCustomColors() ? optionHandler->customColor( CustomSBSlider ) : bgColor ); - QColor sbSliderHoverColor( optionHandler->useCustomColors() ? + TQColor sbSliderHoverColor( optionHandler->useCustomColors() ? optionHandler->customColor( CustomSBSliderHover ) : isOOO?optionHandler->CustomButtonColor():btnColor ); - QColor sbSliderPressedColor( optionHandler->useCustomColors() ? + TQColor sbSliderPressedColor( optionHandler->useCustomColors() ? optionHandler->customColor( CustomSBSliderPressed ) : btnColor.dark(110) ); LiquidStyle *ptr = const_cast<LiquidStyle*>( this ); switch ( item ) @@ -3352,11 +3352,11 @@ QPixmap* LiquidStyle::getPixmap( BitmapData item ) const { if (optionHandler->style() == Jaguar) { - ptr->pixmaps[ TitleBar ] = new QPixmap(32,22); + ptr->pixmaps[ TitleBar ] = new TQPixmap(32,22); ptr->pixmaps[ TitleBar ]->fill( optionHandler->titleColor(0) ); - QPainter p; + TQPainter p; p.begin( ptr->pixmaps[ TitleBar ] ); - p.setPen( QColor( + p.setPen( TQColor( (optionHandler->titleColor(0).red()+optionHandler->titleColor(1).red())/2, (optionHandler->titleColor(0).green()+optionHandler->titleColor(1).green())/2, (optionHandler->titleColor(0).blue()+optionHandler->titleColor(1).blue())/2 )); @@ -3371,7 +3371,7 @@ QPixmap* LiquidStyle::getPixmap( BitmapData item ) const p.end(); } else - ptr->pixmaps[ TitleBar ] = &KPixmapEffect::gradient (*((KPixmap*)(new QPixmap(32,22))), optionHandler->titleColor(0), optionHandler->titleColor(1), KPixmapEffect::VerticalGradient, 22); + ptr->pixmaps[ TitleBar ] = &KPixmapEffect::gradient (*((KPixmap*)(new TQPixmap(32,22))), optionHandler->titleColor(0), optionHandler->titleColor(1), KPixmapEffect::VerticalGradient, 22); break; } default: |