summaryrefslogtreecommitdiffstats
path: root/style/lipstik.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-30 06:56:11 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-30 06:56:11 +0000
commit1d95710a43237e5925b847fb08989e3c27807a08 (patch)
tree839748931856b38f9a32cbd6bb0a5365fa7260ff /style/lipstik.cpp
parentb5b99fa4d2ec0876151f3bf4b317ce40992eebf7 (diff)
downloadtde-style-lipstik-1d95710a43237e5925b847fb08989e3c27807a08.tar.gz
tde-style-lipstik-1d95710a43237e5925b847fb08989e3c27807a08.zip
TQt4 port the Lipstik style
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kde-style-lipstik@1234205 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'style/lipstik.cpp')
-rw-r--r--style/lipstik.cpp1222
1 files changed, 611 insertions, 611 deletions
diff --git a/style/lipstik.cpp b/style/lipstik.cpp
index 047b942..a06202a 100644
--- a/style/lipstik.cpp
+++ b/style/lipstik.cpp
@@ -21,7 +21,7 @@
(c) 2002,2003 Maksim Orlovich <[email protected]>
based on the KDE3 HighColor Style
Copyright (C) 2001-2002 Karol Szwed <[email protected]>
- (C) 2001-2002 Fredrik H�glund <[email protected]>
+ (C) 2001-2002 Fredrik H�glund <[email protected]>
Drawing routines adapted from the KDE2 HCStyle,
Copyright (C) 2000 Daniel M. Duley <[email protected]>
(C) 2000 Dirk Mueller <[email protected]>
@@ -46,34 +46,34 @@
Boston, MA 02110-1301, USA.
*/
-#include <qimage.h>
-#include <qstylefactory.h>
-#include <qpointarray.h>
-#include <qpainter.h>
-#include <qtabbar.h>
-#include <qprogressbar.h>
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qcleanuphandler.h>
-#include <qheader.h>
-#include <qlineedit.h>
-#include <qlistbox.h>
-#include <qscrollbar.h>
-#include <qstyleplugin.h>
-#include <qpushbutton.h>
-#include <qtabwidget.h>
-#include <qtimer.h>
-#include <qtoolbutton.h>
-#include <qtoolbar.h>
-#include <qmenubar.h>
-#include <qpopupmenu.h>
-#include <qdrawutil.h>
-#include <qapplication.h>
-#include <qvariant.h>
-#include <qradiobutton.h>
-#include <qregion.h>
-#include <qslider.h>
-#include <qsettings.h>
+#include <tqimage.h>
+#include <tqstylefactory.h>
+#include <tqpointarray.h>
+#include <tqpainter.h>
+#include <tqtabbar.h>
+#include <tqprogressbar.h>
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
+#include <tqcleanuphandler.h>
+#include <tqheader.h>
+#include <tqlineedit.h>
+#include <tqlistbox.h>
+#include <tqscrollbar.h>
+#include <tqstyleplugin.h>
+#include <tqpushbutton.h>
+#include <tqtabwidget.h>
+#include <tqtimer.h>
+#include <tqtoolbutton.h>
+#include <tqtoolbar.h>
+#include <tqmenubar.h>
+#include <tqpopupmenu.h>
+#include <tqdrawutil.h>
+#include <tqapplication.h>
+#include <tqvariant.h>
+#include <tqradiobutton.h>
+#include <tqregion.h>
+#include <tqslider.h>
+#include <tqsettings.h>
#include <kpixmap.h>
#include "lipstik.h"
@@ -82,7 +82,7 @@
// some bitmaps for the radio button so it's easier to handle the circle stuff...
// 13x13
-static const unsigned char radiobutton_mask_bits[] = {
+static const unsigned char radiobutton_tqmask_bits[] = {
0xf8, 0x03, 0xfc, 0x07, 0xfe, 0x0f, 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f,
0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f, 0xfe, 0x0f, 0xfc, 0x07,
0xf8, 0x03};
@@ -140,24 +140,24 @@ static const int arrowHMargin = 6;
static const int rightBorder = 12;
// -- Style Plugin Interface -------------------------
-class LipstikStylePlugin : public QStylePlugin
+class LipstikStylePlugin : public TQStylePlugin
{
public:
LipstikStylePlugin() {}
~LipstikStylePlugin() {}
- QStringList keys() const {
- return QStringList() << "Lipstik";
+ TQStringList keys() const {
+ return TQStringList() << "Lipstik";
}
- QStyle* create( const QString& key ) {
+ TQStyle* create( const TQString& key ) {
if (key.lower() == "lipstik")
return new LipstikStyle;
return 0;
}
};
-Q_EXPORT_PLUGIN( LipstikStylePlugin )
+TQ_EXPORT_PLUGIN( LipstikStylePlugin )
// -- end --
LipstikStyle::LipstikStyle() : KStyle( AllowMenuTransparency, ThreeButtonScrollBar),
@@ -174,9 +174,9 @@ LipstikStyle::LipstikStyle() : KStyle( AllowMenuTransparency, ThreeButtonScrollB
horizontalLine = 0;
verticalLine = 0;
- QSettings settings;
- _contrast = settings.readNumEntry("/Qt/KDE/contrast", 6);
- _defaultMenuStripeColor.setNamedColor( settings.readEntry("/Qt/KWinPalette/activeBackground", "black") );
+ TQSettings settings;
+ _contrast = settings.readNumEntry("/TQt/KDE/contrast", 6);
+ _defaultMenuStripeColor.setNamedColor( settings.readEntry("/TQt/KWinPalette/activeBackground", "black") );
settings.beginGroup("/lipstikstyle/Settings");
_animateProgressBar = settings.readBoolEntry("/animateProgressBar", false);
@@ -231,29 +231,29 @@ LipstikStyle::LipstikStyle() : KStyle( AllowMenuTransparency, ThreeButtonScrollB
this->setScrollBarType(KStyle::NextStyleScrollBar);
// setup pixmap cache...
- pixmapCache = new QIntCache<CacheEntry>(150000, 499);
+ pixmapCache = new TQIntCache<CacheEntry>(150000, 499);
pixmapCache->setAutoDelete(true);
if ( _animateProgressBar )
{
- animationTimer = new QTimer( this );
- connect( animationTimer, SIGNAL(timeout()), this, SLOT(updateProgressPos()) );
+ animationTimer = new TQTimer( this );
+ connect( animationTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateProgressPos()) );
}
}
void LipstikStyle::updateProgressPos()
{
- QProgressBar* pb;
+ TQProgressBar* pb;
//Update the registered progressbars.
- QMap<QWidget*, int>::iterator iter;
+ TQMap<TQWidget*, int>::iterator iter;
bool visible = false;
for (iter = progAnimWidgets.begin(); iter != progAnimWidgets.end(); ++iter)
{
- if ( !::qt_cast<QProgressBar*>(iter.key()) )
+ if ( !::tqqt_cast<TQProgressBar*>(iter.key()) )
continue;
- pb = dynamic_cast<QProgressBar*>(iter.key());
+ pb = dynamic_cast<TQProgressBar*>(iter.key());
if ( iter.key() -> isEnabled() &&
pb -> progress() != pb->totalSteps() )
{
@@ -278,7 +278,7 @@ LipstikStyle::~LipstikStyle()
delete verticalLine;
}
-void LipstikStyle::polish(QApplication* app)
+void LipstikStyle::polish(TQApplication* app)
{
if (!qstrcmp(app->argv()[0], "kicker"))
kickerMode = true;
@@ -286,42 +286,42 @@ void LipstikStyle::polish(QApplication* app)
kornMode = true;
}
-void LipstikStyle::polish(QWidget* widget)
+void LipstikStyle::polish(TQWidget* widget)
{
if( !strcmp(widget->name(), "__khtml") ) { // is it a khtml widget...?
khtmlWidgets[widget] = true;
- connect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(khtmlWidgetDestroyed(QObject*)));
+ connect(widget, TQT_SIGNAL(destroyed(TQObject*)), this, TQT_SLOT(khtmlWidgetDestroyed(TQObject*)));
}
// use qt_cast where possible to check if the widget inheits one of the classes. might improve
- // performance compared to QObject::inherits()
- if ( ::qt_cast<QPushButton*>(widget) || ::qt_cast<QComboBox*>(widget) ||
- ::qt_cast<QSpinWidget*>(widget) || ::qt_cast<QSlider*>(widget) ||
- ::qt_cast<QCheckBox*>(widget) || ::qt_cast<QRadioButton*>(widget) ||
- ::qt_cast<QToolButton*>(widget)
+ // performance compared to TQObject::inherits()
+ if ( ::tqqt_cast<TQPushButton*>(widget) || ::tqqt_cast<TQComboBox*>(widget) ||
+ ::tqqt_cast<TQSpinWidget*>(widget) || ::tqqt_cast<TQSlider*>(widget) ||
+ ::tqqt_cast<TQCheckBox*>(widget) || ::tqqt_cast<TQRadioButton*>(widget) ||
+ ::tqqt_cast<TQToolButton*>(widget)
)
{
widget->installEventFilter(this);
- } else if (::qt_cast<QTabBar*>(widget)) {
+ } else if (::tqqt_cast<TQTabBar*>(widget)) {
widget->setMouseTracking(true);
widget->installEventFilter(this);
- } else if (::qt_cast<QPopupMenu*>(widget)) {
+ } else if (::tqqt_cast<TQPopupMenu*>(widget)) {
widget->setBackgroundMode( NoBackground );
- } else if(::qt_cast<QScrollBar*>(widget)) {
+ } else if(::tqqt_cast<TQScrollBar*>(widget)) {
widget->setMouseTracking(true);
widget->installEventFilter(this);
- } else if (widget->inherits("QSplitterHandle") || widget->inherits("QDockWindowHandle") ) {
+ } else if (widget->inherits(TQSPLITTERHANDLE_OBJECT_NAME_STRING) || widget->inherits(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) ) {
widget->installEventFilter(this);
- } else if (::qt_cast<QLineEdit*>(widget)) {
+ } else if (::tqqt_cast<TQLineEdit*>(widget)) {
widget->installEventFilter(this);
} else if ( !qstrcmp(widget->name(), "kde toolbar widget") ) {
widget->installEventFilter(this);
}
- if( _animateProgressBar && ::qt_cast<QProgressBar*>(widget) ) {
+ if( _animateProgressBar && ::tqqt_cast<TQProgressBar*>(widget) ) {
widget->installEventFilter(this);
progAnimWidgets[widget] = 0;
- connect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(progressBarDestroyed(QObject*)));
+ connect(widget, TQT_SIGNAL(destroyed(TQObject*)), this, TQT_SLOT(progressBarDestroyed(TQObject*)));
if (!animationTimer->isActive())
animationTimer->start( 50, false );
} else if( !qstrcmp(widget->className(), "KonqFrameStatusBar") ) {
@@ -330,43 +330,43 @@ void LipstikStyle::polish(QWidget* widget)
// applications cg.midlight() so we override it to standard background.
// Thanks Comix! (because this was ugly from day one!)
// NOTE: Check if we can set it earlier (before painting), cause
- // on slow machines we can see the repainting of the bar (from white to background...)
- QPalette kPalette = QApplication::palette();
- kPalette.setColor( QColorGroup::Midlight,kPalette.active().background() );
- QApplication::setPalette( kPalette );
+ // on slow machines we can see the tqrepainting of the bar (from white to background...)
+ TQPalette kPalette = TQApplication::palette();
+ kPalette.setColor( TQColorGroup::Midlight,kPalette.active().background() );
+ TQApplication::setPalette( kPalette );
}
KStyle::polish(widget);
}
-void LipstikStyle::unPolish(QWidget* widget)
+void LipstikStyle::unPolish(TQWidget* widget)
{
if( !strcmp(widget->name(), "__khtml") ) { // is it a khtml widget...?
khtmlWidgets.remove(widget);
}
// use qt_cast to check if the widget inheits one of the classes.
- if ( ::qt_cast<QPushButton*>(widget) || ::qt_cast<QComboBox*>(widget) ||
- ::qt_cast<QSpinWidget*>(widget) || ::qt_cast<QSlider*>(widget) ||
- ::qt_cast<QCheckBox*>(widget) || ::qt_cast<QRadioButton*>(widget) ||
- ::qt_cast<QToolButton*>(widget) || ::qt_cast<QLineEdit*>(widget) ||
- widget->inherits("QSplitterHandle") )
+ if ( ::tqqt_cast<TQPushButton*>(widget) || ::tqqt_cast<TQComboBox*>(widget) ||
+ ::tqqt_cast<TQSpinWidget*>(widget) || ::tqqt_cast<TQSlider*>(widget) ||
+ ::tqqt_cast<TQCheckBox*>(widget) || ::tqqt_cast<TQRadioButton*>(widget) ||
+ ::tqqt_cast<TQToolButton*>(widget) || ::tqqt_cast<TQLineEdit*>(widget) ||
+ widget->inherits(TQSPLITTERHANDLE_OBJECT_NAME_STRING) )
{
widget->removeEventFilter(this);
}
- else if (::qt_cast<QTabBar*>(widget)) {
+ else if (::tqqt_cast<TQTabBar*>(widget)) {
widget->setMouseTracking(false);
widget->removeEventFilter(this);
- } else if (::qt_cast<QScrollBar*>(widget)) {
+ } else if (::tqqt_cast<TQScrollBar*>(widget)) {
widget->setMouseTracking(false);
widget->removeEventFilter(this);
- } else if (::qt_cast<QPopupMenu*>(widget)) {
+ } else if (::tqqt_cast<TQPopupMenu*>(widget)) {
widget->setBackgroundMode( PaletteBackground );
} else if ( !qstrcmp(widget->name(), "kde toolbar widget") ) {
widget->removeEventFilter(this);
}
- if ( ::qt_cast<QProgressBar*>(widget) ) {
+ if ( ::tqqt_cast<TQProgressBar*>(widget) ) {
progAnimWidgets.remove(widget);
} else if( widget->inherits("KonqFrameStatusBar") ) {
widget->removeEventFilter(this);
@@ -375,20 +375,20 @@ void LipstikStyle::unPolish(QWidget* widget)
KStyle::unPolish(widget);
}
-void LipstikStyle::khtmlWidgetDestroyed(QObject* obj)
+void LipstikStyle::khtmlWidgetDestroyed(TQObject* obj)
{
- khtmlWidgets.remove(static_cast<QWidget*>(obj));
+ khtmlWidgets.remove(TQT_TQWIDGET(obj));
}
-void LipstikStyle::progressBarDestroyed(QObject* obj)
+void LipstikStyle::progressBarDestroyed(TQObject* obj)
{
- progAnimWidgets.remove(static_cast<QWidget*>(obj));
+ progAnimWidgets.remove(TQT_TQWIDGET(obj));
}
-void LipstikStyle::renderContour(QPainter *p,
- const QRect &r,
- const QColor &backgroundColor,
- const QColor &contour,
+void LipstikStyle::renderContour(TQPainter *p,
+ const TQRect &r,
+ const TQColor &backgroundColor,
+ const TQColor &contour,
const uint flags) const
{
if((r.width() <= 0)||(r.height() <= 0))
@@ -401,7 +401,7 @@ void LipstikStyle::renderContour(QPainter *p,
const bool disabled = flags&Is_Disabled;
const bool alphaBlend = flags&Draw_AlphaBlend;
- QColor contourColor;
+ TQColor contourColor;
if (disabled) {
contourColor = backgroundColor.dark(150);
} else {
@@ -486,49 +486,49 @@ void LipstikStyle::renderContour(QPainter *p,
if(drawLeft && drawTop) {
switch(flags&Round_UpperLeft) {
case false:
- renderPixel(p,QPoint(r.left(),r.top()),alphaAA,contourColor,backgroundColor,alphaBlend);
+ renderPixel(p,TQPoint(r.left(),r.top()),alphaAA,contourColor,backgroundColor,alphaBlend);
break;
default:
- renderPixel(p,QPoint(r.left()+1,r.top()),alphaAA,contourColor,backgroundColor,alphaBlend);
- renderPixel(p,QPoint(r.left(),r.top()+1),alphaAA,contourColor,backgroundColor,alphaBlend);
+ renderPixel(p,TQPoint(r.left()+1,r.top()),alphaAA,contourColor,backgroundColor,alphaBlend);
+ renderPixel(p,TQPoint(r.left(),r.top()+1),alphaAA,contourColor,backgroundColor,alphaBlend);
}
}
if(drawLeft && drawBottom) {
switch(flags&Round_BottomLeft) {
case false:
- renderPixel(p,QPoint(r.left(),r.bottom()),alphaAA,contourColor,backgroundColor,alphaBlend);
+ renderPixel(p,TQPoint(r.left(),r.bottom()),alphaAA,contourColor,backgroundColor,alphaBlend);
break;
default:
- renderPixel(p,QPoint(r.left()+1,r.bottom()),alphaAA,contourColor,backgroundColor,alphaBlend);
- renderPixel(p,QPoint(r.left(),r.bottom()-1),alphaAA,contourColor,backgroundColor,alphaBlend);
+ renderPixel(p,TQPoint(r.left()+1,r.bottom()),alphaAA,contourColor,backgroundColor,alphaBlend);
+ renderPixel(p,TQPoint(r.left(),r.bottom()-1),alphaAA,contourColor,backgroundColor,alphaBlend);
}
}
if(drawRight && drawTop) {
switch(flags&Round_UpperRight) {
case false:
- renderPixel(p,QPoint(r.right(),r.top()),alphaAA,contourColor,backgroundColor,alphaBlend);
+ renderPixel(p,TQPoint(r.right(),r.top()),alphaAA,contourColor,backgroundColor,alphaBlend);
break;
default:
- renderPixel(p,QPoint(r.right()-1,r.top()),alphaAA,contourColor,backgroundColor,alphaBlend);
- renderPixel(p,QPoint(r.right(),r.top()+1),alphaAA,contourColor,backgroundColor,alphaBlend);
+ renderPixel(p,TQPoint(r.right()-1,r.top()),alphaAA,contourColor,backgroundColor,alphaBlend);
+ renderPixel(p,TQPoint(r.right(),r.top()+1),alphaAA,contourColor,backgroundColor,alphaBlend);
}
}
if(drawRight && drawBottom) {
switch(flags&Round_BottomRight) {
case false:
- renderPixel(p,QPoint(r.right(),r.bottom()),alphaAA,contourColor,backgroundColor,alphaBlend);
+ renderPixel(p,TQPoint(r.right(),r.bottom()),alphaAA,contourColor,backgroundColor,alphaBlend);
break;
default:
- renderPixel(p,QPoint(r.right()-1,r.bottom()),alphaAA,contourColor,backgroundColor,alphaBlend);
- renderPixel(p,QPoint(r.right(),r.bottom()-1),alphaAA,contourColor,backgroundColor,alphaBlend);
+ renderPixel(p,TQPoint(r.right()-1,r.bottom()),alphaAA,contourColor,backgroundColor,alphaBlend);
+ renderPixel(p,TQPoint(r.right(),r.bottom()-1),alphaAA,contourColor,backgroundColor,alphaBlend);
}
}
}
-void LipstikStyle::renderMask(QPainter *p,
- const QRect &r,
- const QColor &color,
+void LipstikStyle::renderMask(TQPainter *p,
+ const TQRect &r,
+ const TQColor &color,
const uint flags) const
{
if((r.width() <= 0)||(r.height() <= 0))
@@ -540,7 +540,7 @@ void LipstikStyle::renderMask(QPainter *p,
const bool roundBottomRight = flags&Round_BottomRight;
- p->fillRect (QRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2) , color);
+ p->fillRect (TQRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2) , color);
p->setPen(color);
// sides
@@ -554,11 +554,11 @@ void LipstikStyle::renderMask(QPainter *p,
r.right(), roundBottomLeft?r.bottom()-1:r.bottom() );
}
-void LipstikStyle::renderSurface(QPainter *p,
- const QRect &r,
- const QColor &backgroundColor,
- const QColor &buttonColor,
- const QColor &highlightColor,
+void LipstikStyle::renderSurface(TQPainter *p,
+ const TQRect &r,
+ const TQColor &backgroundColor,
+ const TQColor &buttonColor,
+ const TQColor &highlightColor,
int intensity,
const uint flags) const
{
@@ -591,7 +591,7 @@ void LipstikStyle::renderSurface(QPainter *p,
highlightBottom = (flags&Highlight_Bottom);
}
- QColor baseColor = alphaBlendColors(backgroundColor, disabled?backgroundColor:buttonColor, 10);
+ TQColor baseColor = alphaBlendColors(backgroundColor, disabled?backgroundColor:buttonColor, 10);
if (disabled) {
intensity = 2;
} else if (highlight) {
@@ -604,13 +604,13 @@ void LipstikStyle::renderSurface(QPainter *p,
}
// some often needed colors...
// 1 more intensive than 2 and 3.
- const QColor colorTop1 = alphaBlendColors(baseColor,
+ const TQColor colorTop1 = alphaBlendColors(baseColor,
sunken?baseColor.dark(100+intensity*2):baseColor.light(100+intensity*2), 80);
- const QColor colorTop2 = alphaBlendColors(baseColor,
+ const TQColor colorTop2 = alphaBlendColors(baseColor,
sunken?baseColor.dark(100+intensity):baseColor.light(100+intensity), 80);
- const QColor colorBottom1 = alphaBlendColors(baseColor,
+ const TQColor colorBottom1 = alphaBlendColors(baseColor,
sunken?baseColor.light(100+intensity*2):baseColor.dark(100+intensity*2), 80);
- const QColor colorBottom2 = alphaBlendColors(baseColor,
+ const TQColor colorBottom2 = alphaBlendColors(baseColor,
sunken?baseColor.light(100+intensity):baseColor.dark(100+intensity), 80);
// sides
@@ -619,7 +619,7 @@ void LipstikStyle::renderSurface(QPainter *p,
int height = r.height();
if (roundUpperLeft || !drawTop) height--;
if (roundBottomLeft || !drawBottom) height--;
- renderGradient(p, QRect(r.left(), (roundUpperLeft&&drawTop)?r.top()+1:r.top(), 1, height),
+ renderGradient(p, TQRect(r.left(), (roundUpperLeft&&drawTop)?r.top()+1:r.top(), 1, height),
colorTop1, baseColor);
} else {
p->setPen(colorTop1 );
@@ -634,7 +634,7 @@ void LipstikStyle::renderSurface(QPainter *p,
// and we don't whant to draw the Top, we have a unpainted area
if (roundUpperRight || !drawTop) height--;
if (roundBottomRight || !drawBottom) height--;
- renderGradient(p, QRect(r.right(), (roundUpperRight&&drawTop)?r.top()+1:r.top(), 1, height),
+ renderGradient(p, TQRect(r.right(), (roundUpperRight&&drawTop)?r.top()+1:r.top(), 1, height),
baseColor, colorBottom1);
} else {
p->setPen(colorBottom1 );
@@ -651,7 +651,7 @@ void LipstikStyle::renderSurface(QPainter *p,
int width = r.width();
if (roundUpperLeft || !drawLeft) width--;
if (roundUpperRight || !drawRight) width--;
- renderGradient(p, QRect((roundUpperLeft&&drawLeft)?r.left()+1:r.left(), r.top(), width, 1),
+ renderGradient(p, TQRect((roundUpperLeft&&drawLeft)?r.left()+1:r.left(), r.top(), width, 1),
colorTop1, colorTop2);
}
}
@@ -664,7 +664,7 @@ void LipstikStyle::renderSurface(QPainter *p,
int width = r.width();
if (roundBottomLeft || !drawLeft) width--;
if (roundBottomRight || !drawRight) width--;
- renderGradient(p, QRect((roundBottomLeft&&drawLeft)?r.left()+1:r.left(), r.bottom(), width, 1),
+ renderGradient(p, TQRect((roundBottomLeft&&drawLeft)?r.left()+1:r.left(), r.bottom(), width, 1),
colorBottom2, colorBottom1);
}
}
@@ -676,7 +676,7 @@ void LipstikStyle::renderSurface(QPainter *p,
if (drawRight) width--;
if (drawTop) height--;
if (drawBottom) height--;
- renderGradient(p, QRect(drawLeft?r.left()+1:r.left(), drawTop?r.top()+1:r.top(), width, height),
+ renderGradient(p, TQRect(drawLeft?r.left()+1:r.left(), drawTop?r.top()+1:r.top(), width, height),
colorTop2, colorBottom2, horizontal);
@@ -715,23 +715,23 @@ void LipstikStyle::renderSurface(QPainter *p,
}
}
-void LipstikStyle::renderPixel(QPainter *p,
- const QPoint &pos,
+void LipstikStyle::renderPixel(TQPainter *p,
+ const TQPoint &pos,
const int alpha,
- const QColor &color,
- const QColor &background,
+ const TQColor &color,
+ const TQColor &background,
bool fullAlphaBlend) const
{
if(fullAlphaBlend)
// full alpha blend: paint into an image with alpha buffer and convert to a pixmap ...
{
- QRgb rgb = color.rgb();
+ TQRgb rgb = color.rgb();
// generate a quite unique key -- use the unused width field to store the alpha value.
CacheEntry search(cAlphaDot, alpha, 0, rgb);
int key = search.key();
CacheEntry *cacheEntry;
- if( (cacheEntry = pixmapCache->find(key)) ) {
+ if( (cacheEntry = pixmapCache->tqfind(key)) ) {
if( search == *cacheEntry ) { // match! we can draw now...
if(cacheEntry->pixmap)
p->drawPixmap(pos, *(cacheEntry->pixmap) );
@@ -742,10 +742,10 @@ void LipstikStyle::renderPixel(QPainter *p,
}
- QImage aImg(1,1,32); // 1x1
+ TQImage aImg(1,1,32); // 1x1
aImg.setAlphaBuffer(true);
- aImg.setPixel(0,0,qRgba(qRed(rgb),qGreen(rgb),qBlue(rgb),alpha));
- QPixmap *result = new QPixmap(aImg);
+ aImg.setPixel(0,0,tqRgba(tqRed(rgb),tqGreen(rgb),tqBlue(rgb),alpha));
+ TQPixmap *result = new TQPixmap(aImg);
p->drawPixmap(pos, *result);
@@ -758,24 +758,24 @@ void LipstikStyle::renderPixel(QPainter *p,
} else
// don't use an alpha buffer: calculate the resulting color from the alpha value, the fg- and the bg-color.
{
- QRgb rgb_a = color.rgb();
- QRgb rgb_b = background.rgb();
+ TQRgb rgb_a = color.rgb();
+ TQRgb rgb_b = background.rgb();
int a = alpha;
if(a>255) a = 255;
if(a<0) a = 0;
int a_inv = 255 - a;
- QColor res = QColor( qRgb(qRed(rgb_b)*a_inv/255 + qRed(rgb_a)*a/255,
- qGreen(rgb_b)*a_inv/255 + qGreen(rgb_a)*a/255,
- qBlue(rgb_b)*a_inv/255 + qBlue(rgb_a)*a/255) );
+ TQColor res = TQColor( tqRgb(tqRed(rgb_b)*a_inv/255 + tqRed(rgb_a)*a/255,
+ tqGreen(rgb_b)*a_inv/255 + tqGreen(rgb_a)*a/255,
+ tqBlue(rgb_b)*a_inv/255 + tqBlue(rgb_a)*a/255) );
p->setPen(res);
p->drawPoint(pos);
}
}
-void LipstikStyle::renderButton(QPainter *p,
- const QRect &r,
- const QColorGroup &g,
+void LipstikStyle::renderButton(TQPainter *p,
+ const TQRect &r,
+ const TQColorGroup &g,
bool sunken,
bool mouseOver,
bool horizontal,
@@ -785,7 +785,7 @@ void LipstikStyle::renderButton(QPainter *p,
// small fix for the kicker buttons...
if(kickerMode) enabled = true;
- const QPen oldPen( p->pen() );
+ const TQPen oldPen( p->pen() );
uint contourFlags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom;
if(!enabled) contourFlags|=Is_Disabled;
@@ -813,12 +813,12 @@ void LipstikStyle::renderButton(QPainter *p,
renderContour(p, r, g.background(), getColor(g,ButtonContour),
contourFlags);
- renderSurface(p, QRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2),
+ renderSurface(p, TQRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2),
g.background(), g.button(), getColor(g,MouseOverHighlight), _contrast, surfaceFlags);
} else {
renderContour(p, r, g.background(), g.button().dark(105+_contrast*3),
contourFlags);
- renderSurface(p, QRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2),
+ renderSurface(p, TQRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2),
g.background(), g.button(), getColor(g,MouseOverHighlight), _contrast/2, surfaceFlags);
flatMode = false;
@@ -827,14 +827,14 @@ void LipstikStyle::renderButton(QPainter *p,
p->setPen(oldPen);
}
-void LipstikStyle::renderDot(QPainter *p,
- const QPoint &point,
- const QColor &baseColor,
+void LipstikStyle::renderDot(TQPainter *p,
+ const TQPoint &point,
+ const TQColor &baseColor,
const bool thick,
const bool sunken) const
{
- const QColor topColor = alphaBlendColors(baseColor, sunken?baseColor.dark(130):baseColor.light(150), 70);
- const QColor bottomColor = alphaBlendColors(baseColor, sunken?baseColor.light(150):baseColor.dark(130), 70);
+ const TQColor topColor = alphaBlendColors(baseColor, sunken?baseColor.dark(130):baseColor.light(150), 70);
+ const TQColor bottomColor = alphaBlendColors(baseColor, sunken?baseColor.light(150):baseColor.dark(130), 70);
p->setPen(topColor );
p->drawLine(point.x(), point.y(), point.x()+1, point.y());
p->drawPoint(point.x(), point.y()+1);
@@ -847,10 +847,10 @@ void LipstikStyle::renderDot(QPainter *p,
}
}
-void LipstikStyle::renderGradient(QPainter *painter,
- const QRect &rect,
- const QColor &c1,
- const QColor &c2,
+void LipstikStyle::renderGradient(TQPainter *painter,
+ const TQRect &rect,
+ const TQColor &c1,
+ const TQColor &c2,
bool horizontal) const
{
if((rect.width() <= 0)||(rect.height() <= 0))
@@ -864,7 +864,7 @@ void LipstikStyle::renderGradient(QPainter *painter,
int key = search.key();
CacheEntry *cacheEntry;
- if( (cacheEntry = pixmapCache->find(key)) ) {
+ if( (cacheEntry = pixmapCache->tqfind(key)) ) {
if( search == *cacheEntry ) { // match! we can draw now...
if(cacheEntry->pixmap) {
painter->drawTiledPixmap(rect, *(cacheEntry->pixmap) );
@@ -878,14 +878,14 @@ void LipstikStyle::renderGradient(QPainter *painter,
}
// there wasn't anything matching in the cache, create the pixmap now...
- QPixmap *result = new QPixmap(horizontal ? 10 : rect.width(),
+ TQPixmap *result = new TQPixmap(horizontal ? 10 : rect.width(),
horizontal ? rect.height() : 10);
- QPainter p(result);
+ TQPainter p(result);
int r_w = result->rect().width();
int r_h = result->rect().height();
int r_x, r_y, r_x2, r_y2;
- result->rect().coords(&r_x, &r_y, &r_x2, &r_y2);
+ TQT_TQRECT_OBJECT(result->rect()).coords(&r_x, &r_y, &r_x2, &r_y2);
int rDiff, gDiff, bDiff;
int rc, gc, bc;
@@ -918,7 +918,7 @@ void LipstikStyle::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);
}
} else {
@@ -927,7 +927,7 @@ void LipstikStyle::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);
}
}
@@ -946,9 +946,9 @@ void LipstikStyle::renderGradient(QPainter *painter,
delete result;
}
-void LipstikStyle::renderPanel(QPainter *p,
- const QRect &r,
- const QColorGroup &g,
+void LipstikStyle::renderPanel(TQPainter *p,
+ const TQRect &r,
+ const TQColorGroup &g,
const bool pseudo3d,
const bool sunken) const
{
@@ -957,21 +957,21 @@ void LipstikStyle::renderPanel(QPainter *p,
r.coords(&x, &y, &x2, &y2);
if (kickerMode &&
- p->device() && p->device()->devType() == QInternal::Widget &&
- QCString(static_cast<QWidget*>(p->device())->className()) == "FittsLawFrame") {
+ p->device() && p->device()->devType() == TQInternal::Widget &&
+ TQCString(TQT_TQWIDGET(static_cast<QWidget*>(p->device()))->className()) == "FittsLawFrame") {
// Stolen wholesale from Keramik. I don't like it, but oh well.
if (sunken) {
- const QCOORD corners[] = { x2, y, x2, y2, x, y2, x, y };
+ const TQCOORD corners[] = { x2, y, x2, y2, x, y2, x, y };
p->setPen(g.mid());
- p->drawConvexPolygon(QPointArray(4, corners));
+ p->drawConvexPolygon(TQPointArray(4, corners));
p->setPen(g.mid());
- p->drawPolyline(QPointArray(4, corners), 0, 3);
+ p->tqdrawPolyline(TQPointArray(4, corners), 0, 3);
} else {
- const QCOORD corners[] = { x, y2, x, y, x2, y, x2, y2 };
+ const TQCOORD corners[] = { x, y2, x, y, x2, y, x2, y2 };
p->setPen(g.background().dark());
- p->drawPolygon(QPointArray(4, corners));
+ p->drawPolygon(TQPointArray(4, corners));
p->setPen(g.background().light());
- p->drawPolyline(QPointArray(4, corners), 0, 3);
+ p->tqdrawPolyline(TQPointArray(4, corners), 0, 3);
}
} else {
renderContour(p, r, g.background(), getColor(g, PanelContour) );
@@ -996,15 +996,15 @@ void LipstikStyle::renderPanel(QPainter *p,
}
}
-void LipstikStyle::renderMenuBlendPixmap( KPixmap &pix, const QColorGroup &cg,
- const QPopupMenu* /* popup */ ) const
+void LipstikStyle::renderMenuBlendPixmap( KPixmap &pix, const TQColorGroup &cg,
+ const TQPopupMenu* /* popup */ ) const
{
pix.fill( cg.background().light(105) );
}
-void LipstikStyle::renderTab(QPainter *p,
- const QRect &r,
- const QColorGroup &g,
+void LipstikStyle::renderTab(TQPainter *p,
+ const TQRect &r,
+ const TQColorGroup &g,
bool mouseOver,
const bool selected,
const bool bottom,
@@ -1012,7 +1012,7 @@ void LipstikStyle::renderTab(QPainter *p,
const bool triangular,
const bool cornerWidget) const
{
- const bool reverseLayout = QApplication::reverseLayout();
+ const bool reverseLayout = TQApplication::reverseLayout();
const bool isFirst = (pos == First) || (pos == Single);
const bool isLast = (pos == Last);
@@ -1022,27 +1022,27 @@ void LipstikStyle::renderTab(QPainter *p,
// is selected
// the top part of the tab which is nearly the same for all positions
- QRect Rc; // contour
+ TQRect Rc; // contour
if (!bottom) {
if (isFirst && !cornerWidget && !reverseLayout) {
- Rc = QRect(r.x(), r.y(), r.width()-1, r.height()-3);
+ Rc = TQRect(r.x(), r.y(), r.width()-1, r.height()-3);
} else if (isFirst && !cornerWidget && reverseLayout) {
- Rc = QRect(r.x()+1, r.y(), r.width()-1, r.height()-3);
+ Rc = TQRect(r.x()+1, r.y(), r.width()-1, r.height()-3);
} else {
- Rc = QRect(r.x()+1, r.y(), r.width()-2, r.height()-3);
+ Rc = TQRect(r.x()+1, r.y(), r.width()-2, r.height()-3);
}
} else {
if (isFirst && !cornerWidget && !reverseLayout) {
- Rc = QRect(r.x(), r.y()+3, r.width()-1, r.height()-3);
+ Rc = TQRect(r.x(), r.y()+3, r.width()-1, r.height()-3);
} else if (isFirst && !cornerWidget && reverseLayout) {
- Rc = QRect(r.x()+1, r.y()+3, r.width()-1, r.height()-3);
+ Rc = TQRect(r.x()+1, r.y()+3, r.width()-1, r.height()-3);
} else {
- Rc = QRect(r.x()+1, r.y()+3, r.width()-2, r.height()-3);
+ Rc = TQRect(r.x()+1, r.y()+3, r.width()-2, r.height()-3);
}
}
- const QRect Rs(Rc.x()+1, bottom?Rc.y():Rc.y()+1, Rc.width()-2, Rc.height()-1); // the resulting surface
+ const TQRect Rs(Rc.x()+1, bottom?Rc.y():Rc.y()+1, Rc.width()-2, Rc.height()-1); // the resulting surface
// the area where the fake border shoudl appear
- const QRect Rb(r.x(), bottom?r.top():Rc.bottom()+1, r.width(), r.height()-Rc.height() );
+ const TQRect Rb(r.x(), bottom?r.top():Rc.bottom()+1, r.width(), r.height()-Rc.height() );
uint contourFlags = Draw_Left|Draw_Right;
if(!bottom) {
@@ -1058,9 +1058,9 @@ void LipstikStyle::renderTab(QPainter *p,
if(!bottom) {
p->setPen(getColor(g,PanelLight) );
p->drawLine(Rs.x()+1, Rs.y(), Rs.right()-1, Rs.y() );
- renderGradient(p, QRect(Rs.x(), Rs.y()+1, 1, Rs.height()-1),
+ renderGradient(p, TQRect(Rs.x(), Rs.y()+1, 1, Rs.height()-1),
getColor(g,PanelLight), getColor(g,PanelLight2));
- renderGradient(p, QRect(Rs.right(), Rs.y()+1, 1, Rs.height()-1),
+ renderGradient(p, TQRect(Rs.right(), Rs.y()+1, 1, Rs.height()-1),
getColor(g,PanelDark), getColor(g,PanelDark2));
if(_drawTabHighlight) {
if(_customTabHighlightColor) {
@@ -1078,9 +1078,9 @@ void LipstikStyle::renderTab(QPainter *p,
} else {
p->setPen(alphaBlendColors(g.background(), g.background().dark(160), 100) );
p->drawLine(Rs.x()+1, Rs.bottom(), Rs.right()-1, Rs.bottom() );
- renderGradient(p, QRect(Rs.x(), Rs.y(), 1, Rs.height()-1),
+ renderGradient(p, TQRect(Rs.x(), Rs.y(), 1, Rs.height()-1),
getColor(g,PanelLight), getColor(g,PanelLight2));
- renderGradient(p, QRect(Rs.right(), Rs.y(), 1, Rs.height()-1),
+ renderGradient(p, TQRect(Rs.right(), Rs.y(), 1, Rs.height()-1),
getColor(g,PanelDark), getColor(g,PanelDark2));
if(_drawTabHighlight) {
p->setPen( alphaBlendColors(g.highlight(), getColor(g,PanelLight), 180) );
@@ -1097,13 +1097,13 @@ void LipstikStyle::renderTab(QPainter *p,
p->setPen(alphaBlendColors(g.background(), getColor(g, ButtonContour), 50) );
if( (!isFirst&&!reverseLayout) || (!isLast&&reverseLayout) ) {
p->drawPoint(r.left(), bottom?(triangular?r.bottom()-2:r.bottom()-3):(triangular?r.top()+2:r.top()+3) );
- renderSurface(p, QRect(r.left(), bottom?r.top()+3:(triangular?r.top()+3:r.top()+4), 1, (triangular?r.height()-6:r.height()-7) ),
+ renderSurface(p, TQRect(r.left(), bottom?r.top()+3:(triangular?r.top()+3:r.top()+4), 1, (triangular?r.height()-6:r.height()-7) ),
g.background(), g.button(), getColor(g,MouseOverHighlight), _contrast,
Draw_Top|Draw_Bottom|Is_Horizontal);
}
if( (!isLast&&!reverseLayout) || (!isFirst&&reverseLayout) ) {
p->drawPoint(r.right(), bottom?(triangular?r.bottom()-2:r.bottom()-3):(triangular?r.top()+2:r.top()+3) );
- renderSurface(p, QRect(r.right(), bottom?r.top()+3:(triangular?r.top()+3:r.top()+4), 1, (triangular?r.height()-6:r.height()-7) ),
+ renderSurface(p, TQRect(r.right(), bottom?r.top()+3:(triangular?r.top()+3:r.top()+4), 1, (triangular?r.height()-6:r.height()-7) ),
g.background(), g.button(), getColor(g,MouseOverHighlight), _contrast,
Draw_Top|Draw_Bottom|Is_Horizontal);
}
@@ -1161,20 +1161,20 @@ void LipstikStyle::renderTab(QPainter *p,
// inactive tabs
// the top part of the tab which is nearly the same for all positions
- QRect Rc; // contour
+ TQRect Rc; // contour
if (isFirst&&reverseLayout ) {
- Rc = QRect(r.x()+1, (bottom?r.y()+2:(triangular?r.y()+2:r.y()+3)), r.width()-2, (triangular?r.height()-4:r.height()-5) );
+ Rc = TQRect(r.x()+1, (bottom?r.y()+2:(triangular?r.y()+2:r.y()+3)), r.width()-2, (triangular?r.height()-4:r.height()-5) );
} else {
- Rc = QRect(r.x()+1, (bottom?r.y()+2:(triangular?r.y()+2:r.y()+3)), r.width()-1, (triangular?r.height()-4:r.height()-5) );
+ Rc = TQRect(r.x()+1, (bottom?r.y()+2:(triangular?r.y()+2:r.y()+3)), r.width()-1, (triangular?r.height()-4:r.height()-5) );
}
- QRect Rs; // the resulting surface
+ TQRect Rs; // the resulting surface
if ( (isFirst&&!reverseLayout) || (isLast&&reverseLayout) ) {
- Rs = QRect(Rc.x()+1, bottom?Rc.y():Rc.y()+1, Rc.width()-2, Rc.height()-1);
+ Rs = TQRect(Rc.x()+1, bottom?Rc.y():Rc.y()+1, Rc.width()-2, Rc.height()-1);
} else {
- Rs = QRect(Rc.x(), bottom?Rc.y():Rc.y()+1, Rc.width()-1, Rc.height()-1);
+ Rs = TQRect(Rc.x(), bottom?Rc.y():Rc.y()+1, Rc.width()-1, Rc.height()-1);
}
// the area where the fake border shoudl appear
- const QRect Rb(r.x(), bottom?r.y():Rc.bottom()+1, r.width(), 2 );
+ const TQRect Rb(r.x(), bottom?r.y():Rc.bottom()+1, r.width(), 2 );
uint contourFlags;
if(!bottom) {
@@ -1236,7 +1236,7 @@ void LipstikStyle::renderTab(QPainter *p,
// fake the panel border edge for tabs which are aligned left-most
// (i.e. only if there is no widget in the corner of the tabwidget!)
if(isFirst&&!reverseLayout&&!cornerWidget)
- // normal layout
+ // normal tqlayout
{
if (!bottom) {
p->setPen(alphaBlendColors(g.background(), getColor(g,PanelContour), 50) );
@@ -1258,7 +1258,7 @@ void LipstikStyle::renderTab(QPainter *p,
p->drawPoint(Rb.x()+1, Rb.bottom() );
}
} else if(isFirst&&reverseLayout&&!cornerWidget)
- // reverse layout
+ // reverse tqlayout
{
if (!bottom) {
p->setPen(alphaBlendColors(g.background(), getColor(g,PanelContour), 50) );
@@ -1284,12 +1284,12 @@ void LipstikStyle::renderTab(QPainter *p,
}
void LipstikStyle::drawKStylePrimitive(KStylePrimitive kpe,
- 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
{
// some "global" vars...
const bool enabled = (flags & Style_Enabled);
@@ -1298,17 +1298,17 @@ void LipstikStyle::drawKStylePrimitive(KStylePrimitive kpe,
// ------
switch( kpe ) {
case KPE_SliderGroove: {
- const QSlider* slider = (const QSlider*)widget;
- bool horizontal = slider->orientation() == Horizontal;
+ const TQSlider* slider = (const TQSlider*)widget;
+ bool horizontal = slider->orientation() ==Qt::Horizontal;
if (horizontal) {
int center = r.y()+r.height()/2;
- renderContour(p, QRect(r.left(), center-2, r.width(), 4),
+ renderContour(p, TQRect(r.left(), center-2, r.width(), 4),
cg.background(), cg.background().dark(enabled?150:130),
Draw_Left|Draw_Right|Draw_Top|Draw_Bottom);
} else {
int center = r.x()+r.width()/2;
- renderContour(p, QRect(center-2, r.top(), 4, r.height()),
+ renderContour(p, TQRect(center-2, r.top(), 4, r.height()),
cg.background(), cg.background().dark(enabled?150:130),
Draw_Left|Draw_Right|Draw_Top|Draw_Bottom);
}
@@ -1316,12 +1316,12 @@ void LipstikStyle::drawKStylePrimitive(KStylePrimitive kpe,
}
case KPE_SliderHandle: {
- const QSlider* slider = (const QSlider*)widget;
- bool horizontal = slider->orientation() == Horizontal;
+ const TQSlider* slider = (const TQSlider*)widget;
+ bool horizontal = slider->orientation() ==Qt::Horizontal;
const bool pressed = (flags&Style_Active);
const WidgetState s = enabled?(pressed?IsPressed:IsEnabled):IsDisabled;
- const QColor contour = getColor(cg,DragButtonContour,s),
+ const TQColor contour = getColor(cg,DragButtonContour,s),
surface = getColor(cg,DragButtonSurface,s);
int xcenter = (r.left()+r.right()) / 2;
@@ -1329,13 +1329,13 @@ void LipstikStyle::drawKStylePrimitive(KStylePrimitive kpe,
if (_sliderStyle == "sliderLipstikStyle") {
if (horizontal) {
- renderContour(p, QRect(xcenter-9, ycenter-7, 20, 15), cg.background(), contour,
+ renderContour(p, TQRect(xcenter-9, ycenter-7, 20, 15), cg.background(), contour,
Draw_Left|Draw_Right|Draw_Top|Round_UpperLeft|Round_UpperRight|
Draw_Bottom|Round_BottomLeft|Round_BottomRight);
- QRegion mask(xcenter-8, ycenter-6, 18, 13);
+ TQRegion tqmask(xcenter-8, ycenter-6, 18, 13);
- p->setClipRegion(mask);
+ p->setClipRegion(tqmask);
uint surfaceFlags = Draw_Left|Draw_Right|Draw_Top|Round_UpperLeft|Round_UpperRight|
Is_Horizontal;
@@ -1346,22 +1346,22 @@ void LipstikStyle::drawKStylePrimitive(KStylePrimitive kpe,
surfaceFlags |= Highlight_Right|Highlight_Left;
}
- renderSurface(p, QRect(xcenter-8, ycenter-6, 18, 13),
+ renderSurface(p, TQRect(xcenter-8, ycenter-6, 18, 13),
cg.background(), surface, getColor(cg,MouseOverHighlight),
_contrast+3, surfaceFlags);
- renderDot(p, QPoint(xcenter-2, ycenter), surface, true, true );
- renderDot(p, QPoint(xcenter+2, ycenter), surface, true, true );
+ renderDot(p, TQPoint(xcenter-2, ycenter), surface, true, true );
+ renderDot(p, TQPoint(xcenter+2, ycenter), surface, true, true );
p->setClipping(false);
} else {
- renderContour(p, QRect(xcenter-7, ycenter-9, 16, 20), cg.background(), contour,
+ renderContour(p, TQRect(xcenter-7, ycenter-9, 16, 20), cg.background(), contour,
Draw_Left|Draw_Right|Draw_Top|Round_UpperLeft|Round_UpperRight|
Draw_Bottom|Round_BottomLeft|Round_BottomRight);
- QRegion mask(xcenter-6, ycenter-8, 13, 18);
+ TQRegion tqmask(xcenter-6, ycenter-8, 13, 18);
- p->setClipRegion(mask);
+ p->setClipRegion(tqmask);
uint surfaceFlags = Draw_Left|Draw_Top|Draw_Bottom|Round_UpperLeft|Round_BottomLeft|
Round_UpperRight|Is_Horizontal;
@@ -1371,18 +1371,18 @@ void LipstikStyle::drawKStylePrimitive(KStylePrimitive kpe,
else if(hoverWidget == widget)
surfaceFlags |= Highlight_Top|Highlight_Bottom;
- renderSurface(p, QRect(xcenter-6, ycenter-8, 13, 18),
+ renderSurface(p, TQRect(xcenter-6, ycenter-8, 13, 18),
cg.background(), surface, getColor(cg,MouseOverHighlight),
_contrast+3, surfaceFlags);
- renderDot(p, QPoint(xcenter, ycenter-2), surface, true, true );
- renderDot(p, QPoint(xcenter, ycenter+2), surface, true, true );
+ renderDot(p, TQPoint(xcenter, ycenter-2), surface, true, true );
+ renderDot(p, TQPoint(xcenter, ycenter+2), surface, true, true );
p->setClipping(false);
}
} else if (_sliderStyle == "sliderPlastikStyle") {
if (horizontal) {
- renderContour(p, QRect(xcenter-5, ycenter-6, 11, 10),
+ renderContour(p, TQRect(xcenter-5, ycenter-6, 11, 10),
cg.background(), contour,
Draw_Left|Draw_Right|Draw_Top|Round_UpperLeft|Round_UpperRight);
@@ -1412,27 +1412,27 @@ void LipstikStyle::drawKStylePrimitive(KStylePrimitive kpe,
p->drawPoint(xcenter-5+4, ycenter+8);
p->drawPoint(xcenter+5-4, ycenter+8);
- QRegion mask(xcenter-4, ycenter-5, 9, 13);
- mask -= QRegion(xcenter-4, ycenter+4, 1, 4);
- mask -= QRegion(xcenter-3, ycenter+5, 1, 3);
- mask -= QRegion(xcenter-2, ycenter+6, 1, 2);
- mask -= QRegion(xcenter-1, ycenter+7, 1, 1);
- mask -= QRegion(xcenter+1, ycenter+7, 1, 1);
- mask -= QRegion(xcenter+2, ycenter+6, 1, 2);
- mask -= QRegion(xcenter+3, ycenter+5, 1, 3);
- mask -= QRegion(xcenter+4, ycenter+4, 1, 4);
- p->setClipRegion(mask);
+ TQRegion tqmask(xcenter-4, ycenter-5, 9, 13);
+ tqmask -= TQRegion(xcenter-4, ycenter+4, 1, 4);
+ tqmask -= TQRegion(xcenter-3, ycenter+5, 1, 3);
+ tqmask -= TQRegion(xcenter-2, ycenter+6, 1, 2);
+ tqmask -= TQRegion(xcenter-1, ycenter+7, 1, 1);
+ tqmask -= TQRegion(xcenter+1, ycenter+7, 1, 1);
+ tqmask -= TQRegion(xcenter+2, ycenter+6, 1, 2);
+ tqmask -= TQRegion(xcenter+3, ycenter+5, 1, 3);
+ tqmask -= TQRegion(xcenter+4, ycenter+4, 1, 4);
+ p->setClipRegion(tqmask);
uint surfaceFlags = Draw_Left|Draw_Right|Draw_Top|Round_UpperLeft|Round_UpperRight|Is_Horizontal;
if(!enabled)
surfaceFlags |= Is_Disabled;
- renderSurface(p, QRect(xcenter-4, ycenter-5, 9, 13),
+ renderSurface(p, TQRect(xcenter-4, ycenter-5, 9, 13),
cg.background(), surface, getColor(cg,MouseOverHighlight),
_contrast+3, surfaceFlags);
- renderDot(p, QPoint(xcenter-3, ycenter-3), surface, false, true );
- renderDot(p, QPoint(xcenter+2, ycenter-3), surface, false, true );
+ renderDot(p, TQPoint(xcenter-3, ycenter-3), surface, false, true );
+ renderDot(p, TQPoint(xcenter+2, ycenter-3), surface, false, true );
p->setClipping(false);
} else {
- renderContour(p, QRect(xcenter-6, ycenter-5, 10, 11),
+ renderContour(p, TQRect(xcenter-6, ycenter-5, 10, 11),
cg.background(), contour,
Draw_Left|Draw_Top|Draw_Bottom|Round_UpperLeft|Round_BottomLeft);
@@ -1462,36 +1462,36 @@ void LipstikStyle::drawKStylePrimitive(KStylePrimitive kpe,
p->drawPoint(xcenter+8, ycenter-5+4);
p->drawPoint(xcenter+8, ycenter+5-4);
- QRegion mask(xcenter-5, ycenter-4, 13, 9);
- mask -= QRegion(xcenter+4, ycenter-4, 4, 1);
- mask -= QRegion(xcenter+5, ycenter-3, 3, 1);
- mask -= QRegion(xcenter+6, ycenter-2, 2, 1);
- mask -= QRegion(xcenter+7, ycenter-1, 1, 1);
- mask -= QRegion(xcenter+7, ycenter+1, 1, 1);
- mask -= QRegion(xcenter+6, ycenter+2, 2, 1);
- mask -= QRegion(xcenter+5, ycenter+3, 3, 1);
- mask -= QRegion(xcenter+4, ycenter+4, 4, 1);
- p->setClipRegion(mask);
+ TQRegion tqmask(xcenter-5, ycenter-4, 13, 9);
+ tqmask -= TQRegion(xcenter+4, ycenter-4, 4, 1);
+ tqmask -= TQRegion(xcenter+5, ycenter-3, 3, 1);
+ tqmask -= TQRegion(xcenter+6, ycenter-2, 2, 1);
+ tqmask -= TQRegion(xcenter+7, ycenter-1, 1, 1);
+ tqmask -= TQRegion(xcenter+7, ycenter+1, 1, 1);
+ tqmask -= TQRegion(xcenter+6, ycenter+2, 2, 1);
+ tqmask -= TQRegion(xcenter+5, ycenter+3, 3, 1);
+ tqmask -= TQRegion(xcenter+4, ycenter+4, 4, 1);
+ p->setClipRegion(tqmask);
uint surfaceFlags = Draw_Left|Draw_Top|Draw_Bottom|Round_UpperLeft|Round_BottomLeft|
Round_UpperRight|Is_Horizontal;
if(!enabled)
surfaceFlags |= Is_Disabled;
- renderSurface(p, QRect(xcenter-5, ycenter-4, 13, 9),
+ renderSurface(p, TQRect(xcenter-5, ycenter-4, 13, 9),
cg.background(), surface, getColor(cg,MouseOverHighlight),
_contrast+3, surfaceFlags);
- renderDot(p, QPoint(xcenter-3, ycenter-3), surface, false, true );
- renderDot(p, QPoint(xcenter-3, ycenter+2), surface, false, true );
+ renderDot(p, TQPoint(xcenter-3, ycenter-3), surface, false, true );
+ renderDot(p, TQPoint(xcenter-3, ycenter+2), surface, false, true );
p->setClipping(false);
}
} else {
if (horizontal) {
- renderContour(p, QRect(xcenter-16, ycenter-7, 33, 15), cg.background(), contour,
+ renderContour(p, TQRect(xcenter-16, ycenter-7, 33, 15), cg.background(), contour,
Draw_Left|Draw_Right|Draw_Top|Round_UpperLeft|Round_UpperRight|
Draw_Bottom|Round_BottomLeft|Round_BottomRight);
- QRegion mask(xcenter-15, ycenter-6, 31, 13);
+ TQRegion tqmask(xcenter-15, ycenter-6, 31, 13);
- p->setClipRegion(mask);
+ p->setClipRegion(tqmask);
uint surfaceFlags = Draw_Left|Draw_Right|Draw_Top|Round_UpperLeft|Round_UpperRight|
Is_Horizontal;
@@ -1501,22 +1501,22 @@ void LipstikStyle::drawKStylePrimitive(KStylePrimitive kpe,
surfaceFlags |= Highlight_Right|Highlight_Left;
}
- renderSurface(p, QRect(xcenter-15, ycenter-6, 31, 13),
+ renderSurface(p, TQRect(xcenter-15, ycenter-6, 31, 13),
cg.background(), surface, getColor(cg,MouseOverHighlight),
_contrast+3, surfaceFlags);
- renderDot(p, QPoint(xcenter-4, ycenter), surface, true, true );
- renderDot(p, QPoint(xcenter, ycenter), surface, true, true );
- renderDot(p, QPoint(xcenter+4, ycenter), surface, true, true );
+ renderDot(p, TQPoint(xcenter-4, ycenter), surface, true, true );
+ renderDot(p, TQPoint(xcenter, ycenter), surface, true, true );
+ renderDot(p, TQPoint(xcenter+4, ycenter), surface, true, true );
p->setClipping(false);
} else {
- renderContour(p, QRect(xcenter-7, ycenter-16, 16, 33), cg.background(), contour,
+ renderContour(p, TQRect(xcenter-7, ycenter-16, 16, 33), cg.background(), contour,
Draw_Left|Draw_Right|Draw_Top|Round_UpperLeft|Round_UpperRight|Draw_Bottom|Round_BottomLeft|Round_BottomRight);
- QRegion mask(xcenter-6, ycenter-15, 13, 31);
- p->setClipRegion(mask);
+ TQRegion tqmask(xcenter-6, ycenter-15, 13, 31);
+ p->setClipRegion(tqmask);
uint surfaceFlags = Draw_Left|Draw_Top|Draw_Bottom|Round_UpperLeft|Round_BottomLeft|
Round_UpperRight|Is_Horizontal;
@@ -1525,13 +1525,13 @@ void LipstikStyle::drawKStylePrimitive(KStylePrimitive kpe,
else if(hoverWidget == widget)
surfaceFlags |= Highlight_Top|Highlight_Bottom;
- renderSurface(p, QRect(xcenter-6, ycenter-15, 13, 31),
+ renderSurface(p, TQRect(xcenter-6, ycenter-15, 13, 31),
cg.background(), surface, getColor(cg,MouseOverHighlight),
_contrast+3, surfaceFlags);
- renderDot(p, QPoint(xcenter, ycenter-4), surface, true, true );
- renderDot(p, QPoint(xcenter, ycenter), surface, true, true );
- renderDot(p, QPoint(xcenter, ycenter+4), surface, true, true );
+ renderDot(p, TQPoint(xcenter, ycenter-4), surface, true, true );
+ renderDot(p, TQPoint(xcenter, ycenter), surface, true, true );
+ renderDot(p, TQPoint(xcenter, ycenter+4), surface, true, true );
p->setClipping(false);
}
@@ -1557,9 +1557,9 @@ void LipstikStyle::drawKStylePrimitive(KStylePrimitive kpe,
p->drawLine( centerx, centery - radius, centerx, centery + radius );
} else if(_drawTriangularExpander) {
if( flags & Style_On )
- drawPrimitive(PE_ArrowRight, p, QRect(r.x()+1,r.y()+1,r.width(),r.height()), cg,ButtonContour, flags);
+ tqdrawPrimitive(PE_ArrowRight, p, TQRect(r.x()+1,r.y()+1,r.width(),r.height()), cg,ButtonContour, flags);
if( flags & Style_Off )
- drawPrimitive(PE_ArrowDown, p, QRect(r.x()+1,r.y()+1,r.width(),r.height()), cg,ButtonContour, flags);
+ tqdrawPrimitive(PE_ArrowDown, p, TQRect(r.x()+1,r.y()+1,r.width(),r.height()), cg,ButtonContour, flags);
}
break;
@@ -1574,10 +1574,10 @@ void LipstikStyle::drawKStylePrimitive(KStylePrimitive kpe,
{
// 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;
@@ -1586,7 +1586,7 @@ void LipstikStyle::drawKStylePrimitive(KStylePrimitive kpe,
p2.setPen( color1 );
p2.drawPoints( a );
p2.end();
- QApplication::flushX();
+ TQApplication::flushX();
verticalLine->setMask( *verticalLine );
p2.begin( horizontalLine );
@@ -1595,7 +1595,7 @@ void LipstikStyle::drawKStylePrimitive(KStylePrimitive kpe,
p2.setPen( color1 );
p2.drawPoints( a );
p2.end();
- QApplication::flushX();
+ TQApplication::flushX();
horizontalLine->setMask( *horizontalLine );
}
@@ -1643,12 +1643,12 @@ void LipstikStyle::drawKStylePrimitive(KStylePrimitive kpe,
}
-void LipstikStyle::drawPrimitive(PrimitiveElement pe,
- QPainter *p,
- const QRect &r,
- const QColorGroup &cg,
+void LipstikStyle::tqdrawPrimitive(PrimitiveElement pe,
+ TQPainter *p,
+ const TQRect &r,
+ const TQColorGroup &cg,
SFlags flags,
- const QStyleOption &opt ) const
+ const TQStyleOption &opt ) const
{
bool down = flags & Style_Down;
bool on = flags & Style_On;
@@ -1673,9 +1673,9 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
case PE_FocusRect: {
if(_drawFocusRect)
{
- QPen old = p->pen();
+ TQPen old = p->pen();
p->setPen( alphaBlendColors(cg.highlight(), getColor(cg,PanelLight), 120) );
- p->drawRect( QRect(r.topLeft(), r.bottomRight()));
+ p->drawRect( TQRect(r.topLeft(), r.bottomRight()));
p->setPen(old);
}
else
@@ -1700,7 +1700,7 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
} else {
// detect if this is the left most header item
bool isFirst = false;
- QHeader *header = dynamic_cast<QHeader*>(p->device() );
+ TQHeader *header = dynamic_cast<TQHeader*>(p->device() );
if (header) {
isFirst = header->mapToIndex(header->sectionAt(r.x() ) ) == 0;
}
@@ -1722,7 +1722,7 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
}
}
}
- renderSurface(p, QRect(isFirst?r.left()+1:r.left(), r.top()+1, isFirst?r.width()-2:r.width()-1, r.height()-2),
+ renderSurface(p, TQRect(isFirst?r.left()+1:r.left(), r.top()+1, isFirst?r.width()-2:r.width()-1, r.height()-2),
cg.background(), cg.button(), getColor(cg,MouseOverHighlight), _contrast,
surfaceFlags);
break;
@@ -1733,7 +1733,7 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
case PE_ButtonTool:
case PE_ButtonDropDown:
case PE_ButtonCommand: {
- bool khtmlMode = opt.isDefault() ? false : khtmlWidgets.contains(opt.widget());
+ bool khtmlMode = opt.isDefault() ? false : khtmlWidgets.tqcontains(opt.widget());
renderButton(p, r, cg, (on||down), mouseOver, true, enabled, khtmlMode );
break;
}
@@ -1750,11 +1750,11 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
case PE_SpinWidgetMinus: {
p->setPen( cg.buttonText() );
- int l = QMIN( w-2, h-2 );
+ int l = TQMIN( w-2, h-2 );
// make the length even so that we get a nice symmetric plus...
if(l%2 != 0)
--l;
- QPoint c = r.center();
+ TQPoint c = r.center();
p->drawLine( c.x()-l/2, c.y(), c.x()+l/2, c.y() );
if ( pe == PE_SpinWidgetPlus ) {
@@ -1765,7 +1765,7 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
case PE_ScrollBarSlider: {
const WidgetState s = enabled?(down?IsPressed:IsEnabled):IsDisabled;
- const QColor surface = getColor(cg, DragButtonSurface, s);
+ const TQColor surface = getColor(cg, DragButtonSurface, s);
bool scrollbarHighlighted = false;
uint contourFlags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom;
@@ -1786,7 +1786,7 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
if(!enabled) surfaceFlags|=Is_Disabled;
if(r.height() >= 4)
- renderSurface(p, QRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2),
+ renderSurface(p, TQRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2),
cg.background(), surface, scrollbarHighlighted?cg.highlight():cg.background(),
_contrast+3, surfaceFlags);
@@ -1798,18 +1798,18 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
if(horiz)
{
- renderDot(p, QPoint(xPos-6, yPos), surface, true, true );
- renderDot(p, QPoint(xPos-2, yPos), surface, true, true );
- renderDot(p, QPoint(xPos+2, yPos), surface, true, true );
- renderDot(p, QPoint(xPos+6, yPos), surface, true, true );
+ renderDot(p, TQPoint(xPos-6, yPos), surface, true, true );
+ renderDot(p, TQPoint(xPos-2, yPos), surface, true, true );
+ renderDot(p, TQPoint(xPos+2, yPos), surface, true, true );
+ renderDot(p, TQPoint(xPos+6, yPos), surface, true, true );
}
else
{
//--xPos;
- renderDot(p, QPoint(xPos, yPos-6), surface, true, true );
- renderDot(p, QPoint(xPos, yPos-2), surface, true, true );
- renderDot(p, QPoint(xPos, yPos+2), surface, true, true );
- renderDot(p, QPoint(xPos, yPos+6), surface, true, true );
+ renderDot(p, TQPoint(xPos, yPos-6), surface, true, true );
+ renderDot(p, TQPoint(xPos, yPos-2), surface, true, true );
+ renderDot(p, TQPoint(xPos, yPos+2), surface, true, true );
+ renderDot(p, TQPoint(xPos, yPos+6), surface, true, true );
}
break;
}
@@ -1817,17 +1817,17 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
case PE_ScrollBarAddPage:
case PE_ScrollBarSubPage: {
// draw double buffered to avoid flicker...
- QPixmap buffer;
+ TQPixmap buffer;
if(flags & Style_Horizontal) {
buffer.resize(2, r.height() );
} else {
buffer.resize(r.width(), 2 );
}
- QRect br(buffer.rect() );
- QPainter bp(&buffer);
+ TQRect br(buffer.rect() );
+ TQPainter bp(&buffer);
if (on || down) {
- bp.fillRect(br, QBrush(cg.mid().dark()));
+ bp.fillRect(br, TQBrush(cg.mid().dark()));
} else {
if(flags & Style_Horizontal) {
bp.setPen(cg.background().dark(106));
@@ -1844,11 +1844,11 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
}
}
- bp.fillRect(br, QBrush(cg.background().light(), _paintGroove?Dense4Pattern:SolidPattern));
+ bp.fillRect(br, TQBrush(cg.background().light(), _paintGroove?Dense4Pattern:SolidPattern));
bp.end();
- p->drawTiledPixmap(r, buffer, QPoint(0, r.top()%2) );
+ p->drawTiledPixmap(r, buffer, TQPoint(0, r.top()%2) );
break;
}
@@ -1871,12 +1871,12 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
}
renderContour(p, r, cg.background(), getColor(cg, ButtonContour),
contourFlags);
- renderSurface(p, QRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2),
+ renderSurface(p, TQRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2),
cg.background(), cg.button(), getColor(cg,MouseOverHighlight), _contrast+3,
surfaceFlags);
p->setPen(cg.foreground());
- drawPrimitive((horiz ? PE_ArrowLeft : PE_ArrowUp), p, r, cg, flags);
+ tqdrawPrimitive((horiz ? PE_ArrowLeft : PE_ArrowUp), p, r, cg, flags);
break;
}
@@ -1897,19 +1897,19 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
}
renderContour(p, r, cg.background(), getColor(cg, ButtonContour),
contourFlags);
- renderSurface(p, QRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2),
+ renderSurface(p, TQRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2),
cg.background(), cg.button(), getColor(cg,MouseOverHighlight), _contrast+3,
surfaceFlags);
p->setPen(cg.foreground());
- drawPrimitive((horiz ? PE_ArrowRight : PE_ArrowDown), p, r, cg, flags);
+ tqdrawPrimitive((horiz ? PE_ArrowRight : PE_ArrowDown), p, r, cg, flags);
break;
}
// CHECKBOXES
// ----------
case PE_Indicator: {
- QColor contentColor = enabled?cg.base():cg.background();
+ TQColor contentColor = enabled?cg.base():cg.background();
uint contourFlags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom;
if(!enabled) {
@@ -1928,10 +1928,10 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
surfaceFlags |= Highlight_Left|Highlight_Right|
Highlight_Top|Highlight_Bottom;
}
- renderSurface(p, QRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2),
+ renderSurface(p, TQRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2),
cg.background(), contentColor, getColor(cg,MouseOverHighlight), enabled?_contrast+3:(_contrast/2), surfaceFlags);
- drawPrimitive(PE_CheckMark, p, r, cg, flags);
+ tqdrawPrimitive(PE_CheckMark, p, r, cg, flags);
break;
}
@@ -1944,11 +1944,11 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
// RADIOBUTTONS
// ------------
case PE_ExclusiveIndicator: {
- const QColor contourColor = getColor(cg, ButtonContour, enabled);
- QColor contentColor = enabled?cg.base():cg.background();
+ const TQColor contourColor = getColor(cg, ButtonContour, enabled);
+ TQColor contentColor = enabled?cg.base():cg.background();
- QBitmap bmp;
- bmp = QBitmap(13, 13, radiobutton_mask_bits, true);
+ TQBitmap bmp;
+ bmp = TQBitmap(13, 13, radiobutton_tqmask_bits, true);
// first the surface...
uint surfaceFlags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom|Is_Horizontal;
if(!enabled) {
@@ -1963,28 +1963,28 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
// ...then contour, anti-alias, mouseOver...
// contour
- bmp = QBitmap(13, 13, radiobutton_contour_bits, true);
+ bmp = TQBitmap(13, 13, radiobutton_contour_bits, true);
bmp.setMask(bmp);
p->setPen(alphaBlendColors(cg.background(), contourColor, 50) );
p->drawPixmap(x, y, bmp);
// anti-alias outside
- bmp = QBitmap(13, 13, radiobutton_aa_outside_bits, true);
+ bmp = TQBitmap(13, 13, radiobutton_aa_outside_bits, true);
bmp.setMask(bmp);
p->setPen(alphaBlendColors(cg.background(), contourColor, 150) );
p->drawPixmap(x, y, bmp);
// highlighting...
if(mouseOver) {
- bmp = QBitmap(13, 13, radiobutton_highlight1_bits, true);
+ bmp = TQBitmap(13, 13, radiobutton_highlight1_bits, true);
bmp.setMask(bmp);
p->setPen(alphaBlendColors(contentColor, getColor(cg,MouseOverHighlight), 80) );
p->drawPixmap(x, y, bmp);
- bmp = QBitmap(13, 13, radiobutton_highlight2_bits, true);
+ bmp = TQBitmap(13, 13, radiobutton_highlight2_bits, true);
bmp.setMask(bmp);
p->setPen(alphaBlendColors(contentColor, getColor(cg,MouseOverHighlight), 150) );
p->drawPixmap(x, y, bmp);
}
// anti-alias inside, "above" the higlighting!
- bmp = QBitmap(13, 13, radiobutton_aa_inside_bits, true);
+ bmp = TQBitmap(13, 13, radiobutton_aa_inside_bits, true);
bmp.setMask(bmp);
if(mouseOver) {
p->setPen(alphaBlendColors(getColor(cg,MouseOverHighlight), contourColor, 180) );
@@ -1994,22 +1994,22 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
p->drawPixmap(x, y, bmp);
- QColor checkmarkColor = enabled?getColor(cg,CheckMark):cg.background();
+ TQColor checkmarkColor = enabled?getColor(cg,CheckMark):cg.background();
if(flags & Style_Down) {
checkmarkColor = alphaBlendColors(contentColor, checkmarkColor, 150);
}
// draw the radio mark
if (flags & Style_On || flags & Style_Down) {
- bmp = QBitmap(CHECKMARKSIZE, CHECKMARKSIZE, radiomark_dark_bits, true);
+ bmp = TQBitmap(CHECKMARKSIZE, CHECKMARKSIZE, radiomark_dark_bits, true);
bmp.setMask(bmp);
p->setPen(alphaBlendColors(contentColor, checkmarkColor.dark(150), 50) );
p->drawPixmap(x+2, y+2, bmp);
- bmp = QBitmap(CHECKMARKSIZE, CHECKMARKSIZE, radiomark_light_bits, true);
+ bmp = TQBitmap(CHECKMARKSIZE, CHECKMARKSIZE, radiomark_light_bits, true);
bmp.setMask(bmp);
p->setPen(alphaBlendColors(contentColor, checkmarkColor.dark(125), 50) );
p->drawPixmap(x+2, y+2, bmp);
- bmp = QBitmap(CHECKMARKSIZE, CHECKMARKSIZE, radiomark_aa_bits, true);
+ bmp = TQBitmap(CHECKMARKSIZE, CHECKMARKSIZE, radiomark_aa_bits, true);
bmp.setMask(bmp);
p->setPen(alphaBlendColors(contentColor, checkmarkColor.dark(150), 150) );
p->drawPixmap(x+2, y+2, bmp);
@@ -2021,8 +2021,8 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
case PE_ExclusiveIndicatorMask: {
p->fillRect(r, color0);
- QBitmap bmp;
- bmp = QBitmap(13, 13, radiobutton_mask_bits, true);
+ TQBitmap bmp;
+ bmp = TQBitmap(13, 13, radiobutton_tqmask_bits, true);
bmp.setMask(bmp);
p->setPen(color1);
p->drawPixmap(x, y, bmp);
@@ -2034,20 +2034,20 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
// --------------
case PE_Splitter: {
// highlight on mouse over
- QColor color = (hoverWidget == p->device())?cg.highlight():cg.background();
+ TQColor color = (hoverWidget == p->device())?cg.highlight():cg.background();
//p->fillRect(r, color);
if (w > h) {
if (h > 4) {
int ycenter = r.height()/2;
for(int k = 2*r.width()/10; k < 8*r.width()/10; k+=5) {
- renderDot(p, QPoint(k, ycenter-1), color, false, true);
+ renderDot(p, TQPoint(k, ycenter-1), color, false, true);
}
}
} else {
if (w > 4) {
int xcenter = r.width()/2;
for(int k = 2*r.height()/10; k < 8*r.height()/10; k+=5) {
- renderDot(p, QPoint(xcenter-1, k), color, false, true);
+ renderDot(p, TQPoint(xcenter-1, k), color, false, true);
}
}
}
@@ -2076,9 +2076,9 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
bool isEnabled = true;
// panel is highlighted by default if it has focus, but if we have access to the
// widget itself we can try to avoid highlighting in case it's readOnly or disabled.
- if (p->device() && dynamic_cast<QLineEdit*>(p->device()))
+ if (p->device() && dynamic_cast<TQLineEdit*>(p->device()))
{
- QLineEdit* lineEdit = dynamic_cast<QLineEdit*>(p->device());
+ TQLineEdit* lineEdit = dynamic_cast<TQLineEdit*>(p->device());
isReadOnly = lineEdit->isReadOnly();
isEnabled = lineEdit->isEnabled();
}
@@ -2093,9 +2093,9 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
//
// In this place there is no reliable way to detect if we are in khtml; the
// only thing we know is that khtml buffers its widgets into a pixmap. So
- // when the paint device is a QPixmap, chances are high that we are in khtml.
+ // when the paint device is a TQPixmap, chances are high that we are in khtml.
// It's possible that this breaks other things, so let's see how it works...
- if (p->device() && dynamic_cast<QPixmap*>(p->device() ) ) {
+ if (p->device() && dynamic_cast<TQPixmap*>(p->device() ) ) {
contourFlags += Draw_AlphaBlend;
}
@@ -2109,7 +2109,7 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
renderContour(p, r, cg.background(),
getColor(cg, ButtonContour, enabled), contourFlags );
}
- const QColor contentColor = enabled?cg.base():cg.background();
+ const TQColor contentColor = enabled?cg.base():cg.background();
if (_inputFocusHighlight && hasFocus && !isReadOnly && isEnabled)
{
p->setPen( getColor(cg,FocusHighlight).dark(130) );
@@ -2160,7 +2160,7 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
case PE_PanelMenuBar:
case PE_PanelDockWindow: {
// fix for toolbar lag (from Mosfet Liquid)
- QWidget* w = dynamic_cast<QWidget*>(p->device());
+ TQWidget* w = dynamic_cast<TQWidget*>(p->device());
if(w && w->backgroundMode() == PaletteButton)
w->setBackgroundMode(PaletteBackground);
@@ -2200,7 +2200,7 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
case PE_DockWindowHandle: {
// In all cases, fill the background.
- QColor handleDotColor=cg.background();
+ TQColor handleDotColor=cg.background();
//bool horiz=false;
//if ( r.width() > r.height() ) {
@@ -2223,7 +2223,7 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
handleDotColor = cg.highlight();
for(int j = kickerMode?r.top()+1:r.top()+4; j <= r.bottom()-2; j+=4)
{
- renderDot(p, QPoint(center, j), handleDotColor, kickerMode?true:false, true);
+ renderDot(p, TQPoint(center, j), handleDotColor, kickerMode?true:false, true);
}
} else {
int center = r.top() + (r.height()/2) - 2 ;
@@ -2231,7 +2231,7 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
handleDotColor = cg.highlight();
for(int j = kickerMode?r.left()+1:r.left()+4; j <= r.right()-2; j+=5)
{
- renderDot(p, QPoint(j, center+1), handleDotColor, kickerMode?true:false, true);
+ renderDot(p, TQPoint(j, center+1), handleDotColor, kickerMode?true:false, true);
}
}
}
@@ -2276,9 +2276,9 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
const int markH = markW;
int posX = r.x() + ( r.width() - markW )/2;
int posY = r.y() + ( r.height() - markH )/2-1;
- QColor contentColor = enabled?cg.base():cg.background();
+ TQColor contentColor = enabled?cg.base():cg.background();
// Could do with some optimizing/caching...
- QPointArray a( markH*2 );
+ TQPointArray a( markH*2 );
int i, xx, yy;
xx = posX;
yy = 3 + posY;
@@ -2296,7 +2296,7 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
if (flags & Style_On) {
int pnt;
- QColor checkmarkColor;
+ TQColor checkmarkColor;
if(enabled) {
checkmarkColor = getColor(cg,CheckMark);
@@ -2305,7 +2305,7 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
}
p->setPen( checkmarkColor );
- QPoint offset(1,1);
+ TQPoint offset(1,1);
for ( pnt = 0; pnt < (int)a.size(); pnt++ )
a[pnt];
p->drawLineSegments( a );
@@ -2313,11 +2313,11 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
a[pnt];
} else if(flags & Style_Down) {
int pnt;
- QColor checkmarkColor = alphaBlendColors(contentColor, checkmarkColor, 150);
+ TQColor checkmarkColor = alphaBlendColors(contentColor, checkmarkColor, 150);
p->setPen( checkmarkColor );
- QPoint offset(1,1);
+ TQPoint offset(1,1);
for ( pnt = 0; pnt < (int)a.size(); pnt++ )
a[pnt];
p->drawLineSegments( a );
@@ -2328,7 +2328,7 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
} else {
int pnt;
p->setPen( cg.mid() );
- QPoint offset(1,1);
+ TQPoint offset(1,1);
for ( pnt = 0; pnt < (int)a.size(); pnt++ )
a[pnt];
p->drawLineSegments( a );
@@ -2336,31 +2336,31 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
a[pnt];
}
} else {
- const QColor contentColor = enabled?cg.base():cg.background();
- QColor checkmarkColor = enabled?getColor(cg,CheckMark):cg.background();
+ const TQColor contentColor = enabled?cg.base():cg.background();
+ TQColor checkmarkColor = enabled?getColor(cg,CheckMark):cg.background();
if(flags & Style_Down) {
checkmarkColor = alphaBlendColors(contentColor, checkmarkColor, 150);
}
int x = r.center().x() - 4, y = r.center().y() - 4;
- QBitmap bmp;
+ TQBitmap bmp;
if( flags & Style_On ) {
- bmp = QBitmap(CHECKMARKSIZE, CHECKMARKSIZE, checkmark_dark_bits, true);
+ bmp = TQBitmap(CHECKMARKSIZE, CHECKMARKSIZE, checkmark_dark_bits, true);
bmp.setMask(bmp);
p->setPen(alphaBlendColors(contentColor, checkmarkColor.dark(150), 50) );
p->drawPixmap(x, y, bmp);
- bmp = QBitmap(CHECKMARKSIZE, CHECKMARKSIZE, checkmark_light_bits, true);
+ bmp = TQBitmap(CHECKMARKSIZE, CHECKMARKSIZE, checkmark_light_bits, true);
bmp.setMask(bmp);
p->setPen(alphaBlendColors(contentColor, checkmarkColor.dark(125), 50) );
p->drawPixmap(x, y, bmp);
- bmp = QBitmap(CHECKMARKSIZE, CHECKMARKSIZE, checkmark_aa_bits, true);
+ bmp = TQBitmap(CHECKMARKSIZE, CHECKMARKSIZE, checkmark_aa_bits, true);
bmp.setMask(bmp);
p->setPen(alphaBlendColors(contentColor, checkmarkColor.dark(150), 150) );
p->drawPixmap(x, y, bmp);
} else if ( flags & Style_Off ) {
// empty
} else { // tristate
- bmp = QBitmap(CHECKMARKSIZE, CHECKMARKSIZE, checkmark_tristate_bits, true);
+ bmp = TQBitmap(CHECKMARKSIZE, CHECKMARKSIZE, checkmark_tristate_bits, true);
bmp.setMask(bmp);
p->setPen(alphaBlendColors(contentColor, checkmarkColor.dark(150), 50) );
p->drawPixmap(x, y, bmp);
@@ -2376,7 +2376,7 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
case PE_ArrowDown:
case PE_ArrowLeft:
case PE_ArrowRight: {
- QPointArray a;
+ TQPointArray a;
switch (pe) {
case PE_SpinWidgetUp:
@@ -2406,11 +2406,11 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
}
}
- const QWMatrix oldMatrix( p->worldMatrix() );
+ const TQWMatrix oldMatrix( p->tqworldMatrix() );
if (flags & Style_Down) {
- p->translate(pixelMetric(PM_ButtonShiftHorizontal),
- pixelMetric(PM_ButtonShiftVertical));
+ p->translate(tqpixelMetric(PM_ButtonShiftHorizontal),
+ tqpixelMetric(PM_ButtonShiftVertical));
}
a.translate((r.x()+r.width()/2), (r.y()+r.height()/2));
@@ -2428,7 +2428,7 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
a.translate(0, 0);
}
- if (p->pen() == QPen::NoPen) {
+ if (p->pen() == TQPen(TQPen::NoPen)) {
if (flags & Style_Enabled) {
p->setPen(cg.buttonText());
} else {
@@ -2445,21 +2445,21 @@ void LipstikStyle::drawPrimitive(PrimitiveElement pe,
}
default: {
- return KStyle::drawPrimitive(pe, p, r, cg, flags, opt);
+ return KStyle::tqdrawPrimitive(pe, p, r, cg, flags, opt);
}
}
}
-void LipstikStyle::drawControl(ControlElement element,
- QPainter *p,
- const QWidget *widget,
- const QRect &r,
- const QColorGroup &cg,
+void LipstikStyle::tqdrawControl(ControlElement element,
+ TQPainter *p,
+ const TQWidget *widget,
+ const TQRect &r,
+ const TQColorGroup &cg,
SFlags flags,
- const QStyleOption& opt) const
+ const TQStyleOption& opt) const
{
- const bool reverseLayout = QApplication::reverseLayout();
+ const bool reverseLayout = TQApplication::reverseLayout();
const bool enabled = (flags & Style_Enabled);
@@ -2468,7 +2468,7 @@ void LipstikStyle::drawControl(ControlElement element,
// PROGRESSBAR
// -----------
case CE_ProgressBarGroove: {
- const QColor content = enabled?cg.base():cg.background();
+ const TQColor content = enabled?cg.base():cg.background();
renderContour(p, r, cg.background(), getColor(cg, ButtonContour, enabled) );
p->setPen(content.dark(105) );
p->drawLine(r.left()+2, r.top()+1, r.right()-2, r.top()+1 );
@@ -2480,11 +2480,11 @@ void LipstikStyle::drawControl(ControlElement element,
}
case CE_ProgressBarContents: {
- const QProgressBar *pb = dynamic_cast<const QProgressBar*>(widget);
+ const TQProgressBar *pb = dynamic_cast<const TQProgressBar*>(widget);
int steps = pb->totalSteps();
- const QColor bg = enabled?cg.base():cg.background(); // background
- const QColor fg = enabled?cg.highlight():cg.background().dark(110); // foreground
+ const TQColor bg = enabled?cg.base():cg.background(); // background
+ const TQColor fg = enabled?cg.highlight():TQColor(cg.background().dark(110)); // foreground
if( steps == 0 ) { // Busy indicator
static const int barWidth = 10;
@@ -2493,12 +2493,12 @@ void LipstikStyle::drawControl(ControlElement element,
progress = 0;
if( progress > r.width()-barWidth )
progress = (r.width()-barWidth)-(progress-(r.width()-barWidth));
- p->fillRect( QRect( r.x(), r.y(), r.width(), r.height() ), bg );
- renderContour( p, QRect( r.x()+progress, r.y(), barWidth, r.height() ),
+ p->fillRect( TQRect( r.x(), r.y(), r.width(), r.height() ), bg );
+ renderContour( p, TQRect( r.x()+progress, r.y(), barWidth, r.height() ),
bg, fg.dark(160),
Draw_Left|Draw_Right|Draw_Top|Draw_Bottom|Round_UpperRight|
Round_BottomRight|Round_UpperLeft|Round_BottomLeft );
- renderSurface(p, QRect( r.x()+progress+1, r.y()+1, barWidth-2, r.height()-2 ),
+ renderSurface(p, TQRect( r.x()+progress+1, r.y()+1, barWidth-2, r.height()-2 ),
bg, fg, cg.highlight(),
2*(_contrast/3),
Draw_Right|Draw_Left|Draw_Top|Draw_Bottom|
@@ -2513,9 +2513,9 @@ void LipstikStyle::drawControl(ControlElement element,
if(w<4) w = 4;
int w2 = r.width()-(r.width()-w);
- QRect Rempty(reverseLayout?r.left():r.left()+w-1, r.top(), r.width()-w+1, r.height() );
- QRect Rcontour(reverseLayout?r.right()-w2+1:r.left(), r.top(), w2, r.height() );
- QRect Rsurface(Rcontour.left()+1, Rcontour.top()+1, w2-2, Rcontour.height()-2);
+ TQRect Rempty(reverseLayout?r.left():r.left()+w-1, r.top(), r.width()-w+1, r.height() );
+ TQRect Rcontour(reverseLayout?r.right()-w2+1:r.left(), r.top(), w2, r.height() );
+ TQRect Rsurface(Rcontour.left()+1, Rcontour.top()+1, w2-2, Rcontour.height()-2);
p->fillRect(Rempty, bg);
@@ -2524,18 +2524,18 @@ void LipstikStyle::drawControl(ControlElement element,
reverseLayout ? Draw_Left|Draw_Right|Draw_Top|Draw_Bottom|Round_UpperLeft|Round_BottomLeft
: Draw_Left|Draw_Right|Draw_Top|Draw_Bottom|Round_UpperRight|Round_BottomRight);
- QRegion mask(Rsurface);
+ TQRegion tqmask(Rsurface);
if(reverseLayout) {
- mask -= QRegion(Rsurface.left(), Rsurface.top(), 1, 1);
- mask -= QRegion(Rsurface.left(), Rsurface.bottom(), 1, 1);
+ tqmask -= TQRegion(Rsurface.left(), Rsurface.top(), 1, 1);
+ tqmask -= TQRegion(Rsurface.left(), Rsurface.bottom(), 1, 1);
} else {
- mask -= QRegion(Rsurface.right(), Rsurface.top(), 1, 1);
- mask -= QRegion(Rsurface.right(), Rsurface.bottom(), 1, 1);
+ tqmask -= TQRegion(Rsurface.right(), Rsurface.top(), 1, 1);
+ tqmask -= TQRegion(Rsurface.right(), Rsurface.bottom(), 1, 1);
}
- p->setClipRegion(mask);
+ p->setClipRegion(tqmask);
int counter = 0;
- QPixmap surfaceTile(21, r.height()-2);
- QPainter surfacePainter(&surfaceTile);
+ TQPixmap surfaceTile(21, r.height()-2);
+ TQPainter surfacePainter(&surfaceTile);
// - 21 pixel -
// __________
// | ` `| <- 3
@@ -2547,7 +2547,7 @@ void LipstikStyle::drawControl(ControlElement element,
const int tileHeight = surfaceTile.height();
// 3
renderSurface(&surfacePainter,
- QRect(20, 0, 11, tileHeight),
+ TQRect(20, 0, 11, tileHeight),
fg.light(105), fg, cg.highlight(), 2*(_contrast/3),
reverseLayout ? Draw_Right|Draw_Left|Draw_Top|Draw_Bottom|
Round_UpperLeft|Round_BottomLeft|Is_Horizontal
@@ -2555,7 +2555,7 @@ void LipstikStyle::drawControl(ControlElement element,
Round_UpperRight|Round_BottomRight|Is_Horizontal);
// 2
renderSurface(&surfacePainter,
- QRect(10, 0, 11, tileHeight),
+ TQRect(10, 0, 11, tileHeight),
fg, fg.light(105), cg.highlight(), 2*(_contrast/3),
reverseLayout ? Draw_Right|Draw_Left|Draw_Top|Draw_Bottom|
Round_UpperLeft|Round_BottomLeft|Is_Horizontal
@@ -2563,7 +2563,7 @@ void LipstikStyle::drawControl(ControlElement element,
Round_UpperRight|Round_BottomRight|Is_Horizontal);
// 1
renderSurface(&surfacePainter,
- QRect(0, 0, 11, tileHeight),
+ TQRect(0, 0, 11, tileHeight),
fg.light(105), fg, cg.highlight(), 2*(_contrast/3),
reverseLayout ? Draw_Right|Draw_Left|Draw_Top|Draw_Bottom|
Round_UpperLeft|Round_BottomLeft|Is_Horizontal
@@ -2577,8 +2577,8 @@ void LipstikStyle::drawControl(ControlElement element,
staticShift = (reverseLayout ? Rsurface.left() : Rsurface.right()) % 40 - 40;
} else {
// find the animation Offset for the current Widget
- QWidget* nonConstWidget = const_cast<QWidget*>(widget);
- QMapConstIterator<QWidget*, int> iter = progAnimWidgets.find(nonConstWidget);
+ TQWidget* nonConstWidget = const_cast<TQWidget*>(widget);
+ TQMapConstIterator<TQWidget*, int> iter = progAnimWidgets.tqfind(nonConstWidget);
if (iter != progAnimWidgets.end())
animShift = iter.data();
}
@@ -2604,16 +2604,16 @@ void LipstikStyle::drawControl(ControlElement element,
// TABS
// ----
case CE_TabBarTab: {
- const QTabBar * tb = (const QTabBar *) widget;
+ const TQTabBar * tb = (const TQTabBar *) widget;
bool cornerWidget = false;
- if( ::qt_cast<QTabWidget*>(tb->parent()) ) {
- const QTabWidget *tw = (const QTabWidget*)tb->parent();
+ if( ::tqqt_cast<TQTabWidget*>(tb->tqparent()) ) {
+ const TQTabWidget *tw = (const TQTabWidget*)tb->tqparent();
// is there a corner widget in the (top) left edge?
- QWidget *cw = tw->cornerWidget(Qt::TopLeft);
+ TQWidget *cw = tw->cornerWidget(TQt::TopLeft);
if(cw)
cornerWidget = true;
}
- QTabBar::Shape tbs = tb->shape();
+ TQTabBar::Shape tbs = tb->tqshape();
bool selected = false;
if (flags & Style_Selected) selected = true;
TabPosition pos;
@@ -2634,29 +2634,29 @@ void LipstikStyle::drawControl(ControlElement element,
}
switch (tbs) {
- case QTabBar::TriangularAbove:
+ case TQTabBar::TriangularAbove:
// renderTriangularTab(p, r, cg, (flags & Style_MouseOver), selected, false, pos);
renderTab(p, r, cg, mouseOver, selected, false, pos, true, cornerWidget);
break;
- case QTabBar::RoundedAbove:
+ case TQTabBar::RoundedAbove:
renderTab(p, r, cg, mouseOver, selected, false, pos, false, cornerWidget);
break;
- case QTabBar::TriangularBelow:
+ case TQTabBar::TriangularBelow:
// renderTriangularTab(p, r, cg, (flags & Style_MouseOver), selected, true, pos);
renderTab(p, r, cg, mouseOver, selected, true, pos, true, cornerWidget);
break;
- case QTabBar::RoundedBelow:
+ case TQTabBar::RoundedBelow:
renderTab(p, r, cg, mouseOver, selected, true, pos, false, cornerWidget);
break;
default:
- KStyle::drawControl(element, p, widget, r, cg, flags, opt);
+ KStyle::tqdrawControl(element, p, widget, r, cg, flags, opt);
}
break;
}
case CE_PushButton: {
- QPushButton *button = (QPushButton *)widget;
+ TQPushButton *button = (TQPushButton *)widget;
const bool isDefault = enabled && button->isDefault();
@@ -2666,15 +2666,15 @@ void LipstikStyle::drawControl(ControlElement element,
if (widget == hoverWidget)
flags |= Style_MouseOver;
- QColorGroup g2 = cg;
+ TQColorGroup g2 = cg;
if (isDefault)
- g2.setColor(QColorGroup::Background, cg.background().dark(120) );
- drawPrimitive(PE_ButtonBevel, p,
- isDefault?QRect(r.x()+1,r.y()+1,r.width()-2,r.height()-2):r,
- g2, flags, QStyleOption(button) );
+ g2.setColor(TQColorGroup::Background, cg.background().dark(120) );
+ tqdrawPrimitive(PE_ButtonBevel, p,
+ isDefault?TQRect(r.x()+1,r.y()+1,r.width()-2,r.height()-2):r,
+ g2, flags, TQStyleOption(button) );
if (isDefault ) {
- drawPrimitive(PE_ButtonDefault, p, r, cg, flags);
+ tqdrawPrimitive(PE_ButtonDefault, p, r, cg, flags);
}
break;
@@ -2685,31 +2685,31 @@ void LipstikStyle::drawControl(ControlElement element,
int x, y, w, h;
r.rect( &x, &y, &w, &h );
- const QPushButton* button = static_cast<const QPushButton *>( widget );
+ const TQPushButton* button = static_cast<const TQPushButton *>( widget );
bool active = button->isOn() || button->isDown();
bool cornArrow = false;
// Shift button contents if pushed.
if ( active )
{
- x += pixelMetric(PM_ButtonShiftHorizontal, widget);
- y += pixelMetric(PM_ButtonShiftVertical, widget);
+ x += tqpixelMetric(PM_ButtonShiftHorizontal, widget);
+ y += tqpixelMetric(PM_ButtonShiftVertical, widget);
flags |= Style_Sunken;
}
// Does the button have a popup menu?
if ( button->isMenuButton() )
{
- int dx = pixelMetric( PM_MenuButtonIndicator, widget );
+ int dx = tqpixelMetric( PM_MenuButtonIndicator, widget );
if ( button->iconSet() && !button->iconSet()->isNull() &&
- (dx + button->iconSet()->pixmap (QIconSet::Small, QIconSet::Normal, QIconSet::Off ).width()) >= w )
+ (dx + button->iconSet()->pixmap (TQIconSet::Small, TQIconSet::Normal, TQIconSet::Off ).width()) >= w )
{
cornArrow = true; //To little room. Draw the arrow in the corner, don't adjust the widget
}
else
{
p->setPen(cg.buttonText());
- drawPrimitive( PE_ArrowDown, p, visualRect( QRect(x + w - dx - 8, y + 2, dx, h - 4), r ),
+ tqdrawPrimitive( PE_ArrowDown, p, tqvisualRect( TQRect(x + w - dx - 8, y + 2, dx, h - 4), r ),
cg, flags, opt );
w -= dx;
}
@@ -2718,15 +2718,15 @@ void LipstikStyle::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 );
if (button->text().isEmpty() && !button->pixmap())
p->drawPixmap( x + w/2 - pixmap.width()/2, y + h / 2 - pixmap.height() / 2,
@@ -2735,7 +2735,7 @@ void LipstikStyle::drawControl(ControlElement element,
p->drawPixmap( x + 4, y + h / 2 - pixmap.height() / 2, pixmap );
if (cornArrow) //Draw over the icon
- drawPrimitive( PE_ArrowDown, p, visualRect( QRect(x + w - 6, x + h - 6, 7, 7), r ),
+ tqdrawPrimitive( PE_ArrowDown, p, tqvisualRect( TQRect(x + w - 6, x + h - 6, 7, 7), r ),
cg, flags, opt );
@@ -2745,14 +2745,14 @@ void LipstikStyle::drawControl(ControlElement element,
}
// Make the label indicate if the button is a default button or not
- drawItem( p, QRect(x, y, w, h), AlignCenter|ShowPrefix, button->colorGroup(),
+ drawItem( p, TQRect(x, y, w, h), AlignCenter|ShowPrefix, button->tqcolorGroup(),
button->isEnabled(), button->pixmap(), button->text(), -1,
- &button->colorGroup().buttonText() );
+ &button->tqcolorGroup().buttonText() );
if ( flags & Style_HasFocus )
- drawPrimitive( PE_FocusRect, p,
- visualRect( subRect( SR_PushButtonFocusRect, widget ), widget ),
+ tqdrawPrimitive( PE_FocusRect, p,
+ tqvisualRect( subRect( SR_PushButtonFocusRect, widget ), widget ),
cg, flags );
break;
}
@@ -2760,7 +2760,7 @@ void LipstikStyle::drawControl(ControlElement element,
// MENUBAR ITEM (sunken panel on mouse over)
// -----------------------------------------
case CE_MenuBarItem: {
- QMenuItem *mi = opt.menuItem();
+ TQMenuItem *mi = opt.menuItem();
bool active = flags & Style_Active;
bool focused = flags & Style_HasFocus;
bool down = flags & Style_Down;
@@ -2785,7 +2785,7 @@ void LipstikStyle::drawControl(ControlElement element,
contourFlags);
renderSurface(p,
- QRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2),
+ TQRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2),
alphaBlendColors(getColor(cg,MenuStripeColor),
cg.background().light( 105 ),
50),
@@ -2802,9 +2802,9 @@ void LipstikStyle::drawControl(ControlElement element,
p->drawText(r, text_flags, mi->text());
} else {
if (down) {
- drawPrimitive(PE_ButtonTool, p, r, cg, flags|Style_Down, opt);
+ tqdrawPrimitive(PE_ButtonTool, p, r, cg, flags|Style_Down, opt);
} else {
- drawPrimitive(PE_ButtonTool, p, r, cg, flags, opt);
+ tqdrawPrimitive(PE_ButtonTool, p, r, cg, flags, opt);
}
p->setPen(cg.buttonText() );
p->drawText(r, text_flags, mi->text());
@@ -2819,12 +2819,12 @@ void LipstikStyle::drawControl(ControlElement element,
// POPUPMENU ITEM (highlighted on mouseover)
// ------------------------------------------
case CE_PopupMenuItem: {
- const QPopupMenu *popupmenu = static_cast< const QPopupMenu * >( widget );
- QMenuItem *mi = opt.menuItem();
+ const TQPopupMenu *popupmenu = static_cast< const TQPopupMenu * >( widget );
+ 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.background().light( 105 ) );
@@ -2836,11 +2836,11 @@ void LipstikStyle::drawControl(ControlElement element,
bool enabled = mi->isEnabled();
bool checkable = popupmenu->isCheckable();
bool active = flags & Style_Active;
- bool etchtext = styleHint( SH_EtchDisabledText );
- bool reverse = QApplication::reverseLayout();
+ bool etchtext = tqstyleHint( SH_EtchDisabledText );
+ bool reverse = TQApplication::reverseLayout();
if ( checkable )
- checkcol = QMAX( checkcol, 20 );
+ checkcol = TQMAX( checkcol, 20 );
// Draw the menu item background
if (active) {
@@ -2861,7 +2861,7 @@ void LipstikStyle::drawControl(ControlElement element,
contourFlags);
renderSurface(p,
- QRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2),
+ TQRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2),
alphaBlendColors(getColor(cg,MenuStripeColor),
cg.background().light( 105 ),
50),
@@ -2881,15 +2881,15 @@ void LipstikStyle::drawControl(ControlElement element,
}
} else {
if(_drawFocusRect) {
- p->setPen(QPen(cg.highlight().dark(130), 1));
- p->drawRect(QRect(r.left(), r.top(), r.width(), r.height()));
+ p->setPen(TQPen(cg.highlight().dark(130), 1));
+ p->drawRect(TQRect(r.left(), r.top(), r.width(), r.height()));
} else {
p->drawWinFocusRect( r );
}
}
} else if ( widget->erasePixmap() && !widget->erasePixmap()->isNull() ) {
// Draw the transparency pixmap
- // Transparency in KDE3/Qt3 is an EVIL hack! Beware!
+ // Transparency in KDE3/TQt3 is an EVIL hack! Beware!
p->drawPixmap( r.topLeft(), *widget->erasePixmap(), r );
} else {
// Draw a solid background
@@ -2897,12 +2897,12 @@ void LipstikStyle::drawControl(ControlElement element,
//add a pretty bar on the left side of the menu, now looks good too!
if(_menuLeftSideBar && !active) {
if(_flatStripe) {
- p->fillRect( QRect(r.left(),r.top(), checkcol+4,r.bottom()-r.top()+1), getColor(cg, MenuStripeColor) );
+ p->fillRect( TQRect(r.left(),r.top(), checkcol+4,r.bottom()-r.top()+1), getColor(cg, MenuStripeColor) );
} else {
if(_reverseGradients) {
- renderGradient(p, QRect(r.left(),r.top(), checkcol+4,r.bottom()-r.top()+1), getColor(cg, MenuStripeColor), cg.background().light( 105 ), false);
+ renderGradient(p, TQRect(r.left(),r.top(), checkcol+4,r.bottom()-r.top()+1), getColor(cg, MenuStripeColor), cg.background().light( 105 ), false);
} else {
- renderGradient(p, QRect(r.left(),r.top(), checkcol+4,r.bottom()-r.top()+1),cg.background().light( 105 ), getColor(cg, MenuStripeColor), false);
+ renderGradient(p, TQRect(r.left(),r.top(), checkcol+4,r.bottom()-r.top()+1),cg.background().light( 105 ), getColor(cg, MenuStripeColor), false);
}
}
}
@@ -2923,34 +2923,34 @@ void LipstikStyle::drawControl(ControlElement element,
break;
}
- QRect cr = visualRect( QRect( r.x() + 2, r.y() + 2, checkcol - 1, r.height() - 4 ), r );
+ TQRect cr = tqvisualRect( TQRect( r.x() + 2, r.y() + 2, checkcol - 1, r.height() - 4 ), r );
// Do we have an icon?
if ( mi->iconSet() ) {
- QIconSet::Mode mode;
+ TQIconSet::Mode mode;
// 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;
- 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 );
// Do we have an icon and are checked at the same time?
// Then dont draw the icon, only the check. I believe its more
- // apparent its checked, compared to an almost invisible pressed background only.
+ // aptqparent its checked, compared to an almost invisible pressed background only.
if ( checkable && /*!active &&*/ mi->isChecked() ) {
qDrawShadePanel( p, cr.x(), cr.y(), cr.width(), cr.height(), cg, true, 1,
- &cg.brush(QColorGroup::Midlight) );
+ &cg.brush(TQColorGroup::Midlight) );
// Draw the checkmark
SFlags cflags = Style_On;
if (enabled)
cflags |= Style_Enabled;
- drawPrimitive( PE_CheckMark, p, cr, cg, cflags );
+ tqdrawPrimitive( PE_CheckMark, p, cr, cg, cflags );
}
}
@@ -2961,13 +2961,13 @@ void LipstikStyle::drawControl(ControlElement element,
// if it's active the "pressed" background is already drawn
// if ( ! active )
qDrawShadePanel( p, cr.x(), cr.y(), cr.width(), cr.height(), cg, true, 1,
- &cg.brush(QColorGroup::Midlight) );
+ &cg.brush(TQColorGroup::Midlight) );
// Draw the checkmark
SFlags cflags = Style_On;
if (enabled)
cflags |= Style_Enabled;
- drawPrimitive( PE_CheckMark, p, cr, cg, cflags );
+ tqdrawPrimitive( PE_CheckMark, p, cr, cg, cflags );
}
// Time to draw the menu item label...
@@ -2991,7 +2991,7 @@ void LipstikStyle::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() ) {
@@ -3011,16 +3011,16 @@ void LipstikStyle::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() ) {
- int t = s.find( '\t' );
+ int t = s.tqfind( '\t' );
int m = 2;
int text_flags = AlignVCenter | ShowPrefix | DontClip | SingleLine;
text_flags |= reverse ? AlignRight : AlignLeft;
- //QColor draw = cg.text();
- QColor draw = (active && enabled) ? cg.highlightedText () : cg.foreground();
+ //TQColor draw = cg.text();
+ TQColor draw = (active && enabled) ? cg.highlightedText () : cg.foreground();
p->setPen(draw);
// Does the menu item have a tabstop? (for the accelerator text)
@@ -3058,26 +3058,26 @@ void LipstikStyle::drawControl(ControlElement element,
// The menu item doesn't have a text label
// 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 )
- p->setBackgroundMode( OpaqueMode );
+ p->setBackgroundMode( Qt::OpaqueMode );
int diffw = ( ( r.width() - pixmap->width() ) / 2 )
+ ( ( r.width() - pixmap->width() ) % 2 );
p->drawPixmap( r.x()+diffw, r.y()+1, *pixmap );
if ( pixmap->depth() == 1 )
- p->setBackgroundMode( TransparentMode );
+ p->setBackgroundMode( Qt::TransparentMode );
}
}
// Does the menu item have a submenu?
if ( mi->popup() ) {
PrimitiveElement arrow = reverse ? PE_ArrowLeft : PE_ArrowRight;
- int dim = pixelMetric(PM_MenuButtonIndicator) - 1;
- QRect vr = visualRect( QRect( r.x() + r.width() - 5 - 1 - dim,
+ int dim = tqpixelMetric(PM_MenuButtonIndicator) - 1;
+ TQRect vr = tqvisualRect( TQRect( r.x() + r.width() - 5 - 1 - dim,
r.y() + r.height() / 2 - dim / 2, dim, dim), r );
// Draw an arrow at the far end of the menu item
@@ -3087,12 +3087,12 @@ void LipstikStyle::drawControl(ControlElement element,
p->setPen(cg.highlightedText());
else
p->setPen(cg.buttonText());
- drawPrimitive( arrow, p, vr, cg, Style_Enabled );
+ tqdrawPrimitive( arrow, p, vr, cg, Style_Enabled );
}
else
{
p->setPen(cg.buttonText());
- drawPrimitive( arrow, p, vr, cg, enabled? Style_Enabled : Style_Default );
+ tqdrawPrimitive( arrow, p, vr, cg, enabled? Style_Enabled : Style_Default );
}
}
break;
@@ -3103,7 +3103,7 @@ void LipstikStyle::drawControl(ControlElement element,
case CE_DockWindowEmptyArea:
if (_drawToolBarGradient) {
- QDockWindow *wind = (QDockWindow*)widget;
+ TQDockWindow *wind = (TQDockWindow*)widget;
bool horizontal=false;
if ( Qt::Horizontal==wind->orientation() ) {
horizontal=true;
@@ -3123,15 +3123,15 @@ void LipstikStyle::drawControl(ControlElement element,
break;
default:
- KStyle::drawControl(element, p, widget, r, cg, flags, opt);
+ KStyle::tqdrawControl(element, p, widget, r, cg, flags, opt);
}
}
-void LipstikStyle::drawControlMask(ControlElement element,
- QPainter *p,
- const QWidget *w,
- const QRect &r,
- const QStyleOption &opt) const
+void LipstikStyle::tqdrawControlMask(ControlElement element,
+ TQPainter *p,
+ const TQWidget *w,
+ const TQRect &r,
+ const TQStyleOption &opt) const
{
switch (element) {
case CE_PushButton: {
@@ -3142,16 +3142,16 @@ void LipstikStyle::drawControlMask(ControlElement element,
}
default: {
- KStyle::drawControlMask (element, p, w, r, opt);
+ KStyle::tqdrawControlMask (element, p, w, r, opt);
}
}
}
-void LipstikStyle::drawComplexControlMask(ComplexControl c,
- QPainter *p,
- const QWidget *w,
- const QRect &r,
- const QStyleOption &o) const
+void LipstikStyle::tqdrawComplexControlMask(ComplexControl c,
+ TQPainter *p,
+ const TQWidget *w,
+ const TQRect &r,
+ const TQStyleOption &o) const
{
switch (c) {
case CC_SpinWidget:
@@ -3163,22 +3163,22 @@ void LipstikStyle::drawComplexControlMask(ComplexControl c,
break;
}
default: {
- KStyle::drawComplexControlMask (c, p, w, r, o);
+ KStyle::tqdrawComplexControlMask (c, p, w, r, o);
}
}
}
-void LipstikStyle::drawComplexControl(ComplexControl control,
- QPainter *p,
- const QWidget *widget,
- const QRect &r,
- const QColorGroup &cg,
+void LipstikStyle::tqdrawComplexControl(ComplexControl control,
+ 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 bool reverseLayout = QApplication::reverseLayout();
+ const bool reverseLayout = TQApplication::reverseLayout();
const bool enabled = (flags & Style_Enabled);
@@ -3188,7 +3188,7 @@ void LipstikStyle::drawComplexControl(ComplexControl control,
case CC_ComboBox: {
static const unsigned int handleWidth = 15;
- const QComboBox *cb = dynamic_cast<const QComboBox *>(widget);
+ const TQComboBox *cb = dynamic_cast<const TQComboBox *>(widget);
// at the moment cb is only needed to check if the combo box is editable or not.
// if cb doesn't exist, just assume false and the app (gideon! ;) ) at least doesn't crash.
bool editable = false;
@@ -3198,19 +3198,19 @@ void LipstikStyle::drawComplexControl(ComplexControl control,
hasFocus = cb->hasFocus();
}
- const QColor buttonColor = enabled?cg.button():cg.background();
- const QColor inputColor = enabled?(editable?cg.base():cg.button())
+ const TQColor buttonColor = enabled?cg.button():cg.background();
+ const TQColor inputColor = enabled?(editable?cg.base():cg.button())
:cg.background();
uint contourFlags = 0;
- if( khtmlWidgets.contains(cb) )
+ if( khtmlWidgets.tqcontains(cb) )
contourFlags |= Draw_AlphaBlend;
if (_inputFocusHighlight && hasFocus && editable && enabled)
{
- QRect editField = querySubControlMetrics(control, widget, SC_ComboBoxEditField);
- QRect editFrame = r;
- QRect buttonFrame = r;
+ TQRect editField = querySubControlMetrics(control, widget, SC_ComboBoxEditField);
+ TQRect editFrame = r;
+ TQRect buttonFrame = r;
uint editFlags = contourFlags;
uint buttonFlags = contourFlags;
@@ -3251,9 +3251,9 @@ void LipstikStyle::drawComplexControl(ComplexControl control,
p->drawLine(r.right()-handleWidth-1, r.top()+1, r.right()-handleWidth-1, r.bottom()-1);
}
- const QRect RbuttonSurface(reverseLayout?r.left()+1:r.right()-handleWidth, r.top()+1,
+ const TQRect RbuttonSurface(reverseLayout?r.left()+1:r.right()-handleWidth, r.top()+1,
handleWidth, r.height()-2);
- const QRect RcontentSurface(reverseLayout?r.left()+1+handleWidth+1:r.left()+1, r.top()+1,
+ const TQRect RcontentSurface(reverseLayout?r.left()+1+handleWidth+1:r.left()+1, r.top()+1,
r.width()-handleWidth-3, r.height()-2);
// handler
@@ -3297,8 +3297,8 @@ void LipstikStyle::drawComplexControl(ComplexControl control,
cg.background(), buttonColor, getColor(cg,MouseOverHighlight), enabled?_contrast+3:(_contrast/2),
surfaceFlags);
if (hasFocus) {
- drawPrimitive(PE_FocusRect, p,
- QRect(RcontentSurface.x() + 2,
+ tqdrawPrimitive(PE_FocusRect, p,
+ TQRect(RcontentSurface.x() + 2,
RcontentSurface.y() + 2,
RcontentSurface.width() - 4,
RcontentSurface.height() - 4), cg);
@@ -3340,9 +3340,9 @@ void LipstikStyle::drawComplexControl(ComplexControl control,
} else {
p->setPen(cg.foreground());
}
- drawPrimitive(PE_SpinWidgetDown, p, RbuttonSurface, cg, Style_Default|Style_Enabled|Style_Raised);
+ tqdrawPrimitive(PE_SpinWidgetDown, p, RbuttonSurface, cg, Style_Default|Style_Enabled|Style_Raised);
- // QComboBox draws the text using cg.text(), we can override this
+ // TQComboBox draws the text using cg.text(), we can override this
// from here
p->setPen( cg.buttonText() );
p->setBackgroundColor( cg.button() );
@@ -3352,9 +3352,9 @@ void LipstikStyle::drawComplexControl(ComplexControl control,
// TOOLBUTTON
// ----------
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);
@@ -3363,14 +3363,14 @@ void LipstikStyle::drawComplexControl(ComplexControl control,
if (kornMode)
{
- drawPrimitive(PE_ButtonTool, p, button, cg, bflags, opt);
+ tqdrawPrimitive(PE_ButtonTool, p, button, cg, bflags, opt);
break;
}
else
{
- // Tricky... (I'm lucky QtCurve has already gone there... thanks Craig!)
+ // Tricky... (I'm lucky TQtCurve has already gone there... thanks Craig!)
if (_drawToolBarGradient) {
- const QToolBar *tbar=widget->parentWidget() ? ::qt_cast<const QToolBar *>(widget->parentWidget()) : NULL;
+ const TQToolBar *tbar=widget->tqparentWidget() ? ::tqqt_cast<const TQToolBar *>(widget->tqparentWidget()) : NULL;
bool horizontal=false;
if ( tbar != NULL ) {
if ( Qt::Horizontal==tbar->orientation() ) {
@@ -3400,15 +3400,15 @@ void LipstikStyle::drawComplexControl(ComplexControl control,
if (controls & SC_ToolButton) {
// If we're pressed, on, or raised...
if (bflags & (Style_Down | Style_On | Style_Raised) || widget==hoverWidget) {
- if ( widget == hoverWidget && tb->parentWidget()->inherits( "KTabWidget" )) {
+ if ( widget == hoverWidget && tb->tqparentWidget()->inherits( "KTabWidget" )) {
renderButton(p, r, cg, false, true, false, true, false );
} else {
- drawPrimitive(PE_ButtonTool, p, button, cg, bflags, opt);
+ tqdrawPrimitive(PE_ButtonTool, p, button, cg, bflags, opt);
}
- } else if (tb->parentWidget() &&
- tb->parentWidget()->backgroundPixmap() &&
- !tb->parentWidget()->backgroundPixmap()->isNull()) {
- QPixmap pixmap = *(tb->parentWidget()->backgroundPixmap());
+ } else if (tb->tqparentWidget() &&
+ tb->tqparentWidget()->backgroundPixmap() &&
+ !tb->tqparentWidget()->backgroundPixmap()->isNull()) {
+ TQPixmap pixmap = *(tb->tqparentWidget()->backgroundPixmap());
p->drawTiledPixmap( r, pixmap, tb->pos() );
}
}
@@ -3416,15 +3416,15 @@ void LipstikStyle::drawComplexControl(ComplexControl control,
// Draw a toolbutton menu indicator if required
if (controls & SC_ToolButtonMenu) {
if (mflags & (Style_Down | Style_On | Style_Raised)) {
- drawPrimitive(PE_ButtonDropDown, p, menuarea, cg, mflags, opt);
+ tqdrawPrimitive(PE_ButtonDropDown, p, menuarea, cg, mflags, opt);
}
- drawPrimitive(PE_ArrowDown, p, menuarea, cg, mflags, opt);
+ tqdrawPrimitive(PE_ArrowDown, p, menuarea, cg, mflags, opt);
}
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);
+ tqdrawPrimitive(PE_FocusRect, p, fr, cg);
}
// Set the color for the ToolButton menu indicator
@@ -3439,7 +3439,7 @@ void LipstikStyle::drawComplexControl(ComplexControl control,
case CC_SpinWidget: {
static const unsigned int handleWidth = 15;
- const QSpinWidget *sw = dynamic_cast<const QSpinWidget *>(widget);
+ const TQSpinWidget *sw = dynamic_cast<const TQSpinWidget *>(widget);
SFlags sflags = flags;
PrimitiveElement pe;
@@ -3447,16 +3447,16 @@ void LipstikStyle::drawComplexControl(ComplexControl control,
if (sw)
hasFocus = sw->hasFocus();
- const QColor buttonColor = enabled?cg.button():cg.background();
- const QColor inputColor = enabled?cg.base():cg.background();
+ const TQColor buttonColor = enabled?cg.button():cg.background();
+ const TQColor inputColor = enabled?cg.base():cg.background();
// contour
const bool heightDividable = ((r.height()%2) == 0);
if (_inputFocusHighlight && hasFocus && enabled)
{
- QRect editField = querySubControlMetrics(control, widget, SC_SpinWidgetEditField);
- QRect editFrame = r;
- QRect buttonFrame = r;
+ TQRect editField = querySubControlMetrics(control, widget, SC_SpinWidgetEditField);
+ TQRect editFrame = r;
+ TQRect buttonFrame = r;
uint editFlags = 0;
uint buttonFlags = 0;
@@ -3498,14 +3498,14 @@ void LipstikStyle::drawComplexControl(ComplexControl control,
reverseLayout?r.left()+handleWidth:r.right()-1, r.top()+1+(r.height()-2)/2-1);
// surface
- QRect upRect = QRect(reverseLayout?r.left()+1:r.right()-handleWidth, r.top()+1,
+ TQRect upRect = TQRect(reverseLayout?r.left()+1:r.right()-handleWidth, r.top()+1,
handleWidth, (r.height()-2)/2);
- QRect downRect = QRect(reverseLayout?r.left()+1:r.right()-handleWidth,
+ TQRect downRect = TQRect(reverseLayout?r.left()+1:r.right()-handleWidth,
heightDividable?r.top()+1+((r.height()-2)/2):r.top()+1+((r.height()-2)/2)+1,
handleWidth, ((r.height()-2)/2) );
if(heightDividable) {
- upRect = QRect(upRect.left(), upRect.top(), upRect.width(), upRect.height()-1 );
- downRect = QRect(downRect.left(), downRect.top()+1, downRect.width(), downRect.height()-1 );
+ upRect = TQRect(upRect.left(), upRect.top(), upRect.width(), upRect.height()-1 );
+ downRect = TQRect(downRect.left(), downRect.top()+1, downRect.width(), downRect.height()-1 );
}
uint surfaceFlags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom|Is_Horizontal;
@@ -3544,12 +3544,12 @@ void LipstikStyle::drawComplexControl(ComplexControl control,
sflags |= Style_Sunken;
} else
sflags |= Style_Raised;
- if (sw->buttonSymbols() == QSpinWidget::PlusMinus)
+ if (sw->buttonSymbols() == TQSpinWidget::PlusMinus)
pe = PE_SpinWidgetPlus;
else
pe = PE_SpinWidgetUp;
p->setPen(cg.foreground());
- drawPrimitive(pe, p, upRect, cg, sflags);
+ tqdrawPrimitive(pe, p, upRect, cg, sflags);
sflags = Style_Default | Style_Enabled;
if (active == SC_SpinWidgetDown) {
@@ -3557,15 +3557,15 @@ void LipstikStyle::drawComplexControl(ComplexControl control,
sflags |= Style_Sunken;
} else
sflags |= Style_Raised;
- if (sw->buttonSymbols() == QSpinWidget::PlusMinus)
+ if (sw->buttonSymbols() == TQSpinWidget::PlusMinus)
pe = PE_SpinWidgetMinus;
else
pe = PE_SpinWidgetDown;
p->setPen(cg.foreground());
- drawPrimitive(pe, p, downRect, cg, sflags);
+ tqdrawPrimitive(pe, p, downRect, cg, sflags);
// thin frame around the input area
- const QRect Rcontent = QRect(reverseLayout?r.left()+1+handleWidth+1:r.left()+1, r.top()+1,
+ const TQRect Rcontent = TQRect(reverseLayout?r.left()+1+handleWidth+1:r.left()+1, r.top()+1,
r.width()-1-2-handleWidth, r.height()-2);
if (_inputFocusHighlight && hasFocus && enabled)
{
@@ -3595,7 +3595,7 @@ void LipstikStyle::drawComplexControl(ComplexControl control,
}
default:
- KStyle::drawComplexControl(control, p, widget,
+ KStyle::tqdrawComplexControl(control, p, widget,
r, cg, flags, controls,
active, opt);
break;
@@ -3603,7 +3603,7 @@ void LipstikStyle::drawComplexControl(ComplexControl control,
}
-QRect LipstikStyle::subRect(SubRect r, const QWidget *widget) const
+TQRect LipstikStyle::subRect(SubRect r, const TQWidget *widget) const
{
switch (r) {
case SR_ComboBoxFocusRect: {
@@ -3613,12 +3613,12 @@ QRect LipstikStyle::subRect(SubRect r, const QWidget *widget) const
// Don't use KStyles progressbar subrect
// TODO:
case SR_ProgressBarGroove: {
- return QRect(widget->rect());
+ return TQRect(widget->rect());
}
case SR_ProgressBarContents:
case SR_ProgressBarLabel: {
- QRect rw = widget->rect();
- return QRect(rw.left()+2, rw.top()+2, rw.width()-4, rw.height()-4 );
+ TQRect rw = widget->rect();
+ return TQRect(rw.left()+2, rw.top()+2, rw.width()-4, rw.height()-4 );
}
default: {
@@ -3627,22 +3627,22 @@ QRect LipstikStyle::subRect(SubRect r, const QWidget *widget) const
}
}
-QRect LipstikStyle::querySubControlMetrics(ComplexControl control,
- const QWidget *widget,
+TQRect LipstikStyle::querySubControlMetrics(ComplexControl control,
+ const TQWidget *widget,
SubControl subcontrol,
- const QStyleOption &opt) const
+ const TQStyleOption &opt) const
{
if (!widget) {
- return QRect();
+ return TQRect();
}
- QRect r(widget->rect());
+ TQRect r(widget->rect());
switch (control) {
case CC_ComboBox: {
switch (subcontrol) {
case SC_ComboBoxEditField: {
// TODO: is the handler width in pixelmetric?
- return QRect(r.left()+2, r.top()+2, r.width()-4-15-1, r.height()-4);
+ return TQRect(r.left()+2, r.top()+2, r.width()-4-15-1, r.height()-4);
}
default: {
return KStyle::querySubControlMetrics(control, widget, subcontrol, opt);
@@ -3655,11 +3655,11 @@ QRect LipstikStyle::querySubControlMetrics(ComplexControl control,
const bool heightDividable = ((r.height()%2) == 0);
- QSize bs;
+ TQSize bs;
if(heightDividable) {
- bs.setHeight(QMAX(8, (r.height()-2)/2));
+ bs.setHeight(TQMAX(8, (r.height()-2)/2));
} else {
- bs.setHeight(QMAX(8, (r.height()-2-1)/2));
+ bs.setHeight(TQMAX(8, (r.height()-2-1)/2));
}
bs.setWidth(15);
@@ -3667,26 +3667,26 @@ QRect LipstikStyle::querySubControlMetrics(ComplexControl control,
switch (subcontrol) {
case SC_SpinWidgetUp: {
- return QRect(buttonsLeft, r.top()+1, bs.width(), bs.height() );
+ return TQRect(buttonsLeft, r.top()+1, bs.width(), bs.height() );
}
case SC_SpinWidgetDown: {
if(heightDividable) {
- return QRect(buttonsLeft, r.top()+1+bs.height(),
+ return TQRect(buttonsLeft, r.top()+1+bs.height(),
bs.width(), r.height()-(bs.height()+2) );
} else {
- return QRect(buttonsLeft, r.top()+1+bs.height()+1,
+ return TQRect(buttonsLeft, r.top()+1+bs.height()+1,
bs.width(), r.height()-(bs.height()+2+1) );
}
}
case SC_SpinWidgetFrame: {
- return QRect(r.left(), r.top(), r.width(), r.height() );
+ return TQRect(r.left(), r.top(), r.width(), r.height() );
}
case SC_SpinWidgetEditField: {
- return QRect(r.left()+fw, r.top()+fw,
+ return TQRect(r.left()+fw, r.top()+fw,
r.width()-(bs.width()+1+2*fw), r.height()-2*fw);
}
case SC_SpinWidgetButtonField: {
- return QRect(buttonsLeft, r.top()+1, bs.width(), r.height()-2);
+ return TQRect(buttonsLeft, r.top()+1, bs.width(), r.height()-2);
}
default: {
return KStyle::querySubControlMetrics(control, widget, subcontrol, opt);
@@ -3700,15 +3700,15 @@ QRect LipstikStyle::querySubControlMetrics(ComplexControl control,
}
}
-int LipstikStyle::pixelMetric(PixelMetric m, const QWidget *widget) const
+int LipstikStyle::tqpixelMetric(PixelMetric m, const TQWidget *widget) const
{
switch(m) {
// TABS
// ----
case PM_TabBarTabVSpace: {
- const QTabBar * tb = (const QTabBar *) widget;
- if (tb->shape() == QTabBar::RoundedAbove ||
- tb->shape() == QTabBar::RoundedBelow)
+ const TQTabBar * tb = (const TQTabBar *) widget;
+ if (tb->tqshape() == TQTabBar::RoundedAbove ||
+ tb->tqshape() == TQTabBar::RoundedBelow)
return 12;
else
return 4;
@@ -3792,7 +3792,7 @@ int LipstikStyle::pixelMetric(PixelMetric m, const QWidget *widget) const
return 1;
case PM_DefaultFrameWidth: {
- if(widget && ::qt_cast<QPopupMenu*>(widget))
+ if(widget && ::tqqt_cast<TQPopupMenu*>(widget))
return 1;
else
return 2;
@@ -3812,30 +3812,30 @@ int LipstikStyle::pixelMetric(PixelMetric m, const QWidget *widget) const
}
default:
- return KStyle::pixelMetric(m, widget);
+ return KStyle::tqpixelMetric(m, widget);
}
}
-QSize LipstikStyle::sizeFromContents(ContentsType t,
- const QWidget *widget,
- const QSize &s,
- const QStyleOption &opt) const
+TQSize LipstikStyle::tqsizeFromContents(ContentsType t,
+ const TQWidget *widget,
+ const TQSize &s,
+ const TQStyleOption &opt) const
{
switch (t) {
case CT_PopupMenuItem: {
if (!widget || opt.isDefault())
return s;
- const QPopupMenu *popup = dynamic_cast<const QPopupMenu *>(widget);
- QMenuItem *mi = opt.menuItem();
+ const TQPopupMenu *popup = dynamic_cast<const TQPopupMenu *>(widget);
+ TQMenuItem *mi = opt.menuItem();
int maxpmw = opt.maxIconWidth();
int w = s.width(), h = s.height() + _menuSpacing;
bool checkable = popup->isCheckable();
if (mi->custom()) {
- w = mi->custom()->sizeHint().width();
- h = mi->custom()->sizeHint().height();
+ w = mi->custom()->tqsizeHint().width();
+ h = mi->custom()->tqsizeHint().height();
if (!mi->custom()->fullSpan() )
h += 4;
} else if (mi->widget()) {
@@ -3845,18 +3845,18 @@ QSize LipstikStyle::sizeFromContents(ContentsType t,
h = 2;
} else {
if (mi->pixmap()) {
- h = QMAX(h, mi->pixmap()->height() + 2);
+ h = TQMAX(h, mi->pixmap()->height() + 2);
} else {
- h = QMAX(h, 16 + 2);
- h = QMAX(h, popup->fontMetrics().height() + 4 );
+ h = TQMAX(h, 16 + 2);
+ h = TQMAX(h, popup->fontMetrics().height() + 4 );
}
if (mi->iconSet()) {
- h = QMAX(h, mi->iconSet()->pixmap(QIconSet::Small, QIconSet::Normal).height() + 2);
+ h = TQMAX(h, mi->iconSet()->pixmap(TQIconSet::Small, TQIconSet::Normal).height() + 2);
}
}
- if (!mi->text().isNull() && (mi->text().find('\t') >= 0)) {
+ if (!mi->text().isNull() && (mi->text().tqfind('\t') >= 0)) {
w += itemHMargin + itemFrame*2 + 7;
} else if (mi->popup()) {
w += 2 * arrowHMargin;
@@ -3874,50 +3874,50 @@ QSize LipstikStyle::sizeFromContents(ContentsType t,
w += rightBorder;
- return QSize(w, h);
+ return TQSize(w, h);
}
case CT_PushButton:
{
- const QPushButton* btn = static_cast<const QPushButton*>(widget);
+ const TQPushButton* btn = static_cast<const TQPushButton*>(widget);
- int w = s.width() + 2 * pixelMetric(PM_ButtonMargin, widget);
- int h = s.height() + 2 * pixelMetric(PM_ButtonMargin, widget);
- if ( btn->text().isEmpty() && s.width() < 32 ) return QSize(w, h);
+ int w = s.width() + 2 * tqpixelMetric(PM_ButtonMargin, widget);
+ int h = s.height() + 2 * tqpixelMetric(PM_ButtonMargin, widget);
+ if ( btn->text().isEmpty() && s.width() < 32 ) return TQSize(w, h);
- return QSize( w+25, h+5 );
+ return TQSize( w+25, h+5 );
}
case CT_ToolButton:
{
- if(widget->parent() && ::qt_cast<QToolBar*>(widget->parent()) )
- return QSize( s.width()+2*4+_toolBarSpacing, s.height()+2*4 );
+ if(widget->tqparent() && ::tqqt_cast<TQToolBar*>(widget->tqparent()) )
+ return TQSize( s.width()+2*4+_toolBarSpacing, s.height()+2*4 );
else
- return KStyle::sizeFromContents (t, widget, s, opt);
+ return KStyle::tqsizeFromContents (t, widget, s, opt);
}
default:
- return KStyle::sizeFromContents (t, widget, s, opt);
+ return KStyle::tqsizeFromContents (t, widget, s, opt);
}
- return KStyle::sizeFromContents (t, widget, s, opt);
+ return KStyle::tqsizeFromContents (t, widget, s, opt);
}
-int LipstikStyle::styleHint( StyleHint stylehint,
- const QWidget *widget,
- const QStyleOption &option,
- QStyleHintReturn* returnData ) const
+int LipstikStyle::tqstyleHint( StyleHint stylehint,
+ const TQWidget *widget,
+ const TQStyleOption &option,
+ TQStyleHintReturn* returnData ) const
{
switch (stylehint) {
case SH_PopupMenu_SubMenuPopupDelay:
return 96; // Motif-like delay...
default:
- return KStyle::styleHint(stylehint, widget, option, returnData);
+ return KStyle::tqstyleHint(stylehint, widget, option, returnData);
}
}
-bool LipstikStyle::eventFilter(QObject *obj, QEvent *ev)
+bool LipstikStyle::eventFilter(TQObject *obj, TQEvent *ev)
{
if (KStyle::eventFilter(obj, ev) )
return true;
@@ -3925,109 +3925,109 @@ bool LipstikStyle::eventFilter(QObject *obj, QEvent *ev)
if (!obj->isWidgetType() ) return false;
// focus highlight
- if ( ::qt_cast<QLineEdit*>(obj) ) {
- QWidget* widget = static_cast<QWidget*>(obj);
+ if ( ::tqqt_cast<TQLineEdit*>(obj) ) {
+ TQWidget* widget = TQT_TQWIDGET(obj);
- if ( ::qt_cast<QSpinWidget*>(widget->parentWidget()) )
+ if ( ::tqqt_cast<TQSpinWidget*>(widget->tqparentWidget()) )
{
- QWidget* spinbox = widget->parentWidget();
- if ((ev->type() == QEvent::FocusIn) || (ev->type() == QEvent::FocusOut))
+ TQWidget* spinbox = widget->tqparentWidget();
+ if ((ev->type() == TQEvent::FocusIn) || (ev->type() == TQEvent::FocusOut))
{
- spinbox->repaint(false);
+ spinbox->tqrepaint(false);
}
return false;
}
- if ((ev->type() == QEvent::FocusIn) || (ev->type() == QEvent::FocusOut))
+ if ((ev->type() == TQEvent::FocusIn) || (ev->type() == TQEvent::FocusOut))
{
- widget->repaint(false);
+ widget->tqrepaint(false);
}
return false;
}
//Hover highlight... use qt_cast to check if the widget inheits one of the classes.
- if ( ::qt_cast<QPushButton*>(obj) || ::qt_cast<QComboBox*>(obj) ||
- ::qt_cast<QSpinWidget*>(obj) || ::qt_cast<QCheckBox*>(obj) ||
- ::qt_cast<QRadioButton*>(obj) || ::qt_cast<QToolButton*>(obj) ||
- ::qt_cast<QSlider*>(obj) || ::qt_cast<QScrollBar*>(obj) ||
- obj->inherits("QDockWindowHandle") || obj->inherits("QSplitterHandle") )
+ if ( ::tqqt_cast<TQPushButton*>(obj) || ::tqqt_cast<TQComboBox*>(obj) ||
+ ::tqqt_cast<TQSpinWidget*>(obj) || ::tqqt_cast<TQCheckBox*>(obj) ||
+ ::tqqt_cast<TQRadioButton*>(obj) || ::tqqt_cast<TQToolButton*>(obj) ||
+ ::tqqt_cast<TQSlider*>(obj) || ::tqqt_cast<TQScrollBar*>(obj) ||
+ obj->inherits(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) || obj->inherits(TQSPLITTERHANDLE_OBJECT_NAME_STRING) )
{
- if ((ev->type() == QEvent::Enter) && static_cast<QWidget*>(obj)->isEnabled())
+ if ((ev->type() == TQEvent::Enter) && TQT_TQWIDGET(obj)->isEnabled())
{
- QWidget* button = static_cast<QWidget*>(obj);
+ TQWidget* button = TQT_TQWIDGET(obj);
hoverWidget = button;
- button->repaint(false);
+ button->tqrepaint(false);
}
- else if ((ev->type() == QEvent::Leave) && (obj == hoverWidget) )
+ else if ((ev->type() == TQEvent::Leave) && (TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(hoverWidget)) )
{
- QWidget* button = static_cast<QWidget*>(obj);
+ TQWidget* button = TQT_TQWIDGET(obj);
hoverWidget = 0;
- button->repaint(false);
+ button->tqrepaint(false);
}
return false;
}
- if ( ::qt_cast<QTabBar*>(obj) ) {
- if ((ev->type() == QEvent::Enter) && static_cast<QWidget*>(obj)->isEnabled())
+ if ( ::tqqt_cast<TQTabBar*>(obj) ) {
+ if ((ev->type() == TQEvent::Enter) && TQT_TQWIDGET(obj)->isEnabled())
{
- QWidget* tabbar = static_cast<QWidget*>(obj);
+ TQWidget* tabbar = TQT_TQWIDGET(obj);
hoverWidget = tabbar;
hoverTab = 0;
- tabbar->repaint(false);
+ tabbar->tqrepaint(false);
}
- else if (ev->type() == QEvent::MouseMove)
+ else if (ev->type() == TQEvent::MouseMove)
{
- QTabBar *tabbar = dynamic_cast<QTabBar*>(obj);
- QMouseEvent *me = dynamic_cast<QMouseEvent*>(ev);
+ TQTabBar *tabbar = dynamic_cast<TQTabBar*>(obj);
+ TQMouseEvent *me = dynamic_cast<TQMouseEvent*>(ev);
if (tabbar && me) {
- // avoid unnecessary repaints (which otherwise would occour on every
+ // avoid unnecessary tqrepaints (which otherwise would occour on every
// MouseMove event causing high cpu load).
- bool repaint = true;
+ bool tqrepaint = true;
- QTab *tab = tabbar->selectTab(me->pos() );
+ TQTab *tab = tabbar->selectTab(me->pos() );
if (hoverTab == tab)
- repaint = false;
+ tqrepaint = false;
hoverTab = tab;
- if (repaint)
- tabbar->repaint(false);
+ if (tqrepaint)
+ tabbar->tqrepaint(false);
}
}
- else if (ev->type() == QEvent::Leave)
+ else if (ev->type() == TQEvent::Leave)
{
- QWidget* tabbar = static_cast<QWidget*>(obj);
+ TQWidget* tabbar = TQT_TQWIDGET(obj);
hoverWidget = 0;
hoverTab = 0;
- tabbar->repaint(false);
+ tabbar->tqrepaint(false);
}
return false;
}
// Track show events for progress bars
- if ( _animateProgressBar && ::qt_cast<QProgressBar*>(obj) )
+ if ( _animateProgressBar && ::tqqt_cast<TQProgressBar*>(obj) )
{
- if ((ev->type() == QEvent::Show) && !animationTimer->isActive())
+ if ((ev->type() == TQEvent::Show) && !animationTimer->isActive())
{
animationTimer->start( 50, false );
}
}
if ( !qstrcmp(obj->name(), "kde toolbar widget") )
{
- QWidget* lb = static_cast<QWidget*>(obj);
- if (lb->backgroundMode() == Qt::PaletteButton)
- lb->setBackgroundMode(Qt::PaletteBackground);
+ TQWidget* lb = TQT_TQWIDGET(obj);
+ if (lb->backgroundMode() == TQt::PaletteButton)
+ lb->setBackgroundMode(TQt::PaletteBackground);
lb->removeEventFilter(this);
}
return false;
}
-QColor LipstikStyle::getColor(const QColorGroup &cg, const ColorType t, const bool enabled)const
+TQColor LipstikStyle::getColor(const TQColorGroup &cg, const ColorType t, const bool enabled)const
{
return getColor(cg, t, enabled?IsEnabled:IsDisabled);
}
-QColor LipstikStyle::getColor(const QColorGroup &cg, const ColorType t, const WidgetState s)const
+TQColor LipstikStyle::getColor(const TQColorGroup &cg, const ColorType t, const WidgetState s)const
{
const bool enabled = (s != IsDisabled) &&
((s == IsEnabled) || (s == IsPressed) || (s == IsHighlighted));