summaryrefslogtreecommitdiffstats
path: root/kstyles/light/lightstyle-v3.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kstyles/light/lightstyle-v3.cpp')
-rw-r--r--kstyles/light/lightstyle-v3.cpp462
1 files changed, 231 insertions, 231 deletions
diff --git a/kstyles/light/lightstyle-v3.cpp b/kstyles/light/lightstyle-v3.cpp
index fc9966b63..49900c8f5 100644
--- a/kstyles/light/lightstyle-v3.cpp
+++ b/kstyles/light/lightstyle-v3.cpp
@@ -22,24 +22,24 @@
#include "lightstyle-v3.h"
-#include "qmenubar.h"
-#include "qapplication.h"
-#include "qcheckbox.h"
-#include "qpainter.h"
-#include "qpalette.h"
-#include "qframe.h"
-#include "qpushbutton.h"
-#include "qdrawutil.h"
-#include "qprogressbar.h"
-#include "qscrollbar.h"
-#include "qtabbar.h"
-#include "qguardedptr.h"
-#include "qlayout.h"
-#include "qlineedit.h"
-#include "qimage.h"
-#include "qcombobox.h"
-#include "qslider.h"
-#include "qstylefactory.h"
+#include "tqmenubar.h"
+#include "tqapplication.h"
+#include "tqcheckbox.h"
+#include "tqpainter.h"
+#include "tqpalette.h"
+#include "tqframe.h"
+#include "tqpushbutton.h"
+#include "tqdrawutil.h"
+#include "tqprogressbar.h"
+#include "tqscrollbar.h"
+#include "tqtabbar.h"
+#include "tqguardedptr.h"
+#include "tqlayout.h"
+#include "tqlineedit.h"
+#include "tqimage.h"
+#include "tqcombobox.h"
+#include "tqslider.h"
+#include "tqstylefactory.h"
// The Light Style, 3rd revision
@@ -47,9 +47,9 @@
LightStyleV3::LightStyleV3()
: KStyle(AllowMenuTransparency)
{
- basestyle = QStyleFactory::create( "Windows" );
+ basestyle = TQStyleFactory::create( "Windows" );
if ( ! basestyle )
- basestyle = QStyleFactory::create( QStyleFactory::keys().first() );
+ basestyle = TQStyleFactory::create( TQStyleFactory::keys().first() );
if ( ! basestyle )
qFatal( "LightStyle: couldn't find a basestyle!" );
}
@@ -59,7 +59,7 @@ LightStyleV3::~LightStyleV3()
delete basestyle;
}
-void LightStyleV3::polishPopupMenu( QPopupMenu * menu)
+void LightStyleV3::polishPopupMenu( TQPopupMenu * menu)
{
KStyle::polishPopupMenu(menu);
// empty to satisy pure virtual requirements
@@ -101,12 +101,12 @@ void LightStyleV3::polishPopupMenu( QPopupMenu * menu)
the etching and border )
F is the fill ( optional, not drawn by default )
*/
-static void drawLightEtch( QPainter *p,
- const QRect &rect,
- const QColor &color,
+static void drawLightEtch( TQPainter *p,
+ const TQRect &rect,
+ const TQColor &color,
bool sunken )
{
- QPointArray pts( 4 );
+ TQPointArray pts( 4 );
pts.setPoint( 0, rect.left(), rect.bottom() - 1);
pts.setPoint( 1, rect.left(), rect.top() );
@@ -123,20 +123,20 @@ static void drawLightEtch( QPainter *p,
p->drawLineSegments( pts );
}
-static void drawLightBevel( QPainter *p,
- const QRect &rect,
- const QColorGroup &cg,
- QStyle::SFlags flags,
+static void drawLightBevel( TQPainter *p,
+ const TQRect &rect,
+ const TQColorGroup &cg,
+ TQStyle::SFlags flags,
int linewidth,
bool etch = false, // light sunken bevel around border
bool border = true, // rectangle around bevel
- const QBrush *fill = 0 ) // contents fill
+ const TQBrush *fill = 0 ) // contents fill
{
- QRect br = rect;
- bool bevel = ( flags & ( QStyle::Style_Down | QStyle::Style_On |
- QStyle::Style_Sunken | QStyle::Style_Raised ) );
- bool sunken = (flags & (QStyle::Style_Down | QStyle::Style_On |
- QStyle::Style_Sunken));
+ TQRect br = rect;
+ bool bevel = ( flags & ( TQStyle::Style_Down | TQStyle::Style_On |
+ TQStyle::Style_Sunken | TQStyle::Style_Raised ) );
+ bool sunken = (flags & (TQStyle::Style_Down | TQStyle::Style_On |
+ TQStyle::Style_Sunken));
if ( etch && linewidth > 0 ) {
drawLightEtch( p, br, cg.background(), true );
@@ -161,7 +161,7 @@ static void drawLightBevel( QPainter *p,
br.rect( &x, &y, &w, &h );
// copied form qDrawShadePanel - just changed the highlight colors...
- QPointArray a( 4*linewidth );
+ TQPointArray a( 4*linewidth );
if ( sunken )
p->setPen( border ? cg.mid() : cg.dark() );
else
@@ -213,14 +213,14 @@ static void drawLightBevel( QPainter *p,
}
void LightStyleV3::drawPrimitive( PrimitiveElement pe,
- QPainter *p,
- const QRect &r,
- const QColorGroup &cg,
+ TQPainter *p,
+ const TQRect &r,
+ const TQColorGroup &cg,
SFlags flags,
- const QStyleOption &data ) const
+ const TQStyleOption &data ) const
{
- QRect br = r;
- const QBrush *fill = 0;
+ TQRect br = r;
+ const TQBrush *fill = 0;
switch (pe) {
case PE_HeaderSection:
@@ -249,7 +249,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
if ( ! br.isValid() )
break;
p->fillRect( br, cg.brush( ( flags & Style_Down ) ?
- QColorGroup::Midlight : QColorGroup::Button ) );
+ TQColorGroup::Midlight : TQColorGroup::Button ) );
// the taskbuttons in kicker seem to allow the style to set the pencolor
// here, which will be used to draw the text for focused window buttons...
@@ -259,17 +259,17 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
case PE_ButtonCommand:
{
- QRect br = r;
+ TQRect br = r;
- if (flags & QStyle::Style_Enabled) {
- if (flags & (QStyle::Style_Down |
- QStyle::Style_On |
- QStyle::Style_Sunken))
- fill = &cg.brush(QColorGroup::Midlight);
+ if (flags & TQStyle::Style_Enabled) {
+ if (flags & (TQStyle::Style_Down |
+ TQStyle::Style_On |
+ TQStyle::Style_Sunken))
+ fill = &cg.brush(TQColorGroup::Midlight);
else
- fill = &cg.brush(QColorGroup::Button);
+ fill = &cg.brush(TQColorGroup::Button);
} else
- fill = &cg.brush(QColorGroup::Background);
+ fill = &cg.brush(TQColorGroup::Background);
bool etch = true;
if ( flags & Style_ButtonDefault ) {
@@ -284,40 +284,40 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
case PE_ButtonBevel:
case PE_ButtonTool:
- if (flags & QStyle::Style_Enabled) {
- if (flags & (QStyle::Style_Down |
- QStyle::Style_On |
- QStyle::Style_Sunken))
- fill = &cg.brush(QColorGroup::Midlight);
+ if (flags & TQStyle::Style_Enabled) {
+ if (flags & (TQStyle::Style_Down |
+ TQStyle::Style_On |
+ TQStyle::Style_Sunken))
+ fill = &cg.brush(TQColorGroup::Midlight);
else
- fill = &cg.brush(QColorGroup::Button);
+ fill = &cg.brush(TQColorGroup::Button);
} else
- fill = &cg.brush(QColorGroup::Background);
+ fill = &cg.brush(TQColorGroup::Background);
drawLightBevel( p, r, cg, flags, pixelMetric( PM_DefaultFrameWidth ),
false, true, fill );
break;
case PE_ButtonDropDown:
{
- QBrush thefill;
+ TQBrush thefill;
bool sunken =
- (flags & (QStyle::Style_Down | QStyle::Style_On | QStyle::Style_Sunken));
+ (flags & (TQStyle::Style_Down | TQStyle::Style_On | TQStyle::Style_Sunken));
- if (flags & QStyle::Style_Enabled) {
+ if (flags & TQStyle::Style_Enabled) {
if (sunken)
- thefill = cg.brush(QColorGroup::Midlight);
+ thefill = cg.brush(TQColorGroup::Midlight);
else
- thefill = cg.brush(QColorGroup::Button);
+ thefill = cg.brush(TQColorGroup::Button);
} else
- thefill = cg.brush(QColorGroup::Background);
+ thefill = cg.brush(TQColorGroup::Background);
p->setPen( cg.dark() );
p->drawLine(r.topLeft(), r.topRight());
p->drawLine(r.topRight(), r.bottomRight());
p->drawLine(r.bottomRight(), r.bottomLeft());
- if (flags & (QStyle::Style_Down | QStyle::Style_On |
- QStyle::Style_Sunken | QStyle::Style_Raised)) {
+ if (flags & (TQStyle::Style_Down | TQStyle::Style_On |
+ TQStyle::Style_Sunken | TQStyle::Style_Raised)) {
// button bevel
if (sunken)
p->setPen(cg.mid());
@@ -350,13 +350,13 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
break;
case PE_Indicator:
- const QBrush *fill;
+ const TQBrush *fill;
if (! (flags & Style_Enabled))
- fill = &cg.brush(QColorGroup::Background);
+ fill = &cg.brush(TQColorGroup::Background);
else if (flags & Style_Down)
- fill = &cg.brush(QColorGroup::Mid);
+ fill = &cg.brush(TQColorGroup::Mid);
else
- fill = &cg.brush(QColorGroup::Base);
+ fill = &cg.brush(TQColorGroup::Base);
drawLightBevel( p, r, cg, flags | Style_Sunken, 2, true, true, fill );
p->setPen(cg.text());
@@ -386,7 +386,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
case PE_ExclusiveIndicator:
{
- QRect br = r, // bevel rect
+ TQRect br = r, // bevel rect
lr = r, // outline rect
cr = r, // contents rect
ir = r; // indicator rect
@@ -394,7 +394,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
cr.addCoords( 2, 2, -2, -2 );
ir.addCoords( 3, 3, -3, -3 );
- p->fillRect( r, cg.brush( QColorGroup::Background ) );
+ p->fillRect( r, cg.brush( TQColorGroup::Background ) );
p->setPen( flags & Style_Down ? cg.mid() :
( flags & Style_Enabled ? cg.base() : cg.background() ) );
@@ -422,12 +422,12 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
case PE_DockWindowHandle:
{
- QString title;
+ TQString title;
bool drawTitle = false;
- if ( p && p->device()->devType() == QInternal::Widget ) {
- QWidget *w = (QWidget *) p->device();
- QWidget *p = w->parentWidget();
- if (p->inherits("QDockWindow") && ! p->inherits("QToolBar")) {
+ if ( p && p->device()->devType() == TQInternal::Widget ) {
+ TQWidget *w = (TQWidget *) p->device();
+ TQWidget *p = w->parentWidget();
+ if (p->inherits("TQDockWindow") && ! p->inherits("TQToolBar")) {
drawTitle = true;
title = p->caption();
}
@@ -436,15 +436,15 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
flags |= Style_Raised;
if (flags & Style_Horizontal) {
if (drawTitle) {
- QPixmap pm(r.height(), r.width());
- QPainter p2(&pm);
+ TQPixmap pm(r.height(), r.width());
+ TQPainter p2(&pm);
p2.fillRect(0, 0, pm.width(), pm.height(),
- cg.brush(QColorGroup::Highlight));
+ cg.brush(TQColorGroup::Highlight));
p2.setPen(cg.highlightedText());
p2.drawText(0, 0, pm.width(), pm.height(), AlignCenter, title);
p2.end();
- QWMatrix m;
+ TQWMatrix m;
m.rotate(270.0);
pm = pm.xForm(m);
p->drawPixmap(r.x(), r.y(), pm);
@@ -460,7 +460,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
}
} else {
if (drawTitle) {
- p->fillRect(r, cg.brush(QColorGroup::Highlight));
+ p->fillRect(r, cg.brush(TQColorGroup::Highlight));
p->setPen(cg.highlightedText());
p->drawText(r, AlignCenter, title);
} else {
@@ -505,7 +505,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
case PE_DockWindowResizeHandle:
{
- QRect br = r;
+ TQRect br = r;
p->setPen( cg.shadow() );
p->drawRect( br );
@@ -525,7 +525,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
if ( ! br.isValid() )
break;
- p->fillRect( br, cg.brush( QColorGroup::Button ) );
+ p->fillRect( br, cg.brush( TQColorGroup::Button ) );
break;
}
@@ -540,7 +540,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
case PE_PanelTabWidget:
case PE_WindowFrame:
{
- QRect br = r;
+ TQRect br = r;
int cover = 0;
int reallw = ( data.isDefault() ?
@@ -553,7 +553,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
br.addCoords( 1, 1, -1, -1 );
while ( cover-- > 0 ) {
- QPointArray pts( 8 );
+ TQPointArray pts( 8 );
pts.setPoint( 0, br.left(), br.bottom() - 1);
pts.setPoint( 1, br.left(), br.top() );
pts.setPoint( 2, br.left() + 1, br.top() );
@@ -574,19 +574,19 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
drawLightBevel( p, r, cg, flags, ( data.isDefault() ?
pixelMetric(PM_DefaultFrameWidth) :
data.lineWidth() ), false, false,
- &cg.brush( QColorGroup::Button ) );
+ &cg.brush( TQColorGroup::Button ) );
break;
case PE_PanelMenuBar:
drawLightBevel( p, r, cg, flags, ( data.isDefault() ?
pixelMetric(PM_MenuBarFrameWidth) :
data.lineWidth() ), false, false,
- &cg.brush( QColorGroup::Button ) );
+ &cg.brush( TQColorGroup::Button ) );
break;
case PE_ScrollBarSubLine:
{
- QRect br = r;
+ TQRect br = r;
PrimitiveElement pe;
p->setPen( cg.background() );
@@ -608,8 +608,8 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
if ( ! br.isValid() )
break;
p->fillRect( br, cg.brush( ( flags & Style_Down ) ?
- QColorGroup::Midlight :
- QColorGroup::Button ) );
+ TQColorGroup::Midlight :
+ TQColorGroup::Button ) );
br.addCoords( 2, 2, -2, -2 );
if ( ! br.isValid() )
@@ -620,7 +620,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
case PE_ScrollBarAddLine:
{
- QRect br = r;
+ TQRect br = r;
PrimitiveElement pe;
p->setPen( cg.background() );
@@ -642,8 +642,8 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
if ( ! br.isValid() )
break;
p->fillRect( br, cg.brush( ( flags & Style_Down ) ?
- QColorGroup::Midlight :
- QColorGroup::Button ) );
+ TQColorGroup::Midlight :
+ TQColorGroup::Button ) );
br.addCoords( 2, 2, -2, -2 );
if ( ! br.isValid() )
@@ -654,7 +654,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
case PE_ScrollBarSubPage:
{
- QRect br = r;
+ TQRect br = r;
p->setPen( cg.background() );
if (flags & Style_Horizontal) {
@@ -673,14 +673,14 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
if ( ! br.isValid() )
break;
p->fillRect( br, cg.brush( ( flags & Style_Down ) ?
- QColorGroup::Midlight :
- QColorGroup::Button ) );
+ TQColorGroup::Midlight :
+ TQColorGroup::Button ) );
break;
}
case PE_ScrollBarAddPage:
{
- QRect br = r;
+ TQRect br = r;
p->setPen( cg.background() );
if (flags & Style_Horizontal) {
@@ -699,14 +699,14 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
if ( ! br.isValid() )
break;
p->fillRect( br, cg.brush( ( flags & Style_Down ) ?
- QColorGroup::Midlight :
- QColorGroup::Button ) );
+ TQColorGroup::Midlight :
+ TQColorGroup::Button ) );
break;
}
case PE_ScrollBarSlider:
{
- QRect br = r;
+ TQRect br = r;
p->setPen( cg.background() );
if (flags & Style_Horizontal) {
@@ -728,7 +728,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
p->drawLine( br.topRight(), br.bottomRight() );
br.addCoords( 1, 1, -1, -1 );
- p->fillRect( br, cg.brush( QColorGroup::Highlight ) );
+ p->fillRect( br, cg.brush( TQColorGroup::Highlight ) );
break;
}
@@ -754,7 +754,7 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
}
if (pe >= PE_ArrowUp && pe <= PE_ArrowLeft) {
- QPointArray a;
+ TQPointArray a;
switch ( pe ) {
case PE_ArrowUp:
@@ -798,26 +798,26 @@ void LightStyleV3::drawPrimitive( PrimitiveElement pe,
}
p->restore();
} else
- QCommonStyle::drawPrimitive(pe, p, r, cg, flags, data);
+ TQCommonStyle::drawPrimitive(pe, p, r, cg, flags, data);
break;
}
}
void LightStyleV3::drawControl( ControlElement control,
- QPainter *p,
- const QWidget *widget,
- const QRect &r,
- const QColorGroup &cg,
+ TQPainter *p,
+ const TQWidget *widget,
+ const TQRect &r,
+ const TQColorGroup &cg,
SFlags flags,
- const QStyleOption &data ) const
+ const TQStyleOption &data ) const
{
switch (control) {
case CE_TabBarTab:
{
- const QTabBar *tb = (const QTabBar *) widget;
- QRect br = r;
+ const TQTabBar *tb = (const TQTabBar *) widget;
+ TQRect br = r;
- if ( tb->shape() == QTabBar::RoundedAbove ) {
+ if ( tb->shape() == TQTabBar::RoundedAbove ) {
if ( ! ( flags & Style_Selected ) ) {
p->setPen( cg.background() );
p->drawLine( br.left(), br.bottom(),
@@ -846,13 +846,13 @@ void LightStyleV3::drawControl( ControlElement control,
if ( flags & Style_Selected )
{
- p->fillRect( br.right() - 3, br.top() + 1, 3, br.height() - 1, cg.brush(QColorGroup::Highlight));
+ p->fillRect( br.right() - 3, br.top() + 1, 3, br.height() - 1, cg.brush(TQColorGroup::Highlight));
br.addCoords( 1, 1, -4, 0 );
}
else
br.addCoords( 1, 1, -1, 0 );
p->fillRect( br, cg.background() );
- } else if ( tb->shape() == QTabBar::RoundedBelow ) {
+ } else if ( tb->shape() == TQTabBar::RoundedBelow ) {
if ( ! ( flags & Style_Selected ) ) {
p->setPen( cg.background() );
p->drawLine( br.left(), br.top(),
@@ -884,7 +884,7 @@ void LightStyleV3::drawControl( ControlElement control,
if ( flags & Style_Selected )
{
- p->fillRect( br.right() - 2, br.top(), 3, br.height(), cg.brush(QColorGroup::Highlight));
+ p->fillRect( br.right() - 2, br.top(), 3, br.height(), cg.brush(TQColorGroup::Highlight));
br.addCoords( 1, 0, -3, -1 );
}
else
@@ -892,7 +892,7 @@ void LightStyleV3::drawControl( ControlElement control,
p->fillRect( br, cg.background() );
} else
- QCommonStyle::drawControl( control, p, widget, r, cg, flags, data );
+ TQCommonStyle::drawControl( control, p, widget, r, cg, flags, data );
break;
}
@@ -901,8 +901,8 @@ void LightStyleV3::drawControl( ControlElement control,
if (! widget || data.isDefault())
break;
- const QPopupMenu *popupmenu = (const QPopupMenu *) widget;
- QMenuItem *mi = data.menuItem();
+ const TQPopupMenu *popupmenu = (const TQPopupMenu *) widget;
+ TQMenuItem *mi = data.menuItem();
int tab = data.tabWidth();
int maxpmw = data.maxIconWidth();
@@ -910,7 +910,7 @@ void LightStyleV3::drawControl( ControlElement control,
if ( widget->erasePixmap() && !widget->erasePixmap()->isNull() )
p->drawPixmap( r.topLeft(), *widget->erasePixmap(), r );
else
- p->fillRect(r, cg.brush(QColorGroup::Button));
+ p->fillRect(r, cg.brush(TQColorGroup::Button));
p->setPen( cg.mid() );
p->drawLine(r.left() + 12, r.top() + 1,
r.right() - 12, r.top() + 1);
@@ -922,18 +922,18 @@ void LightStyleV3::drawControl( ControlElement control,
if (flags & Style_Active)
qDrawShadePanel(p, r, cg, true, 1,
- &cg.brush(QColorGroup::Midlight));
+ &cg.brush(TQColorGroup::Midlight));
else if ( widget->erasePixmap() && !widget->erasePixmap()->isNull() )
p->drawPixmap( r.topLeft(), *widget->erasePixmap(), r );
else
- p->fillRect(r, cg.brush(QColorGroup::Button));
+ p->fillRect(r, cg.brush(TQColorGroup::Button));
if ( !mi )
break;
maxpmw = QMAX(maxpmw, 16);
- QRect cr, ir, tr, sr;
+ TQRect cr, ir, tr, sr;
// check column
cr.setRect(r.left(), r.top(), maxpmw, r.height());
// submenu indicator column
@@ -943,7 +943,7 @@ void LightStyleV3::drawControl( ControlElement control,
// item column
ir.setCoords(cr.right() + 4, r.top(), tr.right() - 4, r.bottom());
- bool reverse = QApplication::reverseLayout();
+ bool reverse = TQApplication::reverseLayout();
if ( reverse ) {
cr = visualRect( cr, r );
sr = visualRect( sr, r );
@@ -954,21 +954,21 @@ void LightStyleV3::drawControl( ControlElement control,
if (mi->isChecked() &&
! (flags & Style_Active) &
(flags & Style_Enabled))
- qDrawShadePanel(p, cr, cg, true, 1, &cg.brush(QColorGroup::Midlight));
+ qDrawShadePanel(p, cr, cg, true, 1, &cg.brush(TQColorGroup::Midlight));
if (mi->iconSet()) {
- QIconSet::Mode mode =
- (flags & Style_Enabled) ? QIconSet::Normal : QIconSet::Disabled;
+ TQIconSet::Mode mode =
+ (flags & Style_Enabled) ? TQIconSet::Normal : TQIconSet::Disabled;
if ((flags & Style_Active) && (flags & Style_Enabled))
- mode = QIconSet::Active;
- QPixmap pixmap;
+ mode = TQIconSet::Active;
+ TQPixmap pixmap;
if (popupmenu->isCheckable() && mi->isChecked())
pixmap =
- mi->iconSet()->pixmap( QIconSet::Small, mode, QIconSet::On );
+ mi->iconSet()->pixmap( TQIconSet::Small, mode, TQIconSet::On );
else
pixmap =
- mi->iconSet()->pixmap( QIconSet::Small, mode );
- QRect pmr(QPoint(0, 0), pixmap.size());
+ mi->iconSet()->pixmap( TQIconSet::Small, mode );
+ TQRect pmr(TQPoint(0, 0), pixmap.size());
pmr.moveCenter(cr.center());
p->setPen(cg.text());
p->drawPixmap(pmr.topLeft(), pixmap);
@@ -976,8 +976,8 @@ void LightStyleV3::drawControl( ControlElement control,
drawPrimitive(PE_CheckMark, p, cr, cg,
(flags & Style_Enabled) | Style_On);
- QColor textcolor;
- QColor embosscolor;
+ TQColor textcolor;
+ TQColor embosscolor;
if (flags & Style_Active) {
if (! (flags & Style_Enabled))
textcolor = cg.midlight().dark();
@@ -1008,7 +1008,7 @@ void LightStyleV3::drawControl( ControlElement control,
p->restore();
}
- QString text = mi->text();
+ TQString text = mi->text();
if (! text.isNull()) {
int t = text.find('\t');
@@ -1040,7 +1040,7 @@ void LightStyleV3::drawControl( ControlElement control,
p->drawText(ir, alignFlag, text, t);
} else if (mi->pixmap()) {
- QPixmap pixmap = *mi->pixmap();
+ TQPixmap pixmap = *mi->pixmap();
if (pixmap.depth() == 1)
p->setBackgroundMode(OpaqueMode);
p->drawPixmap(ir.x(), ir.y() + (ir.height() - pixmap.height()) / 2, pixmap);
@@ -1049,28 +1049,28 @@ void LightStyleV3::drawControl( ControlElement control,
}
if (mi->popup())
- drawPrimitive( (QApplication::reverseLayout() ? PE_ArrowLeft : PE_ArrowRight),
+ drawPrimitive( (TQApplication::reverseLayout() ? PE_ArrowLeft : PE_ArrowRight),
p, sr, cg, flags);
break;
}
case CE_MenuBarEmptyArea:
{
- p->fillRect(r, cg.brush(QColorGroup::Button));
+ p->fillRect(r, cg.brush(TQColorGroup::Button));
break;
}
case CE_MenuBarItem:
{
if ( flags & Style_Active )
- qDrawShadePanel(p, r, cg, true, 1, &cg.brush(QColorGroup::Midlight));
+ qDrawShadePanel(p, r, cg, true, 1, &cg.brush(TQColorGroup::Midlight));
else
- p->fillRect( r, cg.brush( QColorGroup::Button ) );
+ p->fillRect( r, cg.brush( TQColorGroup::Button ) );
if (data.isDefault())
break;
- QMenuItem *mi = data.menuItem();
+ TQMenuItem *mi = data.menuItem();
drawItem(p, r, AlignCenter | ShowPrefix | DontClip | SingleLine, cg,
flags & Style_Enabled, mi->pixmap(), mi->text(), -1,
&cg.buttonText());
@@ -1079,20 +1079,20 @@ void LightStyleV3::drawControl( ControlElement control,
case CE_ProgressBarGroove:
drawLightBevel( p, r, cg, Style_Sunken, pixelMetric( PM_DefaultFrameWidth ),
- true, true, &cg.brush( QColorGroup::Background ) );
+ true, true, &cg.brush( TQColorGroup::Background ) );
break;
default:
- QCommonStyle::drawControl(control, p, widget, r, cg, flags, data);
+ TQCommonStyle::drawControl(control, p, widget, r, cg, flags, data);
break;
}
}
void LightStyleV3::drawControlMask( ControlElement control,
- QPainter *p,
- const QWidget *widget,
- const QRect &r,
- const QStyleOption &data ) const
+ TQPainter *p,
+ const TQWidget *widget,
+ const TQRect &r,
+ const TQStyleOption &data ) const
{
switch (control) {
case CE_PushButton:
@@ -1100,19 +1100,19 @@ void LightStyleV3::drawControlMask( ControlElement control,
break;
default:
- QCommonStyle::drawControlMask(control, p, widget, r, data);
+ TQCommonStyle::drawControlMask(control, p, widget, r, data);
break;
}
}
-QRect LightStyleV3::subRect(SubRect subrect, const QWidget *widget) const
+TQRect LightStyleV3::subRect(SubRect subrect, const TQWidget *widget) const
{
- QRect rect;
+ TQRect rect;
switch (subrect) {
case SR_PushButtonFocusRect:
{
- rect = QCommonStyle::subRect( SR_PushButtonContents, widget );
+ rect = TQCommonStyle::subRect( SR_PushButtonContents, widget );
int bm = pixelMetric( PM_ButtonMargin, widget ), hbm = bm / 2;
rect.addCoords( hbm, hbm, -hbm, -hbm );
break;
@@ -1120,20 +1120,20 @@ QRect LightStyleV3::subRect(SubRect subrect, const QWidget *widget) const
case SR_ComboBoxFocusRect:
{
- rect = QCommonStyle::subRect( SR_ComboBoxFocusRect, widget );
+ rect = TQCommonStyle::subRect( SR_ComboBoxFocusRect, widget );
rect.addCoords( -1, -1, 1, 1 );
break;
}
case SR_CheckBoxFocusRect:
{
- const QCheckBox* cb = static_cast<const QCheckBox*>(widget);
+ const TQCheckBox* cb = static_cast<const TQCheckBox*>(widget);
//Only checkbox, no label
if (cb->text().isEmpty() && (cb->pixmap() == 0) )
{
- QRect bounding = cb->rect();
- QRect checkbox(bounding.x(), bounding.y() + (bounding.height() - 13)/2,
+ TQRect bounding = cb->rect();
+ TQRect checkbox(bounding.x(), bounding.y() + (bounding.height() - 13)/2,
13, 13);
return checkbox;
@@ -1143,7 +1143,7 @@ QRect LightStyleV3::subRect(SubRect subrect, const QWidget *widget) const
default:
- rect = QCommonStyle::subRect(subrect, widget);
+ rect = TQCommonStyle::subRect(subrect, widget);
break;
}
@@ -1151,30 +1151,30 @@ QRect LightStyleV3::subRect(SubRect subrect, const QWidget *widget) const
}
void LightStyleV3::drawComplexControl( ComplexControl control,
- QPainter* p,
- const QWidget* widget,
- const QRect& r,
- const QColorGroup& cg,
+ TQPainter* p,
+ const TQWidget* widget,
+ const TQRect& r,
+ const TQColorGroup& cg,
SFlags flags,
SCFlags controls,
SCFlags active,
- const QStyleOption &data ) const
+ const TQStyleOption &data ) const
{
switch (control) {
case CC_ComboBox:
{
- const QComboBox *combobox = (const QComboBox *) widget;
- QRect frame, arrow, field;
+ const TQComboBox *combobox = (const TQComboBox *) widget;
+ TQRect frame, arrow, field;
frame =
- QStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget,
+ TQStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget,
SC_ComboBoxFrame, data),
widget);
arrow =
- QStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget,
+ TQStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget,
SC_ComboBoxArrow, data),
widget);
field =
- QStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget,
+ TQStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget,
SC_ComboBoxEditField, data),
widget);
@@ -1184,7 +1184,7 @@ void LightStyleV3::drawComplexControl( ComplexControl control,
if ((controls & SC_ComboBoxArrow) && arrow.isValid()) {
drawLightEtch( p, arrow, cg.button(), ( active == SC_ComboBoxArrow ) );
arrow.addCoords( 1, 1, -1, -1 );
- p->fillRect( arrow, cg.brush( QColorGroup::Button ) );
+ p->fillRect( arrow, cg.brush( TQColorGroup::Button ) );
arrow.addCoords(3, 1, -1, -1);
drawPrimitive(PE_ArrowDown, p, arrow, cg, flags);
}
@@ -1192,20 +1192,20 @@ void LightStyleV3::drawComplexControl( ComplexControl control,
if ((controls & SC_ComboBoxEditField) && field.isValid()) {
if (flags & Style_HasFocus) {
if (! combobox->editable()) {
- QRect fr =
- QStyle::visualRect( subRect( SR_ComboBoxFocusRect, widget ),
+ TQRect fr =
+ TQStyle::visualRect( subRect( SR_ComboBoxFocusRect, widget ),
widget );
- p->fillRect( fr, cg.brush( QColorGroup::Highlight ) );
+ p->fillRect( fr, cg.brush( TQColorGroup::Highlight ) );
drawPrimitive( PE_FocusRect, p, fr, cg,
flags | Style_FocusAtBorder,
- QStyleOption(cg.highlight()));
+ TQStyleOption(cg.highlight()));
}
p->setPen(cg.highlightedText());
} else {
p->fillRect( field, ( ( flags & Style_Enabled ) ?
- cg.brush( QColorGroup::Base ) :
- cg.brush( QColorGroup::Background ) ) );
+ cg.brush( TQColorGroup::Base ) :
+ cg.brush( TQColorGroup::Background ) ) );
p->setPen( cg.text() );
}
}
@@ -1215,8 +1215,8 @@ void LightStyleV3::drawComplexControl( ComplexControl control,
case CC_SpinWidget:
{
- const QSpinWidget *spinwidget = (const QSpinWidget *) widget;
- QRect frame, up, down;
+ const TQSpinWidget *spinwidget = (const TQSpinWidget *) widget;
+ TQRect frame, up, down;
frame = querySubControlMetrics(CC_SpinWidget, widget,
SC_SpinWidgetFrame, data);
@@ -1228,14 +1228,14 @@ void LightStyleV3::drawComplexControl( ComplexControl control,
if ((controls & SC_SpinWidgetUp) && up.isValid()) {
PrimitiveElement pe = PE_SpinWidgetUp;
- if ( spinwidget->buttonSymbols() == QSpinWidget::PlusMinus )
+ if ( spinwidget->buttonSymbols() == TQSpinWidget::PlusMinus )
pe = PE_SpinWidgetPlus;
p->setPen( cg.background() );
p->drawLine( up.topLeft(), up.bottomLeft() );
up.addCoords( 1, 0, 0, 0 );
- p->fillRect( up, cg.brush( QColorGroup::Button ) );
+ p->fillRect( up, cg.brush( TQColorGroup::Button ) );
drawLightEtch( p, up, cg.button(), ( active == SC_SpinWidgetUp ) );
up.addCoords( 1, 0, 0, 0 );
@@ -1246,14 +1246,14 @@ void LightStyleV3::drawComplexControl( ComplexControl control,
if ((controls & SC_SpinWidgetDown) && down.isValid()) {
PrimitiveElement pe = PE_SpinWidgetDown;
- if ( spinwidget->buttonSymbols() == QSpinWidget::PlusMinus )
+ if ( spinwidget->buttonSymbols() == TQSpinWidget::PlusMinus )
pe = PE_SpinWidgetMinus;
p->setPen( cg.background() );
p->drawLine( down.topLeft(), down.bottomLeft() );
down.addCoords( 1, 0, 0, 0 );
- p->fillRect( down, cg.brush( QColorGroup::Button ) );
+ p->fillRect( down, cg.brush( TQColorGroup::Button ) );
drawLightEtch( p, down, cg.button(), ( active == SC_SpinWidgetDown ) );
down.addCoords( 1, 0, 0, 0 );
@@ -1267,8 +1267,8 @@ void LightStyleV3::drawComplexControl( ComplexControl control,
case CC_ScrollBar:
{
- const QScrollBar *scrollbar = (const QScrollBar *) widget;
- QRect addline, subline, subline2, addpage, subpage, slider, first, last;
+ const TQScrollBar *scrollbar = (const TQScrollBar *) widget;
+ TQRect addline, subline, subline2, addpage, subpage, slider, first, last;
bool maxedOut = (scrollbar->minValue() == scrollbar->maxValue());
subline = querySubControlMetrics(control, widget, SC_ScrollBarSubLine, data);
@@ -1339,7 +1339,7 @@ void LightStyleV3::drawComplexControl( ComplexControl control,
// ### perhaps this should not be able to accept focus if maxedOut?
if (scrollbar->hasFocus()) {
- QRect fr(slider.x() + 2, slider.y() + 2,
+ TQRect fr(slider.x() + 2, slider.y() + 2,
slider.width() - 5, slider.height() - 5);
drawPrimitive(PE_FocusRect, p, fr, cg, Style_Default);
}
@@ -1350,19 +1350,19 @@ void LightStyleV3::drawComplexControl( ComplexControl control,
case CC_Slider:
{
- const QSlider *slider = (const QSlider *) widget;
- QRect groove = querySubControlMetrics(CC_Slider, widget, SC_SliderGroove,
+ const TQSlider *slider = (const TQSlider *) widget;
+ TQRect groove = querySubControlMetrics(CC_Slider, widget, SC_SliderGroove,
data),
handle = querySubControlMetrics(CC_Slider, widget, SC_SliderHandle,
data);
if ((controls & SC_SliderGroove) && groove.isValid()) {
- QColor grooveColor = cg.midlight();
+ TQColor grooveColor = cg.midlight();
if (!(flags & Style_Enabled))
grooveColor = cg.background();
- QBrush brush(grooveColor);
+ TQBrush brush(grooveColor);
drawLightBevel( p, groove, cg,
( ( flags | Style_Raised ) ^ Style_Raised ) |
( ( flags & Style_Enabled ) ? Style_Sunken :
@@ -1378,7 +1378,7 @@ void LightStyleV3::drawComplexControl( ComplexControl control,
}
if ((controls & SC_SliderHandle) && handle.isValid()) {
- QColor sliderColor = cg.highlight();
+ TQColor sliderColor = cg.highlight();
if (!(flags & Style_Enabled))
sliderColor = cg.button();
@@ -1408,7 +1408,7 @@ void LightStyleV3::drawComplexControl( ComplexControl control,
}
if (controls & SC_SliderTickmarks)
- QCommonStyle::drawComplexControl(control, p, widget, r, cg, flags,
+ TQCommonStyle::drawComplexControl(control, p, widget, r, cg, flags,
SC_SliderTickmarks, active, data );
break;
}
@@ -1420,18 +1420,18 @@ void LightStyleV3::drawComplexControl( ComplexControl control,
break;
default:
- QCommonStyle::drawComplexControl(control, p, widget, r, cg, flags,
+ TQCommonStyle::drawComplexControl(control, p, widget, r, cg, flags,
controls, active, data);
break;
}
}
-QRect LightStyleV3::querySubControlMetrics( ComplexControl control,
- const QWidget *widget,
+TQRect LightStyleV3::querySubControlMetrics( ComplexControl control,
+ const TQWidget *widget,
SubControl sc,
- const QStyleOption &data ) const
+ const TQStyleOption &data ) const
{
- QRect ret;
+ TQRect ret;
switch (control) {
case CC_ComboBox:
@@ -1460,7 +1460,7 @@ QRect LightStyleV3::querySubControlMetrics( ComplexControl control,
case CC_ScrollBar:
{
- const QScrollBar *scrollbar = (const QScrollBar *) widget;
+ const TQScrollBar *scrollbar = (const TQScrollBar *) widget;
int sliderstart = scrollbar->sliderStart();
int sbextent = pixelMetric(PM_ScrollBarExtent, widget);
int maxlen = ((scrollbar->orientation() == Qt::Horizontal) ?
@@ -1536,7 +1536,7 @@ QRect LightStyleV3::querySubControlMetrics( ComplexControl control,
case CC_Slider:
{
- const QSlider *slider = (const QSlider *) widget;
+ const TQSlider *slider = (const TQSlider *) widget;
int tickOffset = pixelMetric( PM_SliderTickmarkOffset, widget );
int thickness = pixelMetric( PM_SliderControlThickness, widget );
@@ -1561,7 +1561,7 @@ QRect LightStyleV3::querySubControlMetrics( ComplexControl control,
}
default:
- ret = QCommonStyle::querySubControlMetrics(control, widget, sc, data);
+ ret = TQCommonStyle::querySubControlMetrics(control, widget, sc, data);
break;
}
@@ -1569,20 +1569,20 @@ QRect LightStyleV3::querySubControlMetrics( ComplexControl control,
}
default:
- ret = QCommonStyle::querySubControlMetrics(control, widget, sc, data);
+ ret = TQCommonStyle::querySubControlMetrics(control, widget, sc, data);
break;
}
return ret;
}
-QStyle::SubControl LightStyleV3::querySubControl( ComplexControl control,
- const QWidget *widget,
- const QPoint &pos,
- const QStyleOption &data ) const
+TQStyle::SubControl LightStyleV3::querySubControl( ComplexControl control,
+ const TQWidget *widget,
+ const TQPoint &pos,
+ const TQStyleOption &data ) const
{
- QStyle::SubControl ret =
- QCommonStyle::querySubControl(control, widget, pos, data);
+ TQStyle::SubControl ret =
+ TQCommonStyle::querySubControl(control, widget, pos, data);
// this is an ugly hack, but i really don't care, it's the quickest way to
// enabled the third button
@@ -1594,7 +1594,7 @@ QStyle::SubControl LightStyleV3::querySubControl( ComplexControl control,
}
int LightStyleV3::pixelMetric( PixelMetric metric,
- const QWidget *widget ) const
+ const TQWidget *widget ) const
{
int ret;
@@ -1663,13 +1663,13 @@ int LightStyleV3::pixelMetric( PixelMetric metric,
case PM_SliderControlThickness:
{
- const QSlider * sl = (const QSlider *) widget;
+ const TQSlider * sl = (const TQSlider *) widget;
int space = (sl->orientation() == Horizontal) ? sl->height()
: sl->width();
int ticks = sl->tickmarks();
int n = 0;
- if ( ticks & QSlider::Above ) n++;
- if ( ticks & QSlider::Below ) n++;
+ if ( ticks & TQSlider::Above ) n++;
+ if ( ticks & TQSlider::Below ) n++;
if ( !n ) {
ret = space;
break;
@@ -1690,19 +1690,19 @@ int LightStyleV3::pixelMetric( PixelMetric metric,
break;
default:
- ret = QCommonStyle::pixelMetric(metric, widget);
+ ret = TQCommonStyle::pixelMetric(metric, widget);
break;
}
return ret;
}
-QSize LightStyleV3::sizeFromContents( ContentsType contents,
- const QWidget *widget,
- const QSize &contentsSize,
- const QStyleOption &data ) const
+TQSize LightStyleV3::sizeFromContents( ContentsType contents,
+ const TQWidget *widget,
+ const TQSize &contentsSize,
+ const TQStyleOption &data ) const
{
- QSize ret;
+ TQSize ret;
switch (contents) {
case CT_ComboBox:
@@ -1719,14 +1719,14 @@ QSize LightStyleV3::sizeFromContents( ContentsType contents,
if ( h < 21 )
h = 21;
- ret = QSize( w, h );
+ ret = TQSize( w, h );
break;
}
case CT_PushButton:
{
- const QPushButton *button = (const QPushButton *) widget;
- ret = QCommonStyle::sizeFromContents( contents, widget, contentsSize, data );
+ const TQPushButton *button = (const TQPushButton *) widget;
+ ret = TQCommonStyle::sizeFromContents( contents, widget, contentsSize, data );
int w = ret.width(), h = ret.height();
int dbi = pixelMetric( PM_ButtonDefaultIndicator, widget ) * 2;
int mw = 80 - dbi, mh = 25 - dbi;
@@ -1740,7 +1740,7 @@ QSize LightStyleV3::sizeFromContents( ContentsType contents,
h = mh;
}
- ret = QSize( w, h );
+ ret = TQSize( w, h );
break;
}
@@ -1749,8 +1749,8 @@ QSize LightStyleV3::sizeFromContents( ContentsType contents,
if (! widget || data.isDefault())
break;
- QMenuItem *mi = data.menuItem();
- const QPopupMenu *popupmenu = (const QPopupMenu *) widget;
+ TQMenuItem *mi = data.menuItem();
+ const TQPopupMenu *popupmenu = (const TQPopupMenu *) widget;
int maxpmw = data.maxIconWidth();
int w = contentsSize.width(), h = contentsSize.height();
@@ -1772,8 +1772,8 @@ QSize LightStyleV3::sizeFromContents( ContentsType contents,
else if (! mi->text().isNull())
h = QMAX(h, popupmenu->fontMetrics().height() + 2);
if (mi->iconSet() != 0)
- h = QMAX(h, mi->iconSet()->pixmap(QIconSet::Small,
- QIconSet::Normal).height());
+ h = QMAX(h, mi->iconSet()->pixmap(TQIconSet::Small,
+ TQIconSet::Normal).height());
h += 2;
}
@@ -1786,22 +1786,22 @@ QSize LightStyleV3::sizeFromContents( ContentsType contents,
if (! mi->text().isNull() && mi->text().find('\t') >= 0)
w += 8;
- ret = QSize(w, h);
+ ret = TQSize(w, h);
break;
}
case CT_ProgressBar:
{
- const QProgressBar* pb = static_cast<const QProgressBar*>(widget);
+ const TQProgressBar* pb = static_cast<const TQProgressBar*>(widget);
//If we have to display the indicator, and we do it on RHS, give some more room
//for it. This tries to match the logic and the spacing in SR_ProgressBarGroove/Contents
- //sizing in QCommonStyle.
+ //sizing in TQCommonStyle.
if (pb->percentageVisible() &&
(pb->indicatorFollowsStyle() || ! pb->centerIndicator()))
{
int addw = pb->fontMetrics().width("100%") + 6;
- return QSize(contentsSize.width() + addw, contentsSize.height());
+ return TQSize(contentsSize.width() + addw, contentsSize.height());
}
else
return contentsSize; //Otherwise leave unchanged
@@ -1810,7 +1810,7 @@ QSize LightStyleV3::sizeFromContents( ContentsType contents,
}
default:
- ret = QCommonStyle::sizeFromContents(contents, widget, contentsSize, data);
+ ret = TQCommonStyle::sizeFromContents(contents, widget, contentsSize, data);
break;
}
@@ -1818,8 +1818,8 @@ QSize LightStyleV3::sizeFromContents( ContentsType contents,
}
int LightStyleV3::styleHint( StyleHint stylehint,
- const QWidget *widget,
- const QStyleOption &option,
+ const TQWidget *widget,
+ const TQStyleOption &option,
QStyleHintReturn* returnData ) const
{
int ret;
@@ -1846,16 +1846,16 @@ int LightStyleV3::styleHint( StyleHint stylehint,
break;
default:
- ret = QCommonStyle::styleHint(stylehint, widget, option, returnData);
+ ret = TQCommonStyle::styleHint(stylehint, widget, option, returnData);
break;
}
return ret;
}
-QPixmap LightStyleV3::stylePixmap( StylePixmap stylepixmap,
- const QWidget *widget,
- const QStyleOption &data ) const
+TQPixmap LightStyleV3::stylePixmap( StylePixmap stylepixmap,
+ const TQWidget *widget,
+ const TQStyleOption &data ) const
{
return basestyle->stylePixmap( stylepixmap, widget, data );
}