diff options
Diffstat (limited to 'src/widget/ia_ora.cpp')
-rw-r--r-- | src/widget/ia_ora.cpp | 944 |
1 files changed, 472 insertions, 472 deletions
diff --git a/src/widget/ia_ora.cpp b/src/widget/ia_ora.cpp index a508738..0e3e5d2 100644 --- a/src/widget/ia_ora.cpp +++ b/src/widget/ia_ora.cpp @@ -29,50 +29,50 @@ * Boston, MA 02111-1307, USA. */ -#include <qdict.h> -#include <qdrawutil.h> -#include <qpainter.h> -#include <qpointarray.h> -#include <qstyleplugin.h> -#include <qprogressbar.h> - -#include <qcombobox.h> -#include <qheader.h> -#include <qmenubar.h> -#include <qpushbutton.h> -#include <qscrollbar.h> -#include <qslider.h> -#include <qtabbar.h> -#include <qtoolbutton.h> -#include <qtoolbar.h> -#include <qpopupmenu.h> +#include <tqdict.h> +#include <tqdrawutil.h> +#include <tqpainter.h> +#include <tqpointarray.h> +#include <tqstyleplugin.h> +#include <tqprogressbar.h> + +#include <tqcombobox.h> +#include <tqheader.h> +#include <tqmenubar.h> +#include <tqpushbutton.h> +#include <tqscrollbar.h> +#include <tqslider.h> +#include <tqtabbar.h> +#include <tqtoolbutton.h> +#include <tqtoolbar.h> +#include <tqpopupmenu.h> #include <kstandarddirs.h> #include <kdrawutil.h> #include <kpixmapeffect.h> -#include <qradiobutton.h> -#include <qimage.h> -#include <qcheckbox.h> +#include <tqradiobutton.h> +#include <tqimage.h> +#include <tqcheckbox.h> #include "ia_ora.h" #include "ia_ora.moc" #include "bitmaps.h" -#include <qlistview.h> -#include <qlistbox.h> +#include <tqlistview.h> +#include <tqlistbox.h> #include <kdebug.h> //#define USE_CROSS 1 // -- Style Plugin Interface ------------------------- -class ThemeMdvStylePlugin : public QStylePlugin +class ThemeMdvStylePlugin : public TQStylePlugin { public: ThemeMdvStylePlugin() {} ~ThemeMdvStylePlugin() {} - QStringList keys() const + TQStringList keys() const { - return QStringList() << "ia_ora"; + return TQStringList() << "ia_ora"; } - QStyle* create( const QString& key ) + TQStyle* create( const TQString& key ) { if ( key == "ia_ora" ) return new MandrivaStyle( ); @@ -85,7 +85,7 @@ Q_EXPORT_PLUGIN( ThemeMdvStylePlugin ) // ### Remove globals -QBitmap menuBmp; +TQBitmap menuBmp; static bool scrollmin = false; static bool scrollmax = false; @@ -118,7 +118,7 @@ MandrivaStyle::MandrivaStyle( ) verticalLine = 0; // setup pixmap cache... - pixmapCache = new QIntCache<CacheEntry>(150000, 499); + pixmapCache = new TQIntCache<CacheEntry>(150000, 499); pixmapCache->setAutoDelete(true); } @@ -131,7 +131,7 @@ MandrivaStyle::~MandrivaStyle() } -MandrivaStyle::MandrivaColorData *MandrivaStyle::realizeData (const QColorGroup &cg) const +MandrivaStyle::MandrivaColorData *MandrivaStyle::realizeData (const TQColorGroup &cg) const { MandrivaColorData *cdata; //define mandriva color @@ -143,16 +143,16 @@ MandrivaStyle::MandrivaColorData *MandrivaStyle::realizeData (const QColorGroup //G0 gb.background() //B2 gb.hightlight //Hardcode - if ( cg.background() == QColor( "#EFF3F7" ) ) + if ( cg.background() == TQColor( "#EFF3F7" ) ) { //Be sure to use design color - cdata->shades[0]=QColor( "#EFF3F7" ); - cdata->shades[1]=QColor( "#DFE7EF" ); - cdata->shades[2]=QColor( "#CFD7DF" ); - cdata->shades[3]=QColor( "#C7D3DF" ); - cdata->shades[4]=QColor( "#B6C3CF" ); - cdata->shades[5]=QColor( "#A6B2C7" ); - cdata->shades[6]=QColor( "#8692A6" ); + cdata->shades[0]=TQColor( "#EFF3F7" ); + cdata->shades[1]=TQColor( "#DFE7EF" ); + cdata->shades[2]=TQColor( "#CFD7DF" ); + cdata->shades[3]=TQColor( "#C7D3DF" ); + cdata->shades[4]=TQColor( "#B6C3CF" ); + cdata->shades[5]=TQColor( "#A6B2C7" ); + cdata->shades[6]=TQColor( "#8692A6" ); } else { @@ -166,39 +166,39 @@ MandrivaStyle::MandrivaColorData *MandrivaStyle::realizeData (const QColorGroup cdata->shades[6]=cdata->shades[0].dark(178); } - if ( cg.highlight() == QColor("#4965AE" ) ) // Blue + if ( cg.highlight() == TQColor("#4965AE" ) ) // Blue { - cdata->blueMdkColor[0]=QColor("#A6B6E7" ); - cdata->blueMdkColor[1]=QColor("#8EA2CF" ); - cdata->blueMdkColor[2]=QColor("#4965AE" ); - cdata->blueMdkColor[3]=QColor("#415DA6" ); - cdata->blueMdkColor[4]=QColor("#21459C" ); + cdata->blueMdkColor[0]=TQColor("#A6B6E7" ); + cdata->blueMdkColor[1]=TQColor("#8EA2CF" ); + cdata->blueMdkColor[2]=TQColor("#4965AE" ); + cdata->blueMdkColor[3]=TQColor("#415DA6" ); + cdata->blueMdkColor[4]=TQColor("#21459C" ); } - else if ( cg.highlight() == QColor("#8EC7FF" ) ) // Arctic + else if ( cg.highlight() == TQColor("#8EC7FF" ) ) // Arctic { - cdata->blueMdkColor[0]=QColor("#EFF7FF" ); - cdata->blueMdkColor[1]=QColor("#C7DFFF" ); - cdata->blueMdkColor[2]=QColor("#8EC7FF" ); - cdata->blueMdkColor[3]=QColor("#79BEFF" ); - cdata->blueMdkColor[4]=QColor("#69B6FF" ); + cdata->blueMdkColor[0]=TQColor("#EFF7FF" ); + cdata->blueMdkColor[1]=TQColor("#C7DFFF" ); + cdata->blueMdkColor[2]=TQColor("#8EC7FF" ); + cdata->blueMdkColor[3]=TQColor("#79BEFF" ); + cdata->blueMdkColor[4]=TQColor("#69B6FF" ); } - else if ( cg.highlight() == QColor("#7BAAE7" ) ) // Smooth + else if ( cg.highlight() == TQColor("#7BAAE7" ) ) // Smooth { - cdata->blueMdkColor[0]=QColor("#CEE3FF" ); - cdata->blueMdkColor[1]=QColor("#ADCFFF" ); - cdata->blueMdkColor[2]=QColor("#7BAAE7" ); - cdata->blueMdkColor[3]=QColor("#5A8AD6" ); - cdata->blueMdkColor[4]=QColor("#427DC6" ); + cdata->blueMdkColor[0]=TQColor("#CEE3FF" ); + cdata->blueMdkColor[1]=TQColor("#ADCFFF" ); + cdata->blueMdkColor[2]=TQColor("#7BAAE7" ); + cdata->blueMdkColor[3]=TQColor("#5A8AD6" ); + cdata->blueMdkColor[4]=TQColor("#427DC6" ); } - else if ( cg.highlight() == QColor("#F7B610" ) ) // Orange + else if ( cg.highlight() == TQColor("#F7B610" ) ) // Orange { - cdata->blueMdkColor[0]=QColor("#FFDF10" ); - cdata->blueMdkColor[1]=QColor("#FFCB10" ); - cdata->blueMdkColor[2]=QColor("#F7B610" ); - cdata->blueMdkColor[3]=QColor("#FFA208" ); - cdata->blueMdkColor[4]=QColor("#F79600" ); + cdata->blueMdkColor[0]=TQColor("#FFDF10" ); + cdata->blueMdkColor[1]=TQColor("#FFCB10" ); + cdata->blueMdkColor[2]=TQColor("#F7B610" ); + cdata->blueMdkColor[3]=TQColor("#FFA208" ); + cdata->blueMdkColor[4]=TQColor("#F79600" ); } - else if ( cg.highlight() == QColor("#CFD7DF" ) ) // Gray + else if ( cg.highlight() == TQColor("#CFD7DF" ) ) // Gray { cdata->blueMdkColor[0]=cdata->shades[1]; cdata->blueMdkColor[1]=cdata->shades[2]; @@ -221,16 +221,16 @@ MandrivaStyle::MandrivaColorData *MandrivaStyle::realizeData (const QColorGroup for (int i=0; i < 7; ++i) cdata->buttonColor[i] = cdata->shades[i]; } - else if ( cg.button() == QColor( "#EFF3F7" ) ) + else if ( cg.button() == TQColor( "#EFF3F7" ) ) { //Be sure to use design color - cdata->buttonColor[0]=QColor( "#EFF3F7" ); - cdata->buttonColor[1]=QColor( "#DFE7EF" ); - cdata->buttonColor[2]=QColor( "#CFD7DF" ); - cdata->buttonColor[3]=QColor( "#C7D3DF" ); - cdata->buttonColor[4]=QColor( "#B6C3CF" ); - cdata->buttonColor[5]=QColor( "#A6B2C7" ); - cdata->buttonColor[6]=QColor( "#8692A6" ); + cdata->buttonColor[0]=TQColor( "#EFF3F7" ); + cdata->buttonColor[1]=TQColor( "#DFE7EF" ); + cdata->buttonColor[2]=TQColor( "#CFD7DF" ); + cdata->buttonColor[3]=TQColor( "#C7D3DF" ); + cdata->buttonColor[4]=TQColor( "#B6C3CF" ); + cdata->buttonColor[5]=TQColor( "#A6B2C7" ); + cdata->buttonColor[6]=TQColor( "#8692A6" ); } else { @@ -247,23 +247,23 @@ MandrivaStyle::MandrivaColorData *MandrivaStyle::realizeData (const QColorGroup } /* We assume this seldom collides, since we can only cache one at a time */ -static long hashColorGroup (const QColorGroup &cg) +static long hashColorGroup (const TQColorGroup &cg) { return cg.button().rgb();// << 8 ^ cg.button().rgb(); } -const MandrivaStyle::MandrivaColorData *MandrivaStyle::lookupData (const QColorGroup &cg) const +const MandrivaStyle::MandrivaColorData *MandrivaStyle::lookupData (const TQColorGroup &cg) const { MandrivaColorData *cdata; long h; - QIntCache<MandrivaColorData> *cache; + TQIntCache<MandrivaColorData> *cache; h = hashColorGroup (cg); // Cast away the const crap // Nasty, but how else would i do it? - cache = (QIntCache<MandrivaColorData> *)&m_dataCache; + cache = (TQIntCache<MandrivaColorData> *)&m_dataCache; cdata = cache->find(h); @@ -281,25 +281,25 @@ const MandrivaStyle::MandrivaColorData *MandrivaStyle::lookupData (const QColorG return cdata; } -void MandrivaStyle::getShade (const QColorGroup &cg, int shadenr, QColor &res) const +void MandrivaStyle::getShade (const TQColorGroup &cg, int shadenr, TQColor &res) const { const MandrivaColorData *cdata = lookupData(cg); res = cdata->shades[shadenr]; } -void MandrivaStyle::updateHoverControl(const QPoint &pos) +void MandrivaStyle::updateHoverControl(const TQPoint &pos) { - QRegion repaint; + TQRegion repaint; enum Hover oldControl = hoverControl; hoverControl = HoverNone; if (!hoverWidget) return; - if (hoverWidget->inherits("QScrollBar")) + if (hoverWidget->inherits("TQScrollBar")) { - QRect subline(querySubControlMetrics(CC_ScrollBar, hoverWidget, + TQRect subline(querySubControlMetrics(CC_ScrollBar, hoverWidget, SC_ScrollBarSubLine)), addline(querySubControlMetrics(CC_ScrollBar, hoverWidget, SC_ScrollBarAddLine)), @@ -322,14 +322,14 @@ void MandrivaStyle::updateHoverControl(const QPoint &pos) || oldControl == HoverScrollBarSlider) repaint += slider; } - else if (hoverWidget->inherits("QComboBox")) + else if (hoverWidget->inherits("TQComboBox")) { - QComboBox *cb = static_cast<QComboBox*>(hoverWidget); + TQComboBox *cb = static_cast<TQComboBox*>(hoverWidget); // for not editable combo, this is not necessary if (!cb->editable()) return; - QRect comboArrow(querySubControlMetrics(CC_ComboBox, hoverWidget, + TQRect comboArrow(querySubControlMetrics(CC_ComboBox, hoverWidget, SC_ComboBoxArrow)), comboEditField(querySubControlMetrics(CC_ComboBox, hoverWidget, SC_ComboBoxEditField)); @@ -351,49 +351,49 @@ void MandrivaStyle::updateHoverControl(const QPoint &pos) hoverWidget->repaint(repaint, false); } -void MandrivaStyle::polish(QApplication* app) +void MandrivaStyle::polish(TQApplication* app) { if (!qstrcmp(app->argv()[0], "kicker")) kickerMode = true; } -void MandrivaStyle::polish(QWidget* widget) +void MandrivaStyle::polish(TQWidget* widget) { // Put in order of highest occurance to maximize hit rate - if ( widget->inherits( "QComboBox" ) - || widget->inherits("QScrollBar") - || widget->inherits("QHeader") - || widget->inherits( "QSlider" ) - || widget->inherits( "QCheckBox" ) - || widget->inherits("QSplitterHandle")) + if ( widget->inherits( "TQComboBox" ) + || widget->inherits("TQScrollBar") + || widget->inherits("TQHeader") + || widget->inherits( "TQSlider" ) + || widget->inherits( "TQCheckBox" ) + || widget->inherits("TQSplitterHandle")) { widget->installEventFilter(this); - if (widget->inherits( "QScrollBar" ) || widget->inherits( "QComboBox" )) + if (widget->inherits( "TQScrollBar" ) || widget->inherits( "TQComboBox" )) widget->setMouseTracking( true ); } - else if (widget->inherits("QMenuBar") - || widget->inherits("QPopupMenu") ) + else if (widget->inherits("TQMenuBar") + || widget->inherits("TQPopupMenu") ) { - widget->setBackgroundMode(QWidget::NoBackground); + widget->setBackgroundMode(TQWidget::NoBackground); } - else if (widget->inherits("QPushButton") ) + else if (widget->inherits("TQPushButton") ) { widget->installEventFilter(this); - widget->setBackgroundMode( QWidget::PaletteBackground ); + widget->setBackgroundMode( TQWidget::PaletteBackground ); } - else if ( widget->inherits( "KToolBarSeparator" ) || widget->inherits( "QToolBarSeparator" ) ) + else if ( widget->inherits( "KToolBarSeparator" ) || widget->inherits( "TQToolBarSeparator" ) ) { - widget->setBackgroundMode( QWidget::PaletteBackground ); + widget->setBackgroundMode( TQWidget::PaletteBackground ); } - else if (widget->inherits("QToolBarExtensionWidget")) + else if (widget->inherits("TQToolBarExtensionWidget")) { widget->installEventFilter(this); } else if ( widget->parentWidget() && - ( ( widget->inherits( "QListBox" ) && widget->parentWidget()->inherits( "QComboBox" ) ) + ( ( widget->inherits( "TQListBox" ) && widget->parentWidget()->inherits( "TQComboBox" ) ) || widget->inherits( "KCompletionBox" ) ) ) { - QListBox* listbox = (QListBox*) widget; + TQListBox* listbox = (TQListBox*) widget; listbox->setLineWidth( 1 ); listbox->setBackgroundMode( NoBackground ); widget->installEventFilter( this ); @@ -407,47 +407,47 @@ void MandrivaStyle::polish(QWidget* widget) } -void MandrivaStyle::unPolish(QWidget* widget) +void MandrivaStyle::unPolish(TQWidget* widget) { - QFont f = QApplication::font(); - QApplication::setFont( f, TRUE ); // get rid of the special fonts for special widget classes + TQFont f = TQApplication::font(); + TQApplication::setFont( f, TRUE ); // get rid of the special fonts for special widget classes - if ( widget->inherits( "QComboBox" ) - || widget->inherits("QScrollBar") - || widget->inherits("QHeader") - || widget->inherits( "QSlider" ) - || widget->inherits( "QCheckBox" ) - || widget->inherits("QSplitterHandle")) + if ( widget->inherits( "TQComboBox" ) + || widget->inherits("TQScrollBar") + || widget->inherits("TQHeader") + || widget->inherits( "TQSlider" ) + || widget->inherits( "TQCheckBox" ) + || widget->inherits("TQSplitterHandle")) { widget->removeEventFilter(this); } - else if ( widget->inherits("QMenuBar") - || widget->inherits("QPopupMenu")) + else if ( widget->inherits("TQMenuBar") + || widget->inherits("TQPopupMenu")) { - widget->setBackgroundMode(QWidget::PaletteBackground); + widget->setBackgroundMode(TQWidget::PaletteBackground); } - else if ( widget->inherits("QPushButton") ) + else if ( widget->inherits("TQPushButton") ) { widget->removeEventFilter(this); } - else if (widget->inherits("QToolBarExtensionWidget")) + else if (widget->inherits("TQToolBarExtensionWidget")) { widget->removeEventFilter(this); } else if ( widget->parentWidget() && - ( ( widget->inherits( "QListBox" ) && widget->parentWidget()->inherits( "QComboBox" ) ) + ( ( widget->inherits( "TQListBox" ) && widget->parentWidget()->inherits( "TQComboBox" ) ) || widget->inherits( "KCompletionBox" ) ) ) { - QListBox* listbox = (QListBox*) widget; + TQListBox* listbox = (TQListBox*) widget; listbox->setLineWidth( 1 ); listbox->setBackgroundMode( PaletteBackground ); widget->removeEventFilter( this ); widget->clearMask(); } - //For toolbar internal separators, return to button, too (can't use qt_cast here since don't have access to the class) - else if ( widget->inherits( "KToolBarSeparator" ) || widget->inherits( "QToolBarSeparator" ) ) + //For toolbar internal separators, return to button, too (can't use tqt_cast here since don't have access to the class) + else if ( widget->inherits( "KToolBarSeparator" ) || widget->inherits( "TQToolBarSeparator" ) ) { - widget->setBackgroundMode( QWidget::PaletteBackground ); + widget->setBackgroundMode( TQWidget::PaletteBackground ); } else if ( !qstrcmp( widget->name(), kdeToolbarWidget) ) { @@ -459,13 +459,13 @@ void MandrivaStyle::unPolish(QWidget* widget) } /* reimp. */ -void MandrivaStyle::renderMenuBlendPixmap( KPixmap& pix, const QColorGroup &cg, - const QPopupMenu* /* popup */ ) const +void MandrivaStyle::renderMenuBlendPixmap( KPixmap& pix, const TQColorGroup &cg, + const TQPopupMenu* /* popup */ ) const { - QColor col = cg.background(); + TQColor col = cg.background(); //FIXME !!!!!!!!!!!!!!! #ifdef Q_WS_X11 // Only draw menu gradients on TrueColor, X11 visuals - if ( QPaintDevice::x11AppDepth() >= 24 ) + if ( TQPaintDevice::x11AppDepth() >= 24 ) KPixmapEffect::gradient( pix, col.light(120), col.dark(115), KPixmapEffect::HorizontalGradient ); else @@ -475,11 +475,11 @@ void MandrivaStyle::renderMenuBlendPixmap( KPixmap& pix, const QColorGroup &cg, void MandrivaStyle::drawHandle( const MandrivaColorData *cdata, - QPainter *p, - const QRect &r, - const QColorGroup & /*cg*/, + TQPainter *p, + const TQRect &r, + const TQColorGroup & /*cg*/, SFlags flags, - const QStyleOption& /*opt*/, + const TQStyleOption& /*opt*/, bool /*drawBorder*/ /*for the future remove it*/, bool drawGradient) const { int x,y,width,height; @@ -491,7 +491,7 @@ void MandrivaStyle::drawHandle( const MandrivaColorData *cdata, { if ( drawGradient ) - renderGradient( p, QRect(x+2,y+2,width-4, height-4), + renderGradient( p, TQRect(x+2,y+2,width-4, height-4), cdata->shades[2], cdata->shades[0],false); if(width > 30) { @@ -499,19 +499,19 @@ void MandrivaStyle::drawHandle( const MandrivaColorData *cdata, for(i = 0; i < 3; i++) { drawHandlePoint (cdata,p, (delta + 9*i), - y + QMAX((height-4)/2,0)); + y + TQMAX((height-4)/2,0)); } } else { drawHandlePoint (cdata, p, x + (width-4)/2 , - y + QMAX((height-4)/2,0)); + y + TQMAX((height-4)/2,0)); } } else { if( drawGradient ) - renderGradient(p, QRect(x+2,y+2,width-4, height-4), + renderGradient(p, TQRect(x+2,y+2,width-4, height-4), cdata->shades[0],cdata->shades[2], true); if(height > 30) @@ -519,19 +519,19 @@ void MandrivaStyle::drawHandle( const MandrivaColorData *cdata, delta = y + (height / 2) - 11; for(i = 0; i < 3; i++) { - drawHandlePoint (cdata, p, x + QMAX((width-4)/2,0), + drawHandlePoint (cdata, p, x + TQMAX((width-4)/2,0), delta+9*i); } } else { - drawHandlePoint (cdata,p, x + QMAX((width-4)/2,0), + drawHandlePoint (cdata,p, x + TQMAX((width-4)/2,0), y + (height-4) / 2); } } } -void MandrivaStyle::drawGroupBox(const MandrivaColorData *cdata, const QColorGroup & cg, QPainter *p, const QRect & r, bool /*active*/, bool sunken)const +void MandrivaStyle::drawGroupBox(const MandrivaColorData *cdata, const TQColorGroup & cg, TQPainter *p, const TQRect & r, bool /*active*/, bool sunken)const { int x,y,w,h; x=r.x(); y=r.y(); w=r.width(); h=r.height(); @@ -560,12 +560,12 @@ void MandrivaStyle::drawGroupBox(const MandrivaColorData *cdata, const QColorGro } void MandrivaStyle::drawLineSeparator(const MandrivaColorData *cdata, - const QColorGroup & cg, QPainter *p, - const QRect & r, bool horizontal, + const TQColorGroup & cg, TQPainter *p, + const TQRect & r, bool horizontal, bool /*active*/, bool /*sunken*/, bool skipOffset )const { - QRect line1, line2; + TQRect line1, line2; p->fillRect(r, cg.background()); if (horizontal) @@ -578,8 +578,8 @@ void MandrivaStyle::drawLineSeparator(const MandrivaColorData *cdata, // draw the separator in the middle of the given rect int middle = (r.top() + r.bottom()) / 2; - line1 = QRect(r.x() + offset, middle, r.width() - 2*offset, 1); - line2 = QRect(r.x() + offset, middle+1, r.width() - 2*offset, 1); + line1 = TQRect(r.x() + offset, middle, r.width() - 2*offset, 1); + line2 = TQRect(r.x() + offset, middle+1, r.width() - 2*offset, 1); } else { @@ -591,8 +591,8 @@ void MandrivaStyle::drawLineSeparator(const MandrivaColorData *cdata, // draw the separator in the middle of the given rect int middle = (r.left() + r.right()) / 2; - line1 = QRect(middle, r.y() + offset, 1, r.height() - 2*offset); - line2 = QRect(middle+1, r.y() + offset, 1, r.height() - 2*offset); + line1 = TQRect(middle, r.y() + offset, 1, r.height() - 2*offset); + line2 = TQRect(middle+1, r.y() + offset, 1, r.height() - 2*offset); } p->setPen(cdata->shades[2]); @@ -603,7 +603,7 @@ void MandrivaStyle::drawLineSeparator(const MandrivaColorData *cdata, } -void MandrivaStyle::drawFrame( const MandrivaColorData *cdata, const QColorGroup & cg, QPainter *p, const QRect & r, bool active )const +void MandrivaStyle::drawFrame( const MandrivaColorData *cdata, const TQColorGroup & cg, TQPainter *p, const TQRect & r, bool active )const { //use by checkbox,lineedit,spinbox,combobox int x,y,w,h; @@ -628,11 +628,11 @@ void MandrivaStyle::drawFrame( const MandrivaColorData *cdata, const QColorGroup } // This function draws primitive elements as well as their masks. void MandrivaStyle::drawPrimitive( PrimitiveElement pe, - QPainter *p, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { int x, y, xw, yh; x= r.x(); @@ -665,7 +665,7 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, case PE_PanelMenuBar: // Menu { //FIXME - p->fillRect(r, cg.brush(QColorGroup::Background)); + p->fillRect(r, cg.brush(TQColorGroup::Background)); int x2 = r.x()+r.width()-1; int y2 = r.y()+r.height()-1; @@ -693,8 +693,8 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, { //Gradient border colors. //(Same as in gradients.cpp) - QColor gradTop = cg.base(); - QColor gradBot = cdata->shades[2]; + TQColor gradTop = cg.base(); + TQColor gradBot = cdata->shades[2]; if (horiz) { //Top line @@ -729,9 +729,9 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, case PE_DockWindowResizeHandle: case PE_Splitter: { - QRect real(r); + TQRect real(r); real.addCoords( 1, 0,0 ,0); - QColor color = (hoverWidget == p->device())?cdata->shades[1]:cg.background(); + TQColor color = (hoverWidget == p->device())?cdata->shades[1]:cg.background(); p->fillRect( r, color ); p->setPen( cg.background() ); p->drawPoint( r.x(), 0 ); @@ -747,7 +747,7 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, drawFrame( cdata, cg, p, r, true ); break; } - case PE_Panel: //QListBox and co + case PE_Panel: //TQListBox and co { if(kickerMode) break; @@ -769,7 +769,7 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, : opt.lineWidth()*/1; if (lw == 1 || lw == 2) { - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); int x,y,w,h; r.rect(&x, &y, &w, &h); int x2 = x+w-1; @@ -830,8 +830,8 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, { bool horizontal = true; bool isFirst = false; - if (p && p->device()->devType() == QInternal::Widget) { - QHeader* hdr = dynamic_cast<QHeader*>(p->device()); + if (p && p->device()->devType() == TQInternal::Widget) { + TQHeader* hdr = dynamic_cast<TQHeader*>(p->device()); if (hdr) { horizontal = ( hdr->orientation() == Horizontal ); @@ -840,26 +840,26 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, } int x,y,w,h; r.rect(&x, &y, &w, &h); - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); //TODO verify it if (flags & Style_MouseOver) - renderGradient( p, QRect(x, y, w, h-1), + renderGradient( p, TQRect(x, y, w, h-1), cdata->shades[0],cdata->shades[2], !horizontal ); else if ( on ) - renderGradient(p, QRect(x, y, w, h-1), + renderGradient(p, TQRect(x, y, w, h-1), cdata->shades[0],cdata->shades[2], !horizontal ); else if ( down ) - renderGradient(p, QRect(x, y, w, h-1), + renderGradient(p, TQRect(x, y, w, h-1), cdata->shades[2],cdata->shades[1], !horizontal ); else - renderGradient( p, QRect(x, y, w, h-1), + renderGradient( p, TQRect(x, y, w, h-1), cdata->shades[0],cdata->shades[2], !horizontal ); //don't draw separator for first eleemtn if ( !isFirst ) { - drawLineSeparator(cdata, cg, p, QRect(x,y,2,h), false, true, false, false); + drawLineSeparator(cdata, cg, p, TQRect(x,y,2,h), false, true, false, false); } p->setPen( oldPen ); break; @@ -868,7 +868,7 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, { //radiobutton bool enabled = flags & Style_Enabled; p->setPen( cdata->shades[4] ); - p->setBrush( QBrush( enabled ? cg.base() : cdata->shades[0] ) ); + p->setBrush( TQBrush( enabled ? cg.base() : cdata->shades[0] ) ); p->drawEllipse( r ); bool specificBackground = excludeColor( cg.highlight(), enabled ); @@ -899,11 +899,11 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, } case PE_CheckListIndicator: { - QCheckListItem *item = opt.checkListItem(); + TQCheckListItem *item = opt.checkListItem(); if(!item) return; int x = r.x(), y = r.y(), w = r.width(), h = r.width(); - drawPrimitive(PE_Indicator, p, QRect(x-2, y-2 , w+3, h+3 ) , cg, flags ); + drawPrimitive(PE_Indicator, p, TQRect(x-2, y-2 , w+3, h+3 ) , cg, flags ); break; } //case PE_IndicatorMask: @@ -912,7 +912,7 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, bool enabled = flags & Style_Enabled; //draw background use base color - QRect ar( x+1, y+1, x+11, y+10 ); + TQRect ar( x+1, y+1, x+11, y+10 ); p->fillRect (ar, enabled ? cg.base() : cdata->shades[0]); bool specificBackground = excludeColor( cg.highlight(), enabled ); //TODO mouse over @@ -940,7 +940,7 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, p->drawLine( x+8, y+8, x+10, y+8 ); p->drawLine( x+7, y+7, x+9, y+7 ); #else - if (QApplication::reverseLayout() ) + if (TQApplication::reverseLayout() ) { if ( specificBackground ) p->setPen( enabled ? cdata->shades[6]:cdata->shades[3] ); @@ -956,7 +956,7 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, p->drawLine( x+9,y+6,x+10,y+6 ); if ( specificBackground ) - p->setPen( enabled ? Qt::black : cdata->shades[4]); + p->setPen( enabled ? TQt::black : cdata->shades[4]); else p->setPen( enabled ? cdata->blueMdkColor[4] : cdata->shades[4]); p->drawLine( x+5,y+7,x+10,y+7 ); @@ -979,7 +979,7 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, p->drawLine( x+2,y+6,x+3,y+6 ); if ( specificBackground ) - p->setPen( enabled ? Qt::black : cdata->shades[4]); + p->setPen( enabled ? TQt::black : cdata->shades[4]); else p->setPen( enabled ? cdata->blueMdkColor[4] : cdata->shades[4]); @@ -999,7 +999,7 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, p->drawLine( x+4, y+5, x+8, y+5 ); p->drawLine( x+3, y+6, x+9, y+6 ); if ( specificBackground ) - p->setPen( enabled ? Qt::black : cdata->shades[5]); + p->setPen( enabled ? TQt::black : cdata->shades[5]); else p->setPen( enabled ? cdata->blueMdkColor[4] : cdata->shades[5]); p->drawLine( x+4, y+7, x+8, y+7 ); @@ -1052,8 +1052,8 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, case PE_SpinWidgetDown: { p->save(); - QRect br; - QRect re( r ); + TQRect br; + TQRect re( r ); br.setRect( r.x() , r.y(), r.width()+1, r.height() ); bool down = flags & Style_Down; @@ -1074,7 +1074,7 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, p->drawLine( br.x()-1, br.y(), br.x()-1, br.x()+r.height() ); //TODO verify +1 ??? if ( pe == PE_SpinWidgetUp ) { - QRect tmp( re ); + TQRect tmp( re ); tmp.addCoords( -1, -2, 1, 1 ); p->drawRect( tmp ); //p->drawLine(br.x()-1, br.y()+br.height(), br.x()+br.width()-1, br.y()+br.height() ); //TODO verify +1 ??? @@ -1083,7 +1083,7 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, } else { - QRect tmp( re ); + TQRect tmp( re ); tmp.addCoords( -1, 0, 1, 1 ); p->drawRect( tmp ); @@ -1101,14 +1101,14 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, //TODO don't use same color for active/inactive p->setPen( cg.buttonText() ); p->setBrush( cg.buttonText() ); - QPointArray a; + TQPointArray a; if ( pe == PE_SpinWidgetDown ) - a.setPoints(QCOORDARRLEN(d_spinarrow), d_spinarrow); + a.setPoints(TQCOORDARRLEN(d_spinarrow), d_spinarrow); else { //move one pixel up re.addCoords( 0, 1,0,0); - a.setPoints(QCOORDARRLEN(u_spinarrow), u_spinarrow); + a.setPoints(TQCOORDARRLEN(u_spinarrow), u_spinarrow); } drawMandrivaArrow( a, p, re, cg, flags, opt ); p->restore(); @@ -1121,7 +1121,7 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, p->setPen( cdata->shades[5]); if( scrollmin && scrollmax ) { - QRect tmpRect(r); + TQRect tmpRect(r); if( !horizontal ) tmpRect.addCoords(0,0,0,1); else @@ -1146,19 +1146,19 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, // if the mouse is over the slider, the first half of the gradient changes bool mouseover = flags & Style_MouseOver; - QRect tmpRect(r), firstHalf, secondHalf; + TQRect tmpRect(r), firstHalf, secondHalf; if (horizontal) { tmpRect.addCoords( 0, 1, 0, -1 ); - firstHalf = QRect(tmpRect.x(), tmpRect.y(), tmpRect.width(), tmpRect.height()/2); - secondHalf = QRect(tmpRect.x(), tmpRect.height()/2 + 1, + firstHalf = TQRect(tmpRect.x(), tmpRect.y(), tmpRect.width(), tmpRect.height()/2); + secondHalf = TQRect(tmpRect.x(), tmpRect.height()/2 + 1, tmpRect.width(), tmpRect.height() - (tmpRect.height()/2)); } else { tmpRect.addCoords( 1, 0, -1, 0 ); - firstHalf = QRect(tmpRect.x(), tmpRect.y(), tmpRect.width()/2, tmpRect.height()); - secondHalf = QRect(tmpRect.width()/2 + 1, tmpRect.y(), + firstHalf = TQRect(tmpRect.x(), tmpRect.y(), tmpRect.width()/2, tmpRect.height()); + secondHalf = TQRect(tmpRect.width()/2 + 1, tmpRect.y(), tmpRect.width() - (tmpRect.width()/2), tmpRect.height()); } @@ -1217,11 +1217,11 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, if (flags & Style_Horizontal) { p->drawLine(x, y, x2, y); p->drawLine(x, y2, x2, y2); - p->fillRect( QRect( x, y+1, w, h-2),cdata->shades[0] ); + p->fillRect( TQRect( x, y+1, w, h-2),cdata->shades[0] ); } else { p->drawLine(x, y, x, y2); p->drawLine(x2, y, x2, y2); - p->fillRect( QRect( x+1, y, w-2, h),cdata->shades[0] ); + p->fillRect( TQRect( x+1, y, w-2, h),cdata->shades[0] ); } break; } @@ -1243,10 +1243,10 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, if (w > 4 && h > 4) { if (sunken) - renderGradient(p, QRect(x+1, y+1, w-2, h-2), + renderGradient(p, TQRect(x+1, y+1, w-2, h-2), cdata->shades[2],cdata->shades[1], !horizontal); else if ( flags & Style_Enabled ) - renderGradient(p, QRect(x+1, y+1, w-2, h-2), + renderGradient(p, TQRect(x+1, y+1, w-2, h-2), cdata->shades[0], mouseover ? cdata->shades[1] : cdata->shades[2], !horizontal ); } @@ -1301,7 +1301,7 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, { if (menuBmp.isNull()) { - menuBmp = QBitmap( 12 , 12, menu_check_bits, true); + menuBmp = TQBitmap( 12 , 12, menu_check_bits, true); menuBmp.setMask(menuBmp); } int x,y; @@ -1340,7 +1340,7 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, if (sunken) p->fillRect(x+2, y+2, w-4, h-4, cg.button()); /*else - renderGradient( p, QRect(x+2, y+2, w-4, h-4), + renderGradient( p, TQRect(x+2, y+2, w-4, h-4), cg.button(), flags & Style_Horizontal );*/ } break; @@ -1350,23 +1350,23 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, { if (pe >= PE_ArrowUp && pe <= PE_ArrowLeft) { - QPointArray a; + TQPointArray a; //array point define into bitmap.h switch(pe) { case PE_ArrowUp: - a.setPoints(QCOORDARRLEN(u_arrow), u_arrow); + a.setPoints(TQCOORDARRLEN(u_arrow), u_arrow); break; case PE_ArrowDown: - a.setPoints(QCOORDARRLEN(d_arrow), d_arrow); + a.setPoints(TQCOORDARRLEN(d_arrow), d_arrow); break; case PE_ArrowLeft: - a.setPoints(QCOORDARRLEN(l_arrow), l_arrow); + a.setPoints(TQCOORDARRLEN(l_arrow), l_arrow); break; default: - a.setPoints(QCOORDARRLEN(r_arrow), r_arrow); + a.setPoints(TQCOORDARRLEN(r_arrow), r_arrow); } drawMandrivaArrow( a, p, r, cg, flags, opt ); } @@ -1376,13 +1376,13 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe, } //switch } -void MandrivaStyle::drawMandrivaArrow( QPointArray a, QPainter *p, - const QRect &r, - const QColorGroup &cg, +void MandrivaStyle::drawMandrivaArrow( TQPointArray a, TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption& /*opt*/ ) const + const TQStyleOption& /*opt*/ ) const { - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); a.translate( r.x() + r.width() / 2, r.y() + r.height() / 2 ); p->setPen(flags & Style_Enabled ? cg.buttonText() : cg.mid() ); p->drawLineSegments( a ); @@ -1390,12 +1390,12 @@ void MandrivaStyle::drawMandrivaArrow( QPointArray a, QPainter *p, } void MandrivaStyle::drawKStylePrimitive( KStylePrimitive pe, - QPainter* p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption &opt ) const + const TQStyleOption &opt ) const { const MandrivaColorData *cdata = lookupData(cg); switch(pe) @@ -1412,7 +1412,7 @@ void MandrivaStyle::drawKStylePrimitive( KStylePrimitive pe, // ------------------------------------------------------------------- case KPE_ToolBarHandle: { - QRect real(r); + TQRect real(r); real.addCoords( -1, 0,0,0); drawHandle( cdata, p,r,cg,flags,opt,true ); break; @@ -1421,10 +1421,10 @@ void MandrivaStyle::drawKStylePrimitive( KStylePrimitive pe, // ------------------------------------------------------------------- case KPE_SliderGroove: { - const QSlider* sl = static_cast< const QSlider* >( widget ); + const TQSlider* sl = static_cast< const TQSlider* >( widget ); bool horizontal = sl->orientation() == Horizontal; //TODO fixme - p->fillRect( QRect( r.x()+1, r.y()+1, r.width()-2, r.height()-2 ),cdata->shades[0] ); + p->fillRect( TQRect( r.x()+1, r.y()+1, r.width()-2, r.height()-2 ),cdata->shades[0] ); p->setPen( cdata->shades[1] ); int pos = sl->sliderStart(); @@ -1432,10 +1432,10 @@ void MandrivaStyle::drawKStylePrimitive( KStylePrimitive pe, if ( horizontal ) { //bidi - if (QApplication::reverseLayout() ) - p->fillRect( QRect( pos, 1, r.right(), r.height()-2 ),cdata->shades[3] ); + if (TQApplication::reverseLayout() ) + p->fillRect( TQRect( pos, 1, r.right(), r.height()-2 ),cdata->shades[3] ); else - p->fillRect( QRect( 1, 1, pos, r.height()-2 ),cdata->shades[3] ); + p->fillRect( TQRect( 1, 1, pos, r.height()-2 ),cdata->shades[3] ); for ( int i = 12; i < r.width() ; ) { p->drawLine( i, r.y()+1, i, r.height()-2 ); @@ -1444,7 +1444,7 @@ void MandrivaStyle::drawKStylePrimitive( KStylePrimitive pe, } else { - p->fillRect( QRect( 1, pos, r.width()-2, r.height() ),cdata->shades[3] ); + p->fillRect( TQRect( 1, pos, r.width()-2, r.height() ),cdata->shades[3] ); for ( int i = 12; i < r.height() ; ) { p->drawLine( r.x(), i, r.width(), i ); @@ -1459,7 +1459,7 @@ void MandrivaStyle::drawKStylePrimitive( KStylePrimitive pe, // ------------------------------------------------------------------- case KPE_SliderHandle: { - const QSlider* sl = static_cast< const QSlider* >( widget ); + const TQSlider* sl = static_cast< const TQSlider* >( widget ); bool horizontal = sl->orientation() == Horizontal; bool mouseOver = (widget == hoverWidget); int x = r.x(); @@ -1524,10 +1524,10 @@ void MandrivaStyle::drawKStylePrimitive( KStylePrimitive pe, { // make 128*1 and 1*128 bitmaps that can be used for // drawing the right sort of lines. - verticalLine = new QBitmap( 1, 129, true ); - horizontalLine = new QBitmap( 128, 1, true ); - QPointArray a( 64 ); - QPainter p2; + verticalLine = new TQBitmap( 1, 129, true ); + horizontalLine = new TQBitmap( 128, 1, true ); + TQPointArray a( 64 ); + TQPainter p2; p2.begin( verticalLine ); int i; @@ -1536,7 +1536,7 @@ void MandrivaStyle::drawKStylePrimitive( KStylePrimitive pe, p2.setPen( cdata->shades[4] ); p2.drawPoints( a ); p2.end(); - QApplication::flushX(); + TQApplication::flushX(); verticalLine->setMask( *verticalLine ); p2.begin( horizontalLine ); @@ -1545,7 +1545,7 @@ void MandrivaStyle::drawKStylePrimitive( KStylePrimitive pe, p2.setPen( cdata->shades[4] ); p2.drawPoints( a ); p2.end(); - QApplication::flushX(); + TQApplication::flushX(); horizontalLine->setMask( *horizontalLine ); } @@ -1594,12 +1594,12 @@ void MandrivaStyle::drawKStylePrimitive( KStylePrimitive pe, } void MandrivaStyle::drawControl( ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { const MandrivaColorData *cdata = lookupData(cg); switch (element) @@ -1612,10 +1612,10 @@ void MandrivaStyle::drawControl( ControlElement element, //progressbar case CE_ProgressBarContents: { - const QProgressBar* pb = (const QProgressBar*)widget; - QRect backend = subRect(SR_ProgressBarContents, widget); + const TQProgressBar* pb = (const TQProgressBar*)widget; + TQRect backend = subRect(SR_ProgressBarContents, widget); double progress = pb->progress(); - bool reverse = QApplication::reverseLayout(); + bool reverse = TQApplication::reverseLayout(); int steps = pb->totalSteps(); if (!pb || !backend.isValid()) @@ -1627,16 +1627,16 @@ void MandrivaStyle::drawControl( ControlElement element, //draw border drawPrimitive( PE_PanelLineEdit, p, r, cg ); - QRect cr(backend); + TQRect cr(backend); cr.addCoords( 1, 1, -2, -2 ); // Draw progress bar gradient if (progress > 0 || steps == 0) { double pg = (steps == 0) ? 0.1 : progress / steps; - int width = QMIN(cr.width(), (int)(pg * cr.width())); + int width = TQMIN(cr.width(), (int)(pg * cr.width())); if (steps == 0) - width = QMIN(width,20); //Don't cross squares + width = TQMIN(width,20); //Don't cross squares if (steps == 0) { //Busy indicator @@ -1655,7 +1655,7 @@ void MandrivaStyle::drawControl( ControlElement element, pstep = - (pstep - 2 * remWidth ); } if( reverse ) - renderGradient(p, QRect(cr.x() + cr.width() - width - pstep, cr.y(), width, cr.height()), + renderGradient(p, TQRect(cr.x() + cr.width() - width - pstep, cr.y(), width, cr.height()), cdata->shades[2],cdata->shades[1], false); else renderGradient(p, cr, @@ -1670,8 +1670,8 @@ void MandrivaStyle::drawControl( ControlElement element, { //convert it as after //TODO Verify it - QPixmap gradient(1, cr.height()+1); - QPainter painter(&gradient); + TQPixmap gradient(1, cr.height()+1); + TQPainter painter(&gradient); KPixmap tempPixmap; tempPixmap.resize(1, cr.height()/2+1); KPixmapEffect::gradient(tempPixmap, @@ -1686,7 +1686,7 @@ void MandrivaStyle::drawControl( ControlElement element, KPixmapEffect::VerticalGradient); painter.drawPixmap(0, cr.height()/2 +1, tempPixmap); painter.end(); - QRect tmp( cr.width()-width+1, cr.y(),width+1,cr.height() ); + TQRect tmp( cr.width()-width+1, cr.y(),width+1,cr.height() ); tmp.addCoords( 0, 0, 0, 1 ); p->drawTiledPixmap( tmp , gradient ); bool changed = false; @@ -1708,8 +1708,8 @@ void MandrivaStyle::drawControl( ControlElement element, } else { - QPixmap gradient(1, cr.height()+1); - QPainter painter(&gradient); + TQPixmap gradient(1, cr.height()+1); + TQPainter painter(&gradient); KPixmap tempPixmap; tempPixmap.resize(1, cr.height()/2+1); KPixmapEffect::gradient(tempPixmap, @@ -1724,7 +1724,7 @@ void MandrivaStyle::drawControl( ControlElement element, KPixmapEffect::VerticalGradient); painter.drawPixmap(0, cr.height()/2 +1, tempPixmap); painter.end(); - QRect tmp( cr.x(), cr.y(),width-1,cr.height() ); + TQRect tmp( cr.x(), cr.y(),width-1,cr.height() ); tmp.addCoords( 0, 0, 0, 1 ); p->drawTiledPixmap( tmp , gradient ); bool changed = false; @@ -1748,7 +1748,7 @@ void MandrivaStyle::drawControl( ControlElement element, } case CE_ProgressBarLabel: { - const QProgressBar * pb = (const QProgressBar *) widget; + const TQProgressBar * pb = (const TQProgressBar *) widget; const int unit_width = pixelMetric( PM_ProgressBarChunkWidth, pb ); int u = r.width() / unit_width; int p_v = pb->progress(); @@ -1759,17 +1759,17 @@ void MandrivaStyle::drawControl( ControlElement element, p_v /= u; t_s /= u; } - // QColor("#4965AE" ) powerpack + // TQColor("#4965AE" ) powerpack if ( pb->percentageVisible() && pb->totalSteps() ) { int nu = ( u * p_v + t_s/2 ) / t_s; int x = unit_width * nu; if (pb->indicatorFollowsStyle() || pb->centerIndicator()) { - if(cg.highlight() == QColor("#4965AE" )) - p->setPen( QColor("#FFFFFF")); + if(cg.highlight() == TQColor("#4965AE" )) + p->setPen( TQColor("#FFFFFF")); else - p->setPen( QColor( "#000000" ) ); + p->setPen( TQColor( "#000000" ) ); p->setClipRect( r.x(), r.y(), x, r.height() ); p->drawText( r, AlignCenter | SingleLine, pb->progressString() ); @@ -1778,16 +1778,16 @@ void MandrivaStyle::drawControl( ControlElement element, { p->setClipRect( r.x() + x, r.y(), r.width() - x, r.height() ); //second part of progress bar => black - p->setPen( /*cg.highlight()*/QColor( "#000000" ) ); + p->setPen( /*cg.highlight()*/TQColor( "#000000" ) ); p->drawText( r, AlignCenter | SingleLine, pb->progressString() ); } } else { - if(cg.highlight() == QColor("#4965AE" )) - p->setPen( QColor("#FFFFFF")); + if(cg.highlight() == TQColor("#4965AE" )) + p->setPen( TQColor("#FFFFFF")); else - p->setPen( QColor( "#000000" ) ); + p->setPen( TQColor( "#000000" ) ); p->drawText( r, AlignCenter | SingleLine, pb->progressString() ); } } @@ -1807,7 +1807,7 @@ void MandrivaStyle::drawControl( ControlElement element, } case CE_TabBarTab: { - const QTabBar* tb = static_cast< const QTabBar* >( widget ); + const TQTabBar* tb = static_cast< const TQTabBar* >( widget ); int x, y, xw, yh; int offset= 0; x= r.x(); @@ -1827,14 +1827,14 @@ void MandrivaStyle::drawControl( ControlElement element, else pos = Middle; - bool bottom = tb->shape() == QTabBar::RoundedBelow || - tb->shape() == QTabBar::TriangularBelow; + bool bottom = tb->shape() == TQTabBar::RoundedBelow || + tb->shape() == TQTabBar::TriangularBelow; if ( !bottom ) { if (flags & Style_Selected ) { - p->fillRect( r, tb->palette().active().brush( QColorGroup::Background )); + p->fillRect( r, tb->palette().active().brush( TQColorGroup::Background )); //blue-2 p->setPen( cdata->blueMdkColor[2]); p->drawLine( x+2, y, xw-2, y ); @@ -1847,14 +1847,14 @@ void MandrivaStyle::drawControl( ControlElement element, p->drawLine( xw,y+4,xw,yh); if ( pos==First ) p->drawLine( x,y+4,x,yh); - else if ( ( pos==Last || pos == Single ) && QApplication::reverseLayout() ) + else if ( ( pos==Last || pos == Single ) && TQApplication::reverseLayout() ) p->drawLine( xw, y+4, xw, yh ); } else { offset = 3; //grey1 - p->fillRect( QRect(x,y+offset,r.width()-1,yh), cdata->shades[1]); + p->fillRect( TQRect(x,y+offset,r.width()-1,yh), cdata->shades[1]); //grey5 p->setPen( cdata->shades[5]); p->drawLine( x+2,y+offset-1,xw-2,y+offset-1); @@ -1870,7 +1870,7 @@ void MandrivaStyle::drawControl( ControlElement element, { if (flags & Style_Selected ) { - p->fillRect( r, tb->palette().active().brush( QColorGroup::Background )); + p->fillRect( r, tb->palette().active().brush( TQColorGroup::Background )); p->setPen( cdata->blueMdkColor[2] ); p->drawLine( x, yh-3, xw, yh-3 ); @@ -1883,14 +1883,14 @@ void MandrivaStyle::drawControl( ControlElement element, p->drawLine( xw,y,xw,yh-4); if ( pos==First ) p->drawLine( x,y,x,yh-4); - else if ( ( pos==Last || pos == Single ) && QApplication::reverseLayout() ) + else if ( ( pos==Last || pos == Single ) && TQApplication::reverseLayout() ) p->drawLine( x, y, x, yh-4 ); //CHECK } else { offset = 3; //grey1 - p->fillRect( QRect(x,y,r.width()-1,yh-offset), cdata->shades[1]); + p->fillRect( TQRect(x,y,r.width()-1,yh-offset), cdata->shades[1]); //grey5 p->setPen( cdata->shades[5]); @@ -1908,19 +1908,19 @@ void MandrivaStyle::drawControl( ControlElement element, //CHECK case CE_MenuBarItem: { - QMenuBar *mb = (QMenuBar*)widget; - QMenuItem *mi = opt.menuItem(); - QRect pr = mb->rect(); + TQMenuBar *mb = (TQMenuBar*)widget; + TQMenuItem *mi = opt.menuItem(); + TQRect pr = mb->rect(); bool active = flags & Style_Active; bool focused = flags & Style_HasFocus; bool down = flags & Style_Down; - QColor textColor = cg.text(); + TQColor textColor = cg.text(); if ( active && focused && down ) { //top half - QRect half_rect = r; + TQRect half_rect = r; half_rect.setHeight(r.height()/2); renderGradient(p, half_rect, cdata->blueMdkColor[1], cdata->blueMdkColor[3], false); //bottom half @@ -1929,7 +1929,7 @@ void MandrivaStyle::drawControl( ControlElement element, renderGradient(p, half_rect, cdata->blueMdkColor[4], cdata->blueMdkColor[2], false); textColor = cg.highlightedText(); // create the fake rounded corners - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); p->setPen(cg.background()); p->drawPoint(r.topLeft()); p->drawPoint(r.topRight()); @@ -1952,15 +1952,15 @@ void MandrivaStyle::drawControl( ControlElement element, // ------------------------------------------------------------------- case CE_PopupMenuItem: { - const QPopupMenu *popupmenu = (const QPopupMenu *) widget; + const TQPopupMenu *popupmenu = (const TQPopupMenu *) widget; - QMenuItem *mi = opt.menuItem(); + TQMenuItem *mi = opt.menuItem(); if ( !mi ) { - // Don't leave blank holes if we set NoBackground for the QPopupMenu. + // Don't leave blank holes if we set NoBackground for the TQPopupMenu. // This only happens when the popupMenu spans more than one column. if (! (widget->erasePixmap() && !widget->erasePixmap()->isNull()) ) - p->fillRect(r, cg.brush(QColorGroup::Background) ); + p->fillRect(r, cg.brush(TQColorGroup::Background) ); break; } @@ -1970,12 +1970,12 @@ void MandrivaStyle::drawControl( ControlElement element, bool checkable = popupmenu->isCheckable(); bool active = flags & Style_Active; bool etchtext = styleHint( SH_EtchDisabledText ); - bool reverse = QApplication::reverseLayout(); + bool reverse = TQApplication::reverseLayout(); int x, y, w, h; r.rect( &x, &y, &w, &h ); if ( checkable ) - checkcol = QMAX( checkcol, 20 ); + checkcol = TQMAX( checkcol, 20 ); // Are we a menu item separator? if ( mi->isSeparator() ) @@ -1987,7 +1987,7 @@ void MandrivaStyle::drawControl( ControlElement element, if( active && (flags & Style_Enabled)) { //top half - QRect half_rect = r; + TQRect half_rect = r; half_rect.setHeight(r.height()/2); renderGradient(p, half_rect, cdata->blueMdkColor[1], cdata->blueMdkColor[3], false); //bottom half @@ -1995,7 +1995,7 @@ void MandrivaStyle::drawControl( ControlElement element, half_rect.moveBottom(r.bottom()); renderGradient(p, half_rect, cdata->blueMdkColor[4], cdata->blueMdkColor[2], false); // create the fake rounded corners - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); p->setPen(cg.background()); p->drawPoint(r.topLeft()); p->drawPoint(r.topRight()); @@ -2020,21 +2020,21 @@ void MandrivaStyle::drawControl( ControlElement element, #endif if( mi->iconSet() ) { - QIconSet::Mode mode; - QRect cr = visualRect( QRect(x, y, checkcol, h), r ); + TQIconSet::Mode mode; + TQRect cr = visualRect( TQRect(x, y, checkcol, h), r ); // Select the correct icon from the iconset if ( active ) - mode = enabled ? QIconSet::Active : QIconSet::Disabled; + mode = enabled ? TQIconSet::Active : TQIconSet::Disabled; else - mode = enabled ? QIconSet::Normal : QIconSet::Disabled; + mode = enabled ? TQIconSet::Normal : TQIconSet::Disabled; #if 0 //don't check menu // Do we have an icon and are checked at the same time? // Then draw a "pressed" background behind the icon if ( checkable && !active && mi->isChecked() ) { qDrawShadePanel( p, cr.x(), cr.y(), cr.width(), cr.height(), - cg, true, 1, &cg.brush(QColorGroup::Midlight) ); + cg, true, 1, &cg.brush(TQColorGroup::Midlight) ); } #endif //TEST IT !!!!!!!!!!!!!! @@ -2044,14 +2044,14 @@ void MandrivaStyle::drawControl( ControlElement element, // Draw the checkmark SFlags cflags = Style_Default; cflags |= active ? Style_Enabled : Style_On; - drawPrimitive( PE_CheckMark, p, QRect( cx + itemFrame, y + itemFrame, + drawPrimitive( PE_CheckMark, p, TQRect( cx + itemFrame, y + itemFrame, checkcol - itemFrame*2, h - itemFrame*2), cg, cflags ); } else { // Draw the icon - QPixmap pixmap = mi->iconSet()->pixmap( QIconSet::Small, mode ); - QRect pmr( 0, 0, pixmap.width(), pixmap.height() ); + TQPixmap pixmap = mi->iconSet()->pixmap( TQIconSet::Small, mode ); + TQRect pmr( 0, 0, pixmap.width(), pixmap.height() ); pmr.moveCenter( cr.center() ); p->drawPixmap( pmr.topLeft(), pixmap ); } @@ -2065,12 +2065,12 @@ void MandrivaStyle::drawControl( ControlElement element, // if it's active the "pressed" background is already drawn if ( ! active ) qDrawShadePanel( p, cx, y, checkcol, h, cg, true, 1, - &cg.brush(QColorGroup::Midlight) ); + &cg.brush(TQColorGroup::Midlight) ); #endif // Draw the checkmark SFlags cflags = Style_Default; cflags |= active ? Style_Enabled : Style_On; - drawPrimitive( PE_CheckMark, p, QRect( cx + itemFrame, y + itemFrame, + drawPrimitive( PE_CheckMark, p, TQRect( cx + itemFrame, y + itemFrame, checkcol - itemFrame*2, h - itemFrame*2), cg, cflags ); } @@ -2092,7 +2092,7 @@ void MandrivaStyle::drawControl( ControlElement element, // This color will be used instead of the above if the menu item // is active and disabled at the same time. (etched text) - QColor discol = cg.mid(); + TQColor discol = cg.mid(); // Does the menu item draw it's own label? if ( mi->custom() ) @@ -2100,7 +2100,7 @@ void MandrivaStyle::drawControl( ControlElement element, int m = itemVMargin; // Save the painter state in case the custom // paint method changes it in some way - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); // Draw etched text if we're inactive and the menu item is disabled @@ -2117,7 +2117,7 @@ void MandrivaStyle::drawControl( ControlElement element, else { // The menu item doesn't draw it's own label - QString s = mi->text(); + TQString s = mi->text(); // Does the menu item have a text label? if ( !s.isNull() ) @@ -2127,8 +2127,8 @@ void MandrivaStyle::drawControl( ControlElement element, int text_flags = AlignVCenter | ShowPrefix | DontClip | SingleLine; text_flags |= reverse ? AlignRight : AlignLeft; - //QColor draw = cg.text(); - QColor draw = (active && enabled) ? cg.highlightedText () : cg.text(); + //TQColor draw = cg.text(); + TQColor draw = (active && enabled) ? cg.highlightedText () : cg.text(); p->setPen(draw); @@ -2167,7 +2167,7 @@ void MandrivaStyle::drawControl( ControlElement element, // Check if it has a pixmap instead else if ( mi->pixmap() ) { - QPixmap *pixmap = mi->pixmap(); + TQPixmap *pixmap = mi->pixmap(); // Draw the pixmap if ( pixmap->depth() == 1 ) @@ -2187,7 +2187,7 @@ void MandrivaStyle::drawControl( ControlElement element, { PrimitiveElement arrow = reverse ? PE_ArrowLeft : PE_ArrowRight; int dim = pixelMetric(PM_MenuButtonIndicator)- itemFrame; - QRect vr = visualRect( QRect( x + w - arrowHMargin - itemFrame - dim, + TQRect vr = visualRect( TQRect( x + w - arrowHMargin - itemFrame - dim, y + h / 2 - dim / 2, dim, dim), r ); // Draw an arrow at the far end of the menu item @@ -2196,7 +2196,7 @@ void MandrivaStyle::drawControl( ControlElement element, if ( enabled ) discol = cg.buttonText(); - QColorGroup g2( cg.highlightedText ()/*white*/, cg.highlight(), /*white*/cg.highlightedText (), /*white*/cg.highlightedText (), + TQColorGroup g2( cg.highlightedText ()/*white*/, cg.highlight(), /*white*/cg.highlightedText (), /*white*/cg.highlightedText (), enabled ? cg.highlightedText () : discol, /*discol*/cg.highlightedText (), cg.highlightedText () ); drawPrimitive( arrow, p, vr, g2, Style_Enabled ); @@ -2209,7 +2209,7 @@ void MandrivaStyle::drawControl( ControlElement element, } case CE_PushButtonLabel: { - const QPushButton* button = (const QPushButton*)widget; + const TQPushButton* button = (const TQPushButton*)widget; bool active = button->isOn() || button->isDown(); int x, y, w, h; r.rect( &x, &y, &w, &h ); @@ -2226,7 +2226,7 @@ void MandrivaStyle::drawControl( ControlElement element, if ( button->isMenuButton() ) { int dx = pixelMetric( PM_MenuButtonIndicator, widget ); - drawPrimitive( PE_ArrowDown, p, QRect(x + w - dx - 2, y + 2, dx, h - 4), + drawPrimitive( PE_ArrowDown, p, TQRect(x + w - dx - 2, y + 2, dx, h - 4), cg, flags, opt ); w -= dx; } @@ -2234,15 +2234,15 @@ void MandrivaStyle::drawControl( ControlElement element, // Draw the icon if there is one if ( button->iconSet() && !button->iconSet()->isNull() ) { - QIconSet::Mode mode = QIconSet::Disabled; - QIconSet::State state = QIconSet::Off; + TQIconSet::Mode mode = TQIconSet::Disabled; + TQIconSet::State state = TQIconSet::Off; if (button->isEnabled()) - mode = button->hasFocus() ? QIconSet::Active : QIconSet::Normal; + mode = button->hasFocus() ? TQIconSet::Active : TQIconSet::Normal; if (button->isToggleButton() && button->isOn()) - state = QIconSet::On; + state = TQIconSet::On; - QPixmap pixmap = button->iconSet()->pixmap( QIconSet::Small, mode, state ); + TQPixmap pixmap = button->iconSet()->pixmap( TQIconSet::Small, mode, state ); // Center the iconset if there's no text or pixmap if (button->text().isEmpty() && !button->pixmap()) @@ -2259,10 +2259,10 @@ void MandrivaStyle::drawControl( ControlElement element, if ( active || button->isDefault() ) { // Draw "fake" bold text - this enables the font metrics to remain - // the same as computed in QPushButton::sizeHint(), but gives + // the same as computed in TQPushButton::sizeHint(), but gives // a reasonable bold effect. //change color of text - drawItem( p, QRect(x, y, w, h), AlignCenter | ShowPrefix, + drawItem( p, TQRect(x, y, w, h), AlignCenter | ShowPrefix, button->colorGroup(), button->isEnabled(), button->pixmap(), @@ -2272,7 +2272,7 @@ void MandrivaStyle::drawControl( ControlElement element, #if 0 // Normal Text for(i=0; i<2; i++) - drawItem( p, QRect(x+i, y, w, h), AlignCenter | ShowPrefix, + drawItem( p, TQRect(x+i, y, w, h), AlignCenter | ShowPrefix, button->colorGroup(), button->isEnabled(), i == 0 ? button->pixmap() : NULL, @@ -2282,7 +2282,7 @@ void MandrivaStyle::drawControl( ControlElement element, } else { - drawItem( p, QRect(x, y, w, h), AlignCenter | ShowPrefix, + drawItem( p, TQRect(x, y, w, h), AlignCenter | ShowPrefix, button->colorGroup(), button->isEnabled(), button->pixmap(), button->text(), -1, @@ -2291,13 +2291,13 @@ void MandrivaStyle::drawControl( ControlElement element, // Draw a focus rect if the button has focus if ( flags & Style_HasFocus ) drawPrimitive( PE_FocusRect, p, - QStyle::visualRect(subRect(SR_PushButtonFocusRect, widget), widget), + TQStyle::visualRect(subRect(SR_PushButtonFocusRect, widget), widget), cg, flags ); break; } case CE_PushButton: { - const QPushButton* btn = static_cast< const QPushButton* >( widget ); + const TQPushButton* btn = static_cast< const TQPushButton* >( widget ); if ( widget == hoverWidget ) flags |= Style_MouseOver; if (isFormWidget(btn)) @@ -2312,10 +2312,10 @@ void MandrivaStyle::drawControl( ControlElement element, } void MandrivaStyle::drawControlMask( ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QStyleOption& opt ) const + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQStyleOption& opt ) const { switch (element) { @@ -2330,14 +2330,14 @@ void MandrivaStyle::drawControlMask( ControlElement element, } } -void MandrivaStyle::drawComboboxArrow( QPainter *p, - const QWidget *widget, - const QRect &ar, - const QColorGroup &cg, +void MandrivaStyle::drawComboboxArrow( TQPainter *p, + const TQWidget *widget, + const TQRect &ar, + const TQColorGroup &cg, SFlags flags, SCFlags active)const { - const QComboBox * cb = (const QComboBox *) widget; + const TQComboBox * cb = (const TQComboBox *) widget; bool editableCombo = cb->editable(); // Are we enabled? if ( widget->isEnabled() ) @@ -2350,11 +2350,11 @@ void MandrivaStyle::drawComboboxArrow( QPainter *p, //Don't apply background color otherwise it //destroys gradient. //p->setBackgroundColor( cg.button() ); - QPointArray a; + TQPointArray a; if ( editableCombo ) - a.setPoints(QCOORDARRLEN(c_edit_arrow), c_edit_arrow); + a.setPoints(TQCOORDARRLEN(c_edit_arrow), c_edit_arrow); else - a.setPoints(QCOORDARRLEN(c_arrow), c_arrow); + a.setPoints(TQCOORDARRLEN(c_arrow), c_arrow); if ( flags & Style_Down ) p->translate( pixelMetric( PM_ButtonShiftHorizontal ), @@ -2362,7 +2362,7 @@ void MandrivaStyle::drawComboboxArrow( QPainter *p, if ( flags & Style_Enabled ) { - if ( QApplication::reverseLayout() ) + if ( TQApplication::reverseLayout() ) { a.translate( editableCombo ? ar.x() + ar.width() / 2 +1 : ar.x() + ar.width() / 2 +4 , editableCombo ? ar.y() + ar.height() / 2 + 1 : ar.y() + ar.height() / 2 ); @@ -2377,7 +2377,7 @@ void MandrivaStyle::drawComboboxArrow( QPainter *p, } else { - if ( QApplication::reverseLayout() ) + if ( TQApplication::reverseLayout() ) { a.translate( editableCombo ? ar.x() + ar.width() / 2 + 1 : ar.x() + ar.width() / 2 +4, editableCombo ? ar.y() + ar.height() / 2 + 1: ar.y() + ar.height() / 2 ); @@ -2396,22 +2396,22 @@ void MandrivaStyle::drawComboboxArrow( QPainter *p, } void MandrivaStyle::drawComplexControl( ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, SCFlags controls, SCFlags active, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { const MandrivaColorData *cdata = lookupData(cg); switch(control) { case CC_SpinWidget: { - const QSpinWidget* sw = static_cast< const QSpinWidget* >( widget ); - QRect br = visualRect( querySubControlMetrics( CC_SpinWidget, widget, SC_SpinWidgetButtonField ), widget ); + const TQSpinWidget* sw = static_cast< const TQSpinWidget* >( widget ); + TQRect br = visualRect( querySubControlMetrics( CC_SpinWidget, widget, SC_SpinWidgetButtonField ), widget ); //FIXME p->fillRect( r, widget->isEnabled() ? cg.base() : cg.background() ); @@ -2419,14 +2419,14 @@ void MandrivaStyle::drawComplexControl( ComplexControl control, { if ( controls & SC_SpinWidgetUp) { - QColorGroup ucg = sw->isUpEnabled() ? cg : sw->palette().disabled(); - drawPrimitive( PE_SpinWidgetUp,p, QRect(br.x()+1 , br.y()+1 , br.width()-2 , br.height() / 2 ), ucg, flags, opt); + TQColorGroup ucg = sw->isUpEnabled() ? cg : sw->palette().disabled(); + drawPrimitive( PE_SpinWidgetUp,p, TQRect(br.x()+1 , br.y()+1 , br.width()-2 , br.height() / 2 ), ucg, flags, opt); } if ( controls & SC_SpinWidgetDown) { - QColorGroup dcg = sw->isDownEnabled() ? cg : sw->palette().disabled(); + TQColorGroup dcg = sw->isDownEnabled() ? cg : sw->palette().disabled(); - drawPrimitive( PE_SpinWidgetDown,p, QRect( br.x()+1 , br.y() + br.height() / 2 , br.width()-2, br.height()/ 2 -1 ), dcg, flags, opt); + drawPrimitive( PE_SpinWidgetDown,p, TQRect( br.x()+1 , br.y() + br.height() / 2 , br.width()-2, br.height()/ 2 -1 ), dcg, flags, opt); } } if ( controls & SC_SpinWidgetFrame ) @@ -2436,9 +2436,9 @@ void MandrivaStyle::drawComplexControl( ComplexControl control, } case CC_ToolButton: { - const QToolButton *tb = (const QToolButton *) widget; + const TQToolButton *tb = (const TQToolButton *) widget; - QRect button, menuarea; + TQRect button, menuarea; button = querySubControlMetrics(control, widget, SC_ToolButton, opt); menuarea = querySubControlMetrics(control, widget, SC_ToolButtonMenu, opt); @@ -2466,7 +2466,7 @@ void MandrivaStyle::drawComplexControl( ComplexControl control, tb->parentWidget()->backgroundPixmap() && !tb->parentWidget()->backgroundPixmap()->isNull()) { - QPixmap pixmap = *(tb->parentWidget()->backgroundPixmap()); + TQPixmap pixmap = *(tb->parentWidget()->backgroundPixmap()); p->drawTiledPixmap( r, pixmap, tb->pos() ); } } @@ -2482,7 +2482,7 @@ void MandrivaStyle::drawComplexControl( ComplexControl control, if (tb->hasFocus() && !tb->focusProxy()) { - QRect fr = tb->rect(); + TQRect fr = tb->rect(); fr.addCoords(2, 2, -2, -2); drawPrimitive(PE_FocusRect, p, fr, cg); } @@ -2495,8 +2495,8 @@ void MandrivaStyle::drawComplexControl( ComplexControl control, case CC_ScrollBar: { - const QScrollBar *scrollbar = (const QScrollBar *) widget; - QRect addline, subline, addpage, subpage, slider, first, last; + const TQScrollBar *scrollbar = (const TQScrollBar *) widget; + TQRect addline, subline, addpage, subpage, slider, first, last; bool maxedOut = (scrollbar->minValue() == scrollbar->maxValue()); scrollmin = ( scrollbar->minValue() == scrollbar->value() ); scrollmax = (( scrollbar->maxValue() == scrollbar->value() )|| maxedOut); @@ -2514,7 +2514,7 @@ void MandrivaStyle::drawComplexControl( ComplexControl control, int flags = Style_Enabled; if (active == SC_ScrollBarSubLine) flags |= Style_Down; - if (scrollbar->orientation() == Qt::Horizontal) + if (scrollbar->orientation() == TQt::Horizontal) flags |= Style_Horizontal; if (hoverWidget == widget && hoverControl == HoverScrollBarSubLine) flags |= Style_MouseOver; @@ -2525,7 +2525,7 @@ void MandrivaStyle::drawComplexControl( ComplexControl control, int flags = Style_Enabled; if (active == SC_ScrollBarAddLine) flags |= Style_Down; - if (scrollbar->orientation() == Qt::Horizontal) + if (scrollbar->orientation() == TQt::Horizontal) flags |= Style_Horizontal; if (hoverWidget == widget && hoverControl == HoverScrollBarAddLine) flags |= Style_MouseOver; @@ -2535,33 +2535,33 @@ void MandrivaStyle::drawComplexControl( ComplexControl control, drawPrimitive(PE_ScrollBarSubPage, p, subpage, cg, Style_Enabled | ((active == SC_ScrollBarSubPage) ? Style_Down : Style_Default) | - ((scrollbar->orientation() == Qt::Horizontal) ? + ((scrollbar->orientation() == TQt::Horizontal) ? Style_Horizontal : 0)); if ((controls & SC_ScrollBarAddPage) && addpage.isValid()) drawPrimitive(PE_ScrollBarAddPage, p, addpage, cg, ((maxedOut) ? Style_Default : Style_Enabled) | ((active == SC_ScrollBarAddPage) ? Style_Down : Style_Default) | - ((scrollbar->orientation() == Qt::Horizontal) ? + ((scrollbar->orientation() == TQt::Horizontal) ? Style_Horizontal : 0)); if ((controls & SC_ScrollBarFirst) && first.isValid()) drawPrimitive(PE_ScrollBarFirst, p, first, cg, Style_Enabled | ((active == SC_ScrollBarFirst) ? Style_Down : Style_Default) | - ((scrollbar->orientation() == Qt::Horizontal) ? + ((scrollbar->orientation() == TQt::Horizontal) ? Style_Horizontal : 0)); if ((controls & SC_ScrollBarLast) && last.isValid()) drawPrimitive(PE_ScrollBarLast, p, last, cg, Style_Enabled | ((active == SC_ScrollBarLast) ? Style_Down : Style_Default) | - ((scrollbar->orientation() == Qt::Horizontal) ? + ((scrollbar->orientation() == TQt::Horizontal) ? Style_Horizontal : 0)); if ((controls & SC_ScrollBarSlider) && slider.isValid()) { int flags = Style_Enabled; if (active == SC_ScrollBarSlider) flags |= Style_Down; - if (scrollbar->orientation() == Qt::Horizontal) + if (scrollbar->orientation() == TQt::Horizontal) flags |= Style_Horizontal; if (hoverWidget == widget && hoverControl == HoverScrollBarSlider) flags |= Style_MouseOver; @@ -2570,7 +2570,7 @@ void MandrivaStyle::drawComplexControl( ComplexControl control, // ### perhaps this should not be able to accept focus if maxedOut? if (scrollbar->hasFocus()) { - QRect fr(slider.x() + 2, slider.y() + 2, + TQRect fr(slider.x() + 2, slider.y() + 2, slider.width() - 5, slider.height() - 5); drawPrimitive(PE_FocusRect, p, fr, cg, Style_Default); } @@ -2581,11 +2581,11 @@ void MandrivaStyle::drawComplexControl( ComplexControl control, // ------------------------------------------------------------------- case CC_ComboBox: { - const QComboBox * cb = (const QComboBox *) widget; + const TQComboBox * cb = (const TQComboBox *) widget; if (isFormWidget(cb)) formMode = true; // Draw box and arrow - bool reverse = QApplication::reverseLayout(); + bool reverse = TQApplication::reverseLayout(); if ( widget == hoverWidget ) flags |= Style_MouseOver; bool widgetEnabled = ( widget->isEnabled() ); @@ -2601,7 +2601,7 @@ void MandrivaStyle::drawComplexControl( ComplexControl control, if( (controls & SC_ComboBoxEditField )) { - QRect ar = QStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxEditField), widget ); + TQRect ar = TQStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxEditField), widget ); drawPrimitive( PE_PanelLineEdit, p, ar, cg ); } @@ -2611,14 +2611,14 @@ void MandrivaStyle::drawComplexControl( ComplexControl control, //} if( (controls & SC_ComboBoxArrow )) { - QRect ar = QStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxArrow), widget ); + TQRect ar = TQStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxArrow), widget ); bool mouseOver = (flags & Style_MouseOver) && (hoverControl == HoverComboBoxArrow); if ( sunken ) - renderGradient(p, QRect(ar.x()+1, ar.y()+1, ar.width()-1, ar.height()-2), cdata->shades[2], cdata->shades[0], false); + renderGradient(p, TQRect(ar.x()+1, ar.y()+1, ar.width()-1, ar.height()-2), cdata->shades[2], cdata->shades[0], false); else if ( mouseOver ) // FIXME: should highlight only when the mouse is over the arrow - renderGradient(p, QRect(ar.x()+1, ar.y()+1, ar.width()-1, ar.height()-2), Qt::white, cdata->shades[1], false); + renderGradient(p, TQRect(ar.x()+1, ar.y()+1, ar.width()-1, ar.height()-2), TQt::white, cdata->shades[1], false); else - renderGradient(p, QRect(ar.x()+1, ar.y()+1, ar.width()-1, ar.height()-2), cdata->shades[0],cdata->shades[2], false); + renderGradient(p, TQRect(ar.x()+1, ar.y()+1, ar.width()-1, ar.height()-2), cdata->shades[0],cdata->shades[2], false); if ( widgetEnabled ) { @@ -2654,10 +2654,10 @@ void MandrivaStyle::drawComplexControl( ComplexControl control, } else { - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); // Get the button bounding box - QRect ar = QStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxArrow), widget ); + TQRect ar = TQStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxArrow), widget ); drawButton( cdata,r,p,cg,flags | (sunken ? Style_Down : Style_Default)); //test reverse ! @@ -2688,10 +2688,10 @@ void MandrivaStyle::drawComplexControl( ComplexControl control, } } -QRect MandrivaStyle::querySubControlMetrics( ComplexControl control, - const QWidget* widget, +TQRect MandrivaStyle::querySubControlMetrics( ComplexControl control, + const TQWidget* widget, SubControl subcontrol, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { switch (control) { @@ -2700,7 +2700,7 @@ QRect MandrivaStyle::querySubControlMetrics( ComplexControl control, switch ( subcontrol ) { case SC_SpinWidgetButtonField: - return QRect( widget->width() -14 , 0, 14, widget->height() ); + return TQRect( widget->width() -14 , 0, 14, widget->height() ); default: return KStyle::querySubControlMetrics( control, widget, subcontrol, opt ); } @@ -2713,20 +2713,20 @@ QRect MandrivaStyle::querySubControlMetrics( ComplexControl control, switch ( subcontrol ) { case SC_ComboBoxFrame: - return QRect( 0, 0, widget->width(), widget->height() ); + return TQRect( 0, 0, widget->width(), widget->height() ); case SC_ComboBoxArrow: { - const QComboBox * cb = (const QComboBox *) widget; - return QRect( cb->editable() ? ( widget->width() - arrow - 11 ) : ( widget->width() - arrow- 7 ) , 0, arrow+10 , widget->height() ); + const TQComboBox * cb = (const TQComboBox *) widget; + return TQRect( cb->editable() ? ( widget->width() - arrow - 11 ) : ( widget->width() - arrow- 7 ) , 0, arrow+10 , widget->height() ); } case SC_ComboBoxEditField: { if ( widget->width() < 36 || widget->height() < 22 ) - return QRect( 5, 1, widget->width() - arrow-12, widget->height()); - else if ( static_cast< const QComboBox* >( widget )->editable() ) - return QRect( 1,1, widget->width() - arrow-12, widget->height() - 2 ); + return TQRect( 5, 1, widget->width() - arrow-12, widget->height()); + else if ( static_cast< const TQComboBox* >( widget )->editable() ) + return TQRect( 1,1, widget->width() - arrow-12, widget->height() - 2 ); else //TODO verify it - return QRect( 5, 1, widget->width() - arrow-12, widget->height() - 2); + return TQRect( 5, 1, widget->width() - arrow-12, widget->height() - 2); } default: return KStyle::querySubControlMetrics( control, widget, subcontrol, opt ); @@ -2735,9 +2735,9 @@ QRect MandrivaStyle::querySubControlMetrics( ComplexControl control, } case CC_Slider: { - const QSlider* sl = static_cast< const QSlider* >( widget ); + const TQSlider* sl = static_cast< const TQSlider* >( widget ); bool horizontal = sl->orientation() == Horizontal; - QSlider::TickSetting ticks = sl->tickmarks(); + TQSlider::TickSetting ticks = sl->tickmarks(); int pos = sl->sliderStart(); int handleSize = pixelMetric( PM_SliderThickness, widget ); int len = pixelMetric( PM_SliderLength, widget ); @@ -2746,19 +2746,19 @@ QRect MandrivaStyle::querySubControlMetrics( ComplexControl control, case SC_SliderHandle: if ( horizontal ) { - if ( ticks == QSlider::Both ) - return QRect( pos, ( sl->height() - handleSize ) / 2, len, handleSize ); - else if ( ticks == QSlider::Above ) - return QRect( pos, sl->height() - handleSize, len, handleSize ); - return QRect( pos, 0, len, handleSize ); + if ( ticks == TQSlider::Both ) + return TQRect( pos, ( sl->height() - handleSize ) / 2, len, handleSize ); + else if ( ticks == TQSlider::Above ) + return TQRect( pos, sl->height() - handleSize, len, handleSize ); + return TQRect( pos, 0, len, handleSize ); } else { - if ( ticks == QSlider::Both ) - return QRect( ( sl->width() - handleSize ) / 2, pos, handleSize, len ); - else if ( ticks == QSlider::Above ) - return QRect( sl->width() - handleSize, pos, handleSize, len ); - return QRect( 0, pos, handleSize, len ); + if ( ticks == TQSlider::Both ) + return TQRect( ( sl->width() - handleSize ) / 2, pos, handleSize, len ); + else if ( ticks == TQSlider::Above ) + return TQRect( sl->width() - handleSize, pos, handleSize, len ); + return TQRect( 0, pos, handleSize, len ); } default: break; @@ -2772,10 +2772,10 @@ QRect MandrivaStyle::querySubControlMetrics( ComplexControl control, } void MandrivaStyle::drawComplexControlMask( ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QStyleOption& opt ) const + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQStyleOption& opt ) const { //TODO verify //#if 0 @@ -2788,10 +2788,10 @@ void MandrivaStyle::drawComplexControlMask( ComplexControl control, { int x1, y1, x2, y2; r.coords( &x1, &y1, &x2, &y2 ); - QCOORD corners[] = { x1,y1, x2,y1, x1,y2, x2,y2 }; + TQCOORD corners[] = { x1,y1, x2,y1, x1,y2, x2,y2 }; p->fillRect( r, color1 ); p->setPen( color0 ); - p->drawPoints( QPointArray(4, corners) ); + p->drawPoints( TQPointArray(4, corners) ); break; } @@ -2803,7 +2803,7 @@ void MandrivaStyle::drawComplexControlMask( ComplexControl control, } -int MandrivaStyle::pixelMetric(PixelMetric m, const QWidget *widget) const +int MandrivaStyle::pixelMetric(PixelMetric m, const TQWidget *widget) const { switch(m) { @@ -2846,33 +2846,33 @@ int MandrivaStyle::pixelMetric(PixelMetric m, const QWidget *widget) const } -QSize MandrivaStyle::sizeFromContents( ContentsType contents, - const QWidget* widget, - const QSize &contentSize, - const QStyleOption& opt ) const +TQSize MandrivaStyle::sizeFromContents( ContentsType contents, + const TQWidget* widget, + const TQSize &contentSize, + const TQStyleOption& opt ) const { switch (contents) { //define progressbar default size case CT_ProgressBar: - return QSize( contentSize.width(), 20 ) ; + return TQSize( contentSize.width(), 20 ) ; case CT_SpinBox: - return QSize( contentSize.width(), contentSize.height()+1); + return TQSize( contentSize.width(), contentSize.height()+1); case CT_LineEdit: { - return contentSize + QSize (1, 1); //add +1 to rect + return contentSize + TQSize (1, 1); //add +1 to rect } case CT_SizeGrip: { - return QSize( 15, 15 ); + return TQSize( 15, 15 ); } case CT_ToolButton: { - bool onToolbar = widget->parentWidget() && widget->parentWidget()->inherits( "QToolBar" ); + bool onToolbar = widget->parentWidget() && widget->parentWidget()->inherits( "TQToolBar" ); if (!onToolbar) //Behaves like a button, so scale appropriately to the border { int w = contentSize.width(); int h = contentSize.height(); - return QSize( w + 12, h + 10 ); + return TQSize( w + 12, h + 10 ); } else { @@ -2881,21 +2881,21 @@ QSize MandrivaStyle::sizeFromContents( ContentsType contents, } case CT_ComboBox: { - const QComboBox* combobox = (const QComboBox*) widget; + const TQComboBox* combobox = (const TQComboBox*) widget; int h = contentSize.height(); if ( h < 22 ) h = 22; int arrow = 11; - return QSize( contentSize.width() + arrow + (combobox->editable() ? 26 : 22), + return TQSize( contentSize.width() + arrow + (combobox->editable() ? 26 : 22), combobox->editable() ? h : contentSize.height() + 10 ); } // PUSHBUTTON SIZE // ------------------------------------------------------------------ case CT_PushButton: { - const QPushButton* button = (const QPushButton*) widget; + const TQPushButton* button = (const TQPushButton*) widget; int w = contentSize.width(); int h = contentSize.height(); int bm = pixelMetric( PM_ButtonMargin, widget ); @@ -2914,16 +2914,16 @@ QSize MandrivaStyle::sizeFromContents( ContentsType contents, if ( h < 30 ) h = 30; - return QSize( w, h ); + return TQSize( w, h ); } case CT_PopupMenuItem: { if ( ! widget || opt.isDefault() ) return contentSize; - 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(), h = contentSize.height(); @@ -2947,19 +2947,19 @@ QSize MandrivaStyle::sizeFromContents( ContentsType contents, else { if ( mi->pixmap() ) - h = QMAX( h, mi->pixmap()->height() + 2*itemFrame ); + h = TQMAX( h, mi->pixmap()->height() + 2*itemFrame ); else { // Ensure that the minimum height for text-only menu items // is the same as the icon size used by KDE. - h = QMAX( h, 16 + 2*itemFrame ); - h = QMAX( h, popup->fontMetrics().height() + h = TQMAX( h, 16 + 2*itemFrame ); + h = TQMAX( h, popup->fontMetrics().height() + 2*itemVMargin + 2*itemFrame ); } if ( mi->iconSet() ) - h = QMAX( h, mi->iconSet()->pixmap( - QIconSet::Small, QIconSet::Normal).height() + + h = TQMAX( h, mi->iconSet()->pixmap( + TQIconSet::Small, TQIconSet::Normal).height() + 2 * itemFrame ); } @@ -2977,7 +2977,7 @@ QSize MandrivaStyle::sizeFromContents( ContentsType contents, w += rightBorder; - return QSize( w, h ); + return TQSize( w, h ); } default: @@ -2986,57 +2986,57 @@ QSize MandrivaStyle::sizeFromContents( ContentsType contents, } //Why ? why create virtual function ? -// Fix Qt's wacky image alignment -QPixmap MandrivaStyle::stylePixmap(StylePixmap stylepixmap, - const QWidget* widget, - const QStyleOption& opt) const +// Fix TQt's wacky image alignment +TQPixmap MandrivaStyle::stylePixmap(StylePixmap stylepixmap, + const TQWidget* widget, + const TQStyleOption& opt) const { return KStyle::stylePixmap(stylepixmap, widget, opt); } -bool MandrivaStyle::eventFilter( QObject *object, QEvent *event ) +bool MandrivaStyle::eventFilter( TQObject *object, TQEvent *event ) { if (KStyle::eventFilter( object, event )) return true; - QToolBar* toolbar; + TQToolBar* toolbar; //Hover highlight on buttons and combos - if ( object->inherits("QPushButton") - || object->inherits("QComboBox") - || object->inherits("QScrollBar") - || object->inherits("QHeader") - || object->inherits("QSlider") - || object->inherits("QCheckBox") - || object->inherits("QSplitterHandle")) + if ( object->inherits("TQPushButton") + || object->inherits("TQComboBox") + || object->inherits("TQScrollBar") + || object->inherits("TQHeader") + || object->inherits("TQSlider") + || object->inherits("TQCheckBox") + || object->inherits("TQSplitterHandle")) { - if ( (event->type() == QEvent::Enter) && static_cast<QWidget*>(object)->isEnabled()) + if ( (event->type() == TQEvent::Enter) && static_cast<TQWidget*>(object)->isEnabled()) { - QWidget* button = static_cast<QWidget*>(object); + TQWidget* button = static_cast<TQWidget*>(object); hoverWidget = button; button->repaint( false ); } - else if ( (event->type() == QEvent::Leave) && (object == hoverWidget) ) + else if ( (event->type() == TQEvent::Leave) && (object == hoverWidget) ) { - QWidget* button = static_cast<QWidget*>(object); + TQWidget* button = static_cast<TQWidget*>(object); hoverWidget = 0; hoverControl = HoverNone; button->repaint( false ); } - if ((object->inherits("QScrollBar") || object->inherits("QComboBox")) - && event->type() == QEvent::MouseMove) + if ((object->inherits("TQScrollBar") || object->inherits("TQComboBox")) + && event->type() == TQEvent::MouseMove) { - QWidget *button = static_cast<QWidget*>(object); - QMouseEvent *e = static_cast<QMouseEvent*>(event); + TQWidget *button = static_cast<TQWidget*>(object); + TQMouseEvent *e = static_cast<TQMouseEvent*>(event); // updateHoverControl will trigger a repainting if necessary updateHoverControl(e->pos()); } } - else if (object->inherits("QListBox")) + else if (object->inherits("TQListBox")) { - if ( event->type() == QEvent::Show || event->type() == QEvent::Hide) + if ( event->type() == TQEvent::Show || event->type() == TQEvent::Hide) { - QWidget *w = static_cast<QWidget*>(object); - if (w->parentWidget() && w->parentWidget()->inherits("QComboBox")) + TQWidget *w = static_cast<TQWidget*>(object); + if (w->parentWidget() && w->parentWidget()->inherits("TQComboBox")) w->parentWidget()->repaint(false); } } @@ -3045,29 +3045,29 @@ bool MandrivaStyle::eventFilter( QObject *object, QEvent *event ) // Draw a gradient background for custom widgets in the toolbar // that have specified a "kde toolbar widget" name. - if (event->type() == QEvent::Paint ) + if (event->type() == TQEvent::Paint ) { // Find the top-level toolbar of this widget, since it may be nested in other // widgets that are on the toolbar. - QWidget *widget = static_cast<QWidget*>(object); - QWidget *parent = static_cast<QWidget*>(object->parent()); + TQWidget *widget = static_cast<TQWidget*>(object); + TQWidget *parent = static_cast<TQWidget*>(object->parent()); int x_offset = widget->x(), y_offset = widget->y(); while (parent && parent->parent() && !qstrcmp( parent->name(), kdeToolbarWidget ) ) { x_offset += parent->x(); y_offset += parent->y(); - parent = static_cast<QWidget*>(parent->parent()); + parent = static_cast<TQWidget*>(parent->parent()); } - QRect r = widget->rect(); - QRect pr = parent->rect(); + TQRect r = widget->rect(); + TQRect pr = parent->rect(); bool horiz_grad = pr.width() < pr.height(); - // Check if the parent is a QToolbar, and use its orientation, else guess. - QToolBar* tb = dynamic_cast<QToolBar*>(parent); - if (tb) horiz_grad = tb->orientation() == Qt::Vertical; + // Check if the parent is a TQToolbar, and use its orientation, else guess. + TQToolBar* tb = dynamic_cast<TQToolBar*>(parent); + if (tb) horiz_grad = tb->orientation() == TQt::Vertical; - QPainter p( widget ); + TQPainter p( widget ); renderGradient(&p, r, parent->colorGroup().background(),parent->colorGroup().background(), horiz_grad);/*, x_offset, y_offset, pr.width(), pr.height());*/ //FIXME: check this code later @@ -3075,22 +3075,22 @@ bool MandrivaStyle::eventFilter( QObject *object, QEvent *event ) } } else if ( object->parent() && - (toolbar = dynamic_cast<QToolBar*>(object->parent())) ) + (toolbar = dynamic_cast<TQToolBar*>(object->parent())) ) { // We need to override the paint event to draw a - // gradient on a QToolBarExtensionWidget. - if ( event->type() == QEvent::Paint ) + // gradient on a TQToolBarExtensionWidget. + if ( event->type() == TQEvent::Paint ) { - QWidget *widget = static_cast<QWidget*>(object); - QRect wr = widget->rect(), tr = toolbar->rect(); - QPainter p( widget ); + TQWidget *widget = static_cast<TQWidget*>(object); + TQRect wr = widget->rect(), tr = toolbar->rect(); + TQPainter p( widget ); renderGradient(&p, wr, toolbar->colorGroup().background(),toolbar->colorGroup().background(), - toolbar->orientation() == Qt::Vertical);/*, + toolbar->orientation() == TQt::Vertical);/*, wr.x(), wr.y(), tr.width() - 2, tr.height() - 2);*/ //FIXME: check this code later p.setPen( toolbar->colorGroup().dark() ); - if ( toolbar->orientation() == Qt::Horizontal ) + if ( toolbar->orientation() == TQt::Horizontal ) p.drawLine( wr.width()-1, 0, wr.width()-1, wr.height()-1 ); else p.drawLine( 0, wr.height()-1, wr.width()-1, wr.height()-1 ); @@ -3102,10 +3102,10 @@ bool MandrivaStyle::eventFilter( QObject *object, QEvent *event ) //*************** // renderGradient from PlastikStyle -void MandrivaStyle::renderGradient(QPainter *painter, - const QRect &rect, - const QColor &c1, - const QColor &c2, +void MandrivaStyle::renderGradient(TQPainter *painter, + const TQRect &rect, + const TQColor &c1, + const TQColor &c2, bool horizontal) const { if((rect.width() <= 0)||(rect.height() <= 0)) @@ -3137,9 +3137,9 @@ void MandrivaStyle::renderGradient(QPainter *painter, } // there wasn't anything matching in the cache, create the pixmap now... - QPixmap *result = new QPixmap(horizontal ? rect.width() : 10, + TQPixmap *result = new TQPixmap(horizontal ? rect.width() : 10, horizontal ? 10 : rect.height()); - QPainter p(result); + TQPainter p(result); int r_w = result->rect().width(); int r_h = result->rect().height(); @@ -3173,7 +3173,7 @@ void MandrivaStyle::renderGradient(QPainter *painter, gl += gdelta; bl += bdelta; - p.setPen(QColor(rl>>16, gl>>16, bl>>16)); + p.setPen(TQColor(rl>>16, gl>>16, bl>>16)); p.drawLine(r_x, r_y+y, r_x2, r_y+y); } } @@ -3185,7 +3185,7 @@ void MandrivaStyle::renderGradient(QPainter *painter, gl += gdelta; bl += bdelta; - p.setPen(QColor(rl>>16, gl>>16, bl>>16)); + p.setPen(TQColor(rl>>16, gl>>16, bl>>16)); p.drawLine(r_x+x, r_y, r_x+x, r_y2); } } @@ -3204,9 +3204,9 @@ void MandrivaStyle::renderGradient(QPainter *painter, delete result; } -void MandrivaStyle::drawButton( const MandrivaColorData *cdata, const QRect & r, QPainter *p,const QColorGroup &cg, SFlags flags)const +void MandrivaStyle::drawButton( const MandrivaColorData *cdata, const TQRect & r, TQPainter *p,const TQColorGroup &cg, SFlags flags)const { - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); bool down = flags & Style_Down; bool on = flags & Style_On; bool enabled = flags & Style_Enabled; @@ -3318,36 +3318,36 @@ void MandrivaStyle::drawButton( const MandrivaColorData *cdata, const QRect & r, if ( on ) - renderGradient(p, QRect(x+3, y+3, xw-5, yh-5), + renderGradient(p, TQRect(x+3, y+3, xw-5, yh-5), cdata->buttonColor[0] ,mouseOver ? cdata->buttonColor[1] : cdata->buttonColor[2], false); else if ( down ||sunken ) - renderGradient(p, QRect(x+3, y+3, xw-4, yh-4), + renderGradient(p, TQRect(x+3, y+3, xw-4, yh-4), cdata->buttonColor[2] ,cdata->buttonColor[1], false); else - renderGradient(p, QRect(x+3, y+3, xw-5, yh-5), + renderGradient(p, TQRect(x+3, y+3, xw-5, yh-5), cdata->buttonColor[0] ,mouseOver ? cdata->buttonColor[1] :cdata->buttonColor[2], false); p->setPen( oldPen ); // restore pen } -QRect MandrivaStyle::subRect(SubRect r, const QWidget *widget) const +TQRect MandrivaStyle::subRect(SubRect r, const TQWidget *widget) const { switch ( r ) { case SR_ProgressBarContents: { - QRect wrect( widget->rect()); - return QRect( wrect.x() , wrect.y() , wrect.width(), wrect.height()); + TQRect wrect( widget->rect()); + return TQRect( wrect.x() , wrect.y() , wrect.width(), wrect.height()); } case SR_PushButtonFocusRect: { - const QPushButton* button = (const QPushButton*) widget; - QRect wrect(widget->rect()); + const TQPushButton* button = (const TQPushButton*) widget; + TQRect wrect(widget->rect()); if (button->isDefault() || button->autoDefault()) - return QRect(wrect.x() + 6, wrect.y() + 4, wrect.width() - 12, wrect.height() - 8); + return TQRect(wrect.x() + 6, wrect.y() + 4, wrect.width() - 12, wrect.height() - 8); else - return QRect(wrect.x() + 4 , wrect.y() + 5, wrect.width() - 9, wrect.height() - 8); + return TQRect(wrect.x() + 4 , wrect.y() + 5, wrect.width() - 9, wrect.height() - 8); break; } @@ -3361,7 +3361,7 @@ QRect MandrivaStyle::subRect(SubRect r, const QWidget *widget) const } //define handle point -void MandrivaStyle::drawHandlePoint ( const MandrivaColorData *cdata,QPainter *p, int x, int y)const +void MandrivaStyle::drawHandlePoint ( const MandrivaColorData *cdata,TQPainter *p, int x, int y)const { //blue-4 p->save(); @@ -3388,33 +3388,33 @@ void MandrivaStyle::drawHandlePoint ( const MandrivaColorData *cdata,QPainter *p p->restore(); } -bool MandrivaStyle::excludeColor(const QColor &col, bool active) const +bool MandrivaStyle::excludeColor(const TQColor &col, bool active) const { if ( active ) { - if ( col == QColor( "#F7B610" ) - || col == QColor( "#8EC7FF" ) - || col == QColor( "#C7D3DF" ) ) + if ( col == TQColor( "#F7B610" ) + || col == TQColor( "#8EC7FF" ) + || col == TQColor( "#C7D3DF" ) ) return true; } return false; } -bool MandrivaStyle::isFormWidget(const QWidget* widget) const +bool MandrivaStyle::isFormWidget(const TQWidget* widget) const { //Form widgets are in the KHTMLView, but that has 2 further inner levels - //of widgets - QClipperWidget, and outside of that, QViewportWidget - QWidget* potentialClipPort = widget->parentWidget(); + //of widgets - TQClipperWidget, and outside of that, TQViewportWidget + TQWidget* potentialClipPort = widget->parentWidget(); if ( !potentialClipPort || potentialClipPort->isTopLevel() ) return false; - QWidget* potentialViewPort = potentialClipPort->parentWidget(); + TQWidget* potentialViewPort = potentialClipPort->parentWidget(); if (!potentialViewPort || potentialViewPort->isTopLevel() || qstrcmp(potentialViewPort->name(), "qt_viewport") ) return false; - QWidget* potentialKHTML = potentialViewPort->parentWidget(); + TQWidget* potentialKHTML = potentialViewPort->parentWidget(); if (!potentialKHTML || potentialKHTML->isTopLevel() || qstrcmp(potentialKHTML->className(), "KHTMLView") ) return false; |