summaryrefslogtreecommitdiffstats
path: root/src/gui/kdeext/klearlook.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kdeext/klearlook.cpp')
-rw-r--r--src/gui/kdeext/klearlook.cpp623
1 files changed, 297 insertions, 326 deletions
diff --git a/src/gui/kdeext/klearlook.cpp b/src/gui/kdeext/klearlook.cpp
index 7263370..698620f 100644
--- a/src/gui/kdeext/klearlook.cpp
+++ b/src/gui/kdeext/klearlook.cpp
@@ -4,7 +4,7 @@ Klearlook (C) Joerg C. Koenig, 2005 [email protected]
----
-Based upon QtCurve (C) Craig Drummond, 2003 [email protected]
+Based upon TQtCurve (C) Craig Drummond, 2003 [email protected]
Bernhard Rosenkr�zer <bero@r?dh?t.com>
Preston Brown <pbrown@r?dh?t.com>
Than Ngo <than@r?dh?t.com>
@@ -81,15 +81,15 @@ DEALINGS IN THE SOFTWARE.
// Uncomment the following to enable gradients in toolbars and menubars
// NOTE: Not yet complete!!!
-//#define QTC_GRADIENT_TOOLBARS_AND_MENUBARS
+//#define TQTC_GRADIENT_TOOLBARS_AND_MENUBARS
//static int HIGH_LIGHT_FACTORS[]={ 100, 100, 100, 101, 102, 103, 104, 105 /*def*/, 106, 107, 108 };
//#define HIGHLIGHT_FACTOR(X) (X<0||X>10) ? 105 : HIGH_LIGHT_FACTORS[X]
-#define QTC_HIGHLIGHT_FACTOR 105
-#define QTC_BORDERED_FRAME_WIDTH 2
-#define QTC_DEF_FRAME_WIDTH 1
-//#define QTC_MIN_BTN_SIZE 10
-#define QTC_NO_SECT -1
+#define TQTC_HIGHLIGHT_FACTOR 105
+#define TQTC_BORDERED_FRAME_WIDTH 2
+#define TQTC_DEF_FRAME_WIDTH 1
+//#define TQTC_MIN_BTN_SIZE 10
+#define TQTC_NO_SECT -1
#define MENU_POPUP_ITEM_HIGH_HI 7
#define MENU_POPUP_ITEM_HIGH_LO 5
@@ -109,7 +109,7 @@ static TQString readEnvPath( const char *env ) {
TQCString path = getenv( env );
return path.isEmpty()
- ? TQString::null
+ ? TQString()
: TQFile::decodeName( path );
}
@@ -135,14 +135,14 @@ static bool kickerIsTrans() {
line = stream.readLine();
if ( inGen ) {
- if ( 0 == line.find( "Transparent=" ) ) // Found it!
+ if ( 0 == line.tqfind( "Transparent=" ) ) // Found it!
{
- if ( -1 != line.find( "true" ) )
+ if ( -1 != line.tqfind( "true" ) )
trans = true;
stop = true;
} else if ( line[ 0 ] == TQChar( '[' ) ) // Then wasn't in General section...
stop = true;
- } else if ( 0 == line.find( "[General]" ) )
+ } else if ( 0 == line.tqfind( "[General]" ) )
inGen = true;
}
cfgFile.close();
@@ -169,18 +169,18 @@ inline TQColor midColor( const TQColor &a, const TQColor &b, double factor = 1.0
// Copied from Keramik...
static bool isFormWidget( const TQWidget *widget ) {
//Form widgets are in the KHTMLView, but that has 2 further inner levels
- //of widgets - QClipperWidget, and outside of that, QViewportWidget
- TQWidget * potentialClipPort = widget->parentWidget();
+ //of widgets - TQClipperWidget, and outside of that, TQViewportWidget
+ TQWidget * potentialClipPort = widget->tqparentWidget();
if ( !potentialClipPort || potentialClipPort->isTopLevel() )
return false;
- TQWidget *potentialViewPort = potentialClipPort->parentWidget();
+ TQWidget *potentialViewPort = potentialClipPort->tqparentWidget();
if ( !potentialViewPort || potentialViewPort->isTopLevel() || qstrcmp( potentialViewPort->name(), "qt_viewport" ) )
return false;
- TQWidget *potentialKHTML = potentialViewPort->parentWidget();
+ TQWidget *potentialKHTML = potentialViewPort->tqparentWidget();
if ( !potentialKHTML || potentialKHTML->isTopLevel() || qstrcmp( potentialKHTML->className(), "KHTMLView" ) )
return false;
@@ -423,8 +423,8 @@ inline TQColor getFill( TQStyle::SFlags flags, const TQColor *use ) {
? use[ 3 ]
: flags & TQStyle::Style_MouseOver
? flags & ( TQStyle::Style_On | TQStyle::Style_Sunken )
- ? use[ 3 ].light( QTC_HIGHLIGHT_FACTOR )
- : use[ NUM_SHADES ].light( QTC_HIGHLIGHT_FACTOR )
+ ? TQColor(use[ 3 ].light( TQTC_HIGHLIGHT_FACTOR ))
+ : TQColor(use[ NUM_SHADES ].light( TQTC_HIGHLIGHT_FACTOR ))
: flags & ( TQStyle::Style_On | TQStyle::Style_Sunken )
? use[ 3 ]
: use[ NUM_SHADES ];
@@ -452,10 +452,10 @@ hover( HOVER_NONE ),
oldCursor( -1, -1 ),
formMode( false ),
hoverWidget( NULL ),
-hoverSect( QTC_NO_SECT ) {
+hoverSect( TQTC_NO_SECT ) {
TQSettings s;
- contrast = s.readNumEntry( "/Qt/KDE/contrast", 7 );
+ contrast = s.readNumEntry( "/TQt/KDE/contrast", 7 );
if ( contrast < 0 || contrast > 10 )
contrast = 7;
#ifdef USE_SINGLE_STYLE
@@ -466,24 +466,24 @@ hoverSect( QTC_NO_SECT ) {
darkMenubar = s.readBoolEntry( "/klearlookstyle/Settings/darkMenubar", true );
popupmenuHighlightLevel = s.readNumEntry( "/klearlookstyle/Settings/popupmenuHighlightLevel", 3);
- TQString tmp = s.readEntry( "/klearlookstyle/Settings/toolbarBorders", TQString::null );
+ TQString tmp = s.readEntry( "/klearlookstyle/Settings/toolbarBorders", TQString() );
toolbarBorders = tmp.isEmpty()
? TB_LIGHT
: qtc_to_tbar_border( tmp.latin1() );
bool etched = s.readBoolEntry( "/klearlookstyle/Settings/etched", true );
- tmp = s.readEntry( "/klearlookstyle/Settings/sliderThumbs", TQString::null );
+ tmp = s.readEntry( "/klearlookstyle/Settings/sliderThumbs", TQString() );
sliderThumbs = tmp.isEmpty()
? etched ? GROOVE_SUNKEN : GROOVE_RAISED
: qtc_to_groove( tmp.latin1() );
- tmp = s.readEntry( "/klearlookstyle/Settings/lvExpander", TQString::null );
+ tmp = s.readEntry( "/klearlookstyle/Settings/lvExpander", TQString() );
lvExpander = tmp.isEmpty()
? LV_EXP_ARR
: qtc_to_lv_expander( tmp.latin1() );
- tmp = s.readEntry( "/klearlookstyle/Settings/lvLines", TQString::null );
+ tmp = s.readEntry( "/klearlookstyle/Settings/lvLines", TQString() );
lvLines = tmp.isEmpty()
? LV_LINES_SOLID
: qtc_to_lv_lines( tmp.latin1() );
@@ -511,11 +511,11 @@ hoverSect( QTC_NO_SECT ) {
#endif
if ( PROFILE_RAISED != pmProfile )
- shadeColors( qApp->palette().active().highlight(), menuPbar );
+ shadeColors( tqApp->tqpalette().active().highlight(), menuPbar );
else
- shadeGradient( qApp->palette().active().highlight(), menuPbar );
- shadeColors( qApp->palette().active().background(), gray );
- shadeColors( qApp->palette().active().button(), button );
+ shadeGradient( tqApp->tqpalette().active().highlight(), menuPbar );
+ shadeColors( tqApp->tqpalette().active().background(), gray );
+ shadeColors( tqApp->tqpalette().active().button(), button );
}
void KlearlookStyle::polish( TQApplication *app ) {
@@ -534,11 +534,11 @@ void KlearlookStyle::polish( TQApplication *app ) {
#endif
} else
- themedApp = qstrcmp( qApp->argv() [ 0 ], "soffice.bin" ) ? APP_OTHER : APP_OPENOFFICE;
+ themedApp = qstrcmp( tqApp->argv() [ 0 ], "soffice.bin" ) ? APP_OTHER : APP_OPENOFFICE;
}
void KlearlookStyle::polish( TQPalette &pal ) {
- int c = TQSettings().readNumEntry( "/Qt/KDE/contrast", 7 );
+ int c = TQSettings().readNumEntry( "/TQt/KDE/contrast", 7 );
bool newContrast = false;
if ( c < 0 || c > 10 )
@@ -549,18 +549,18 @@ void KlearlookStyle::polish( TQPalette &pal ) {
newContrast = true;
}
- if ( newContrast || gray[ NUM_SHADES ] != qApp->palette().active().background() )
- shadeColors( qApp->palette().active().background(), gray );
+ if ( newContrast || gray[ NUM_SHADES ] != tqApp->tqpalette().active().background() )
+ shadeColors( tqApp->tqpalette().active().background(), gray );
- if ( newContrast || button[ NUM_SHADES ] != qApp->palette().active().button() )
- shadeColors( qApp->palette().active().button(), button );
+ if ( newContrast || button[ NUM_SHADES ] != tqApp->tqpalette().active().button() )
+ shadeColors( tqApp->tqpalette().active().button(), button );
if ( PROFILE_RAISED == pmProfile ) {
- if ( newContrast || menuPbar[ NUM_SHADES ] != qApp->palette().active().highlight() )
- shadeColors( qApp->palette().active().highlight(), menuPbar );
+ if ( newContrast || menuPbar[ NUM_SHADES ] != tqApp->tqpalette().active().highlight() )
+ shadeColors( tqApp->tqpalette().active().highlight(), menuPbar );
} else
- if ( qApp->palette().active().highlight() != menuPbar[ GRADIENT_BASE ] )
- shadeGradient( qApp->palette().active().highlight(), menuPbar );
+ if ( tqApp->tqpalette().active().highlight() != menuPbar[ GRADIENT_BASE ] )
+ shadeGradient( tqApp->tqpalette().active().highlight(), menuPbar );
const TQColorGroup &actGroup = pal.active(),
&inactGroup = pal.inactive();
@@ -585,35 +585,33 @@ void KlearlookStyle::polish( TQPalette &pal ) {
static const char * kdeToolbarWidget = "kde toolbar widget";
void KlearlookStyle::polish( TQWidget *widget ) {
- if ( tqqt_cast<TQRadioButton *>( widget )
- || tqqt_cast<TQCheckBox *>( widget )
- || tqqt_cast<TQSpinWidget *>( widget )
- || widget->inherits( "QSplitterHandle" ) ) {
-#if QT_VERSION >= 0x030200
+ if ( ::tqqt_cast<TQRadioButton *>( widget )
+ || ::tqqt_cast<TQCheckBox *>( widget )
+ || ::tqqt_cast<TQSpinWidget *>( widget )
+ || widget->inherits( TQSPLITTERHANDLE_OBJECT_NAME_STRING ) ) {
widget->setMouseTracking( true );
-#endif
widget->installEventFilter( this );
- } else if ( tqqt_cast<TQButton *>( widget ) || tqqt_cast<TQComboBox *>( widget ) ||
- widget->inherits( "QToolBarExtensionWidget" ) ) {
+ } else if ( ::tqqt_cast<TQButton *>( widget ) || ::tqqt_cast<TQComboBox *>( widget ) ||
+ widget->inherits( "TQToolBarExtensionWidget" ) ) {
widget->setBackgroundMode( TQWidget::PaletteBackground );
widget->installEventFilter( this );
- } else if ( tqqt_cast<TQMenuBar *>( widget )
- || tqqt_cast<TQToolBar *>( widget )
- || tqqt_cast<TQPopupMenu *>( widget ) )
+ } else if ( ::tqqt_cast<TQMenuBar *>( widget )
+ || ::tqqt_cast<TQToolBar *>( widget )
+ || ::tqqt_cast<TQPopupMenu *>( widget ) )
widget->setBackgroundMode( TQWidget::PaletteBackground );
else if ( widget->inherits( "KToolBarSeparator" ) ) {
widget->setBackgroundMode( TQWidget::NoBackground );
widget->installEventFilter( this );
- } else if ( tqqt_cast<TQScrollBar *>( widget ) ) {
+ } else if ( ::tqqt_cast<TQScrollBar *>( widget ) ) {
widget->setMouseTracking( true );
widget->installEventFilter( this );
widget->setBackgroundMode( TQWidget::NoBackground );
- } else if ( tqqt_cast<TQSlider *>( widget ) || tqqt_cast<TQHeader *>( widget ) ) {
+ } else if ( ::tqqt_cast<TQSlider *>( widget ) || ::tqqt_cast<TQHeader *>( widget ) ) {
widget->setMouseTracking( true );
widget->installEventFilter( this );
@@ -626,36 +624,34 @@ void KlearlookStyle::polish( TQWidget *widget ) {
}
void KlearlookStyle::unPolish( TQWidget *widget ) {
- if ( tqqt_cast<TQRadioButton *>( widget ) ||
- tqqt_cast<TQCheckBox *>( widget ) ||
- tqqt_cast<TQSpinWidget *>( widget ) ||
- widget->inherits( "QSplitterHandle" ) ) {
-#if QT_VERSION >= 0x030200
+ if ( ::tqqt_cast<TQRadioButton *>( widget ) ||
+ ::tqqt_cast<TQCheckBox *>( widget ) ||
+ ::tqqt_cast<TQSpinWidget *>( widget ) ||
+ widget->inherits( TQSPLITTERHANDLE_OBJECT_NAME_STRING ) ) {
widget->setMouseTracking( false );
-#endif
widget->removeEventFilter( this );
- } else if ( tqqt_cast<TQButton *>( widget ) || tqqt_cast<TQComboBox *>( widget ) ||
- widget->inherits( "QToolBarExtensionWidget" ) ) {
+ } else if ( ::tqqt_cast<TQButton *>( widget ) || ::tqqt_cast<TQComboBox *>( widget ) ||
+ widget->inherits( "TQToolBarExtensionWidget" ) ) {
widget->setBackgroundMode( TQWidget::PaletteButton );
widget->removeEventFilter( this );
- } else if ( tqqt_cast<TQMenuBar *>( widget ) ||
- tqqt_cast<TQToolBar *>( widget ) ||
- tqqt_cast<TQPopupMenu *>( widget ) )
+ } else if ( ::tqqt_cast<TQMenuBar *>( widget ) ||
+ ::tqqt_cast<TQToolBar *>( widget ) ||
+ ::tqqt_cast<TQPopupMenu *>( widget ) )
widget->setBackgroundMode( TQWidget::PaletteBackground );
else if ( widget->inherits( "KToolBarSeparator" ) ) {
widget->setBackgroundMode( PaletteBackground );
widget->removeEventFilter( this );
- } else if ( tqqt_cast<TQScrollBar *>( widget ) ) {
+ } else if ( ::tqqt_cast<TQScrollBar *>( widget ) ) {
widget->setMouseTracking( false );
widget->removeEventFilter( this );
widget->setBackgroundMode( TQWidget::PaletteButton );
- } else if ( tqqt_cast<TQSlider *>( widget ) ||
- tqqt_cast<TQHeader *>( widget ) ) {
+ } else if ( ::tqqt_cast<TQSlider *>( widget ) ||
+ ::tqqt_cast<TQHeader *>( widget ) ) {
widget->setMouseTracking( false );
widget->removeEventFilter( this );
@@ -668,38 +664,38 @@ void KlearlookStyle::unPolish( TQWidget *widget ) {
}
bool KlearlookStyle::eventFilter( TQObject *object, TQEvent *event ) {
- if ( object->parent() && 0 == qstrcmp( object->name(), kdeToolbarWidget ) ) {
+ if ( object->tqparent() && 0 == qstrcmp( object->name(), kdeToolbarWidget ) ) {
// Draw background for custom widgets in the toolbar that have specified a "kde toolbar widget" name.
if ( TQEvent::Paint == event->type() ) {
- TQWidget * widget = static_cast<TQWidget*>( object ),
- *parent = static_cast<TQWidget*>( object->parent() );
-#ifdef QTC_GRADIENT_TOOLBARS_AND_MENUBARS
+ TQWidget * widget = TQT_TQWIDGET( object ),
+ *tqparent = TQT_TQWIDGET( object->tqparent() );
+#ifdef TQTC_GRADIENT_TOOLBARS_AND_MENUBARS
// Find the top-level toolbar of this widget, since it may be nested in other
// widgets that are on the toolbar.
int x_offset = widget->x(),
y_offset = widget->y();
- while ( parent && parent->parent() && !qstrcmp( parent->name(), kdeToolbarWidget ) ) {
- x_offset += parent->x();
- y_offset += parent->y();
- parent = static_cast<TQWidget*>( parent->parent() );
+ while ( tqparent && tqparent->tqparent() && !qstrcmp( tqparent->name(), kdeToolbarWidget ) ) {
+ x_offset += tqparent->x();
+ y_offset += tqparent->y();
+ tqparent = TQT_TQWIDGET( tqparent->tqparent() );
}
- TQRect pr( parent->rect() );
+ TQRect pr( tqparent->rect() );
bool horiz_grad = pr.width() < pr.height();
- // Check if the parent is a QToolbar, and use its orientation, else guess.
- TQToolBar *toolbar = dynamic_cast<TQToolBar*>( parent );
+ // Check if the tqparent is a TQToolbar, and use its orientation, else guess.
+ TQToolBar *toolbar = dynamic_cast<TQToolBar*>( tqparent );
if ( toolbar )
- horiz_grad = toolbar->orientation() == Qt::Vertical;
+ horiz_grad = toolbar->orientation() == TQt::Vertical;
- drawBevelGradient( parent->colorGroup().background(), true, 1, &TQPainter( widget ),
+ drawBevelGradient( tqparent->tqcolorGroup().background(), true, 1, &TQPainter( widget ),
TQRect( x_offset, y_offset, pr.width(), pr.height() ),
horiz_grad, SHADE_BAR_LIGHT, SHADE_BAR_DARK );
#else
- TQPainter( widget ).fillRect( widget->rect(), parent->colorGroup().background() );
+ TQPainter( widget ).fillRect( widget->rect(), tqparent->tqcolorGroup().background() );
#endif
return false; // Now draw the contents
@@ -710,11 +706,11 @@ bool KlearlookStyle::eventFilter( TQObject *object, TQEvent *event ) {
if ( frame && TQFrame::NoFrame != frame->frameShape() ) {
TQPainter painter( frame );
if ( TQFrame::VLine == frame->frameShape() )
- drawPrimitive( PE_DockWindowSeparator, &painter,
- frame->rect(), frame->colorGroup(), Style_Horizontal );
+ tqdrawPrimitive( PE_DockWindowSeparator, &painter,
+ frame->rect(), frame->tqcolorGroup(), Style_Horizontal );
else if ( TQFrame::HLine == frame->frameShape() )
- drawPrimitive( PE_DockWindowSeparator, &painter,
- frame->rect(), frame->colorGroup() );
+ tqdrawPrimitive( PE_DockWindowSeparator, &painter,
+ frame->rect(), frame->tqcolorGroup() );
else
return false;
return true; // been drawn!
@@ -726,7 +722,7 @@ bool KlearlookStyle::eventFilter( TQObject *object, TQEvent *event ) {
hoverWidget = ( TQWidget * ) object;
if ( hoverWidget && hoverWidget->isEnabled() ) {
if ( redrawHoverWidget() ) {
- hoverWidget->repaint( false );
+ hoverWidget->tqrepaint( false );
if ( APP_KICKER == themedApp )
hover = HOVER_NONE;
}
@@ -736,17 +732,17 @@ bool KlearlookStyle::eventFilter( TQObject *object, TQEvent *event ) {
}
break;
case TQEvent::Leave:
- if ( hoverWidget && object == hoverWidget ) {
+ if ( hoverWidget && TQT_BASE_OBJECT(object) == TQT_BASE_OBJECT(hoverWidget) ) {
oldCursor.setX( -1 );
oldCursor.setY( -1 );
hoverWidget = NULL;
- ( ( TQWidget * ) object ) ->repaint( false );
+ ( ( TQWidget * ) object ) ->tqrepaint( false );
}
break;
case TQEvent::MouseMove:
if ( hoverWidget && object->isWidgetType() ) {
if ( redrawHoverWidget() ) {
- hoverWidget->repaint( false );
+ hoverWidget->tqrepaint( false );
if ( APP_KICKER == themedApp )
hover = HOVER_NONE;
}
@@ -821,8 +817,8 @@ void KlearlookStyle::drawLightBevelButton(
if ( borderButton )
if ( rounded && ROUNDED_NONE != round ) {
- bool wide = r.width() >= QTC_MIN_BTN_SIZE,
- tall = r.height() >= QTC_MIN_BTN_SIZE;
+ bool wide = r.width() >= TQTC_MIN_BTN_SIZE,
+ tall = r.height() >= TQTC_MIN_BTN_SIZE;
TQColor border( flags & Style_ButtonDefault && IND_FONT_COLOUR == defBtnIndicator & flags & Style_Enabled
? cg.text() : custom ? custom[ 5 ] : gray[ 5 ] );
@@ -1037,8 +1033,8 @@ void KlearlookStyle::drawLightBevel(
if ( borderButton )
if ( rounded && ROUNDED_NONE != round ) {
- bool wide = r.width() >= QTC_MIN_BTN_SIZE,
- tall = r.height() >= QTC_MIN_BTN_SIZE;
+ bool wide = r.width() >= TQTC_MIN_BTN_SIZE,
+ tall = r.height() >= TQTC_MIN_BTN_SIZE;
TQColor border = menuPbar[ GRADIENT_BASE ].dark( 130 );
@@ -1194,7 +1190,7 @@ void KlearlookStyle::drawLightBevel(
}
void KlearlookStyle::drawArrow( TQPainter *p, const TQRect &r, const TQColorGroup &cg, TQStyle::SFlags flags,
- TQStyle::PrimitiveElement pe, bool small, bool checkActive ) const {
+ TQStyle::TQ_PrimitiveElement pe, bool small, bool checkActive ) const {
TQPointArray a;
const TQColor &col = flags & Style_Enabled
? checkActive && flags & Style_Active
@@ -1284,7 +1280,7 @@ void KlearlookStyle::drawArrow( TQPainter *p, const TQRect &r, const TQColorGrou
p->restore();
}
-void KlearlookStyle::drawPrimitiveMenu( PrimitiveElement pe, TQPainter *p, const TQRect &r, const TQColorGroup &cg,
+void KlearlookStyle::tqdrawPrimitiveMenu( TQ_PrimitiveElement pe, TQPainter *p, const TQRect &r, const TQColorGroup &cg,
SFlags flags, const TQStyleOption &data ) const {
switch ( pe ) {
case PE_CheckMark:
@@ -1319,11 +1315,11 @@ void KlearlookStyle::drawPrimitiveMenu( PrimitiveElement pe, TQPainter *p, const
break;
default:
- KStyle::drawPrimitive( pe, p, r, cg, flags, data );
+ KStyle::tqdrawPrimitive( pe, p, r, cg, flags, data );
}
}
-void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQRect &r, const TQColorGroup &cg,
+void KlearlookStyle::tqdrawPrimitive( TQ_PrimitiveElement pe, TQPainter *p, const TQRect &r, const TQColorGroup &cg,
SFlags flags, const TQStyleOption &data ) const {
int x, y, w, h;
@@ -1358,7 +1354,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQR
} else {
flags = ( ( flags | Style_Sunken ) ^ Style_Sunken ) | Style_Raised;
- if ( QTC_NO_SECT != hoverSect && HOVER_HEADER == hover && hoverWidget ) {
+ if ( TQTC_NO_SECT != hoverSect && HOVER_HEADER == hover && hoverWidget ) {
TQHeader * hd = dynamic_cast<TQHeader *>( hoverWidget );
if ( hd && hd->isClickEnabled( hoverSect ) && r == hd->sectionRect( hoverSect ) )
@@ -1399,7 +1395,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQR
const TQColor * use = buttonColors( cg );
p->setPen( use[ 4 ] );
- int offset = r.width() >= QTC_MIN_BTN_SIZE && r.height() >= QTC_MIN_BTN_SIZE ? 4 : 3;
+ int offset = r.width() >= TQTC_MIN_BTN_SIZE && r.height() >= TQTC_MIN_BTN_SIZE ? 4 : 3;
p->drawLine( r.x() + offset, r.y(), r.x() + r.width() - ( 1 + offset ), r.y() );
p->drawLine( r.x() + offset, r.y() + r.height() - 1,
@@ -1479,11 +1475,11 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQR
int x = r.x(), y = r.y(), w = r.width(), h = r.height(), marg = lv->itemMargin();
p->setPen( TQPen( flags & Style_Enabled ? cg.text()
- : lv->palette().color( TQPalette::Disabled, TQColorGroup::Text ) ) );
+ : lv->tqpalette().color( TQPalette::Disabled, TQColorGroup::Text ) ) );
if ( flags & Style_Selected && !lv->rootIsDecorated() &&
- !( ( item->parent() && 1 == item->parent() ->rtti() &&
- TQCheckListItem::Controller == ( ( TQCheckListItem* ) item->parent() ) ->type() ) )) {
+ !( ( item->tqparent() && 1 == item->tqparent() ->rtti() &&
+ TQCheckListItem::Controller == ( ( TQCheckListItem* ) item->tqparent() ) ->type() ) )) {
p->fillRect( 0, 0, x + marg + w + 4, item->height(),
cg.brush( TQColorGroup::Highlight ) );
if ( item->isEnabled() )
@@ -1504,13 +1500,13 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQR
TQListView * lv = item->listView();
p->setPen( TQPen( flags & Style_Enabled ? cg.text()
- : lv->palette().color( TQPalette::Disabled, TQColorGroup::Text ), 2 ) );
+ : lv->tqpalette().color( TQPalette::Disabled, TQColorGroup::Text ), 2 ) );
if ( flags & Style_Selected ) {
flags -= Style_Selected;
if ( !lv->rootIsDecorated() &&
- !( ( item->parent() && 1 == item->parent() ->rtti() &&
+ !( ( item->tqparent() && 1 == item->tqparent() ->rtti() &&
TQCheckListItem::Controller ==
- ( ( TQCheckListItem* ) item->parent() ) ->type() ) ) ) {
+ ( ( TQCheckListItem* ) item->tqparent() ) ->type() ) ) ) {
p->fillRect( 0, 0, r.x() + lv->itemMargin() + r.width() + 4, item->height(),
cg.brush( TQColorGroup::Highlight ) );
if ( item->isEnabled() ) {
@@ -1524,7 +1520,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQR
p->setBrush( cg.brush( TQColorGroup::Button ) );
p->drawRect( r.x() + lv->itemMargin(), r.y() + 2, r.width() - 4, r.width() - 4 );
if ( flags & TQStyle::Style_On || !( flags & Style_Off ) )
- drawPrimitive( PE_CheckMark, p, TQRect( r.x() + lv->itemMargin(),
+ tqdrawPrimitive( PE_CheckMark, p, TQRect( r.x() + lv->itemMargin(),
r.y() + 2, r.width() - 4, r.width() - 4 ), cg, flags );
}
break;
@@ -1534,13 +1530,13 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQR
bool on = flags & TQStyle::Style_On || !( flags & Style_Off );
if ( APPEARANCE_FLAT != appearance )
- drawPrimitive( PE_ButtonTool, p, r, cg, flags );
+ tqdrawPrimitive( PE_ButtonTool, p, r, cg, flags );
else {
- p->fillRect( r.x() + 1, r.y() + 2, QTC_CHECK_SIZE - 2, QTC_CHECK_SIZE - 2,
+ p->fillRect( r.x() + 1, r.y() + 2, TQTC_CHECK_SIZE - 2, TQTC_CHECK_SIZE - 2,
flags & Style_Enabled ? cg.base() : cg.background() );
p->setPen( use[ 4 ] );
- p->drawLine( r.x() + 1, r.y() + QTC_CHECK_SIZE - 1, r.x() + 1, r.y() + 1 );
- p->drawLine( r.x() + 1, r.y() + 1, r.x() + QTC_CHECK_SIZE - 2, r.y() + 1 );
+ p->drawLine( r.x() + 1, r.y() + TQTC_CHECK_SIZE - 1, r.x() + 1, r.y() + 1 );
+ p->drawLine( r.x() + 1, r.y() + 1, r.x() + TQTC_CHECK_SIZE - 2, r.y() + 1 );
}
p->setPen( use[ 5 ] );
p->setBrush( NoBrush );
@@ -1556,10 +1552,10 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQR
p->drawPoint( r.x() + r.height() - 1, r.y() );
p->drawPoint( r.x() + r.height() - 1, r.y() + r.width() - 1 );
} else if ( APPEARANCE_FLAT == appearance || borderButton )
- p->drawRect( r.x(), r.y(), QTC_CHECK_SIZE, QTC_CHECK_SIZE );
+ p->drawRect( r.x(), r.y(), TQTC_CHECK_SIZE, TQTC_CHECK_SIZE );
if ( on )
- drawPrimitive( PE_CheckMark, p, r, cg, flags );
+ tqdrawPrimitive( PE_CheckMark, p, r, cg, flags );
break;
}
case PE_CheckListExclusiveIndicator: {
@@ -1625,8 +1621,8 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQR
if ( PE_ExclusiveIndicatorMask == pe ) {
p->fillRect( r, color0 );
- p->setPen( Qt::color1 );
- p->setBrush( Qt::color1 );
+ p->setPen( TQt::color1 );
+ p->setBrush( TQt::color1 );
p->drawPolygon( outer );
} else {
TQPointArray shadow;
@@ -1656,7 +1652,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQR
x + 8, y + 1 );
p->fillRect( r, crLabelHighlight && flags & Style_MouseOver
- ? cg.background().light( QTC_HIGHLIGHT_FACTOR ) : cg.background() );
+ ? TQColor(cg.background().light( TQTC_HIGHLIGHT_FACTOR )) : cg.background() );
if ( APPEARANCE_FLAT != appearance ) {
indBgnd = getFill( flags, use );
@@ -1699,7 +1695,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQR
rightShadowColor = bgnd;
p->setBrush( bgnd );
p->setPen( bgnd );
- p->drawEllipse( x, y, QTC_RADIO_SIZE, QTC_RADIO_SIZE );
+ p->drawEllipse( x, y, TQTC_RADIO_SIZE, TQTC_RADIO_SIZE );
p->setPen( use[ 4 ] );
leftShadowColor = use[ 4 ];
p->drawPolyline( shadow );
@@ -1806,7 +1802,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQR
else {
p->fillRect( r,
TQColor( flags & Style_MouseOver ?
- cg.background().light( QTC_HIGHLIGHT_FACTOR ) :
+ TQColor(cg.background().light( TQTC_HIGHLIGHT_FACTOR )) :
cg.background() ) );
drawLines( p, r, flags & Style_Horizontal, 70, 1, use, 0, TRUE,
APPEARANCE_LIGHT_GRADIENT == appearance );
@@ -1859,7 +1855,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQR
TQColorGroup( use[ 4 ], use[ NUM_SHADES ], use[ 0 ], use[ 4 ], use[ 2 ],
cg.text(), use[ NUM_SHADES ] ),
flags & Style_Sunken,
- data.isDefault() ? QTC_BORDERED_FRAME_WIDTH - 1 : data.lineWidth() - 1 );
+ data.isDefault() ? TQTC_BORDERED_FRAME_WIDTH - 1 : data.lineWidth() - 1 );
#endif
} else
@@ -1868,7 +1864,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQR
use[ 5 ], use[ NUM_SHADES ], use[ 0 ], use[ 5 ], use[ 2 ],
cg.text(), use[ NUM_SHADES ]
),
- flags & Style_Sunken, data.isDefault() ? QTC_DEF_FRAME_WIDTH : data.lineWidth() );
+ flags & Style_Sunken, data.isDefault() ? TQTC_DEF_FRAME_WIDTH : data.lineWidth() );
break;
}
case PE_PanelTabWidget: {
@@ -1884,7 +1880,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQR
TQColorGroup( use[ 4 ], use[ NUM_SHADES ], use[ 0 ], use[ 4 ], use[ 2 ],
cg.text(), use[ NUM_SHADES ] ),
flags & Style_Sunken,
- data.isDefault() ? QTC_BORDERED_FRAME_WIDTH - 1 : data.lineWidth() - 1 );
+ data.isDefault() ? TQTC_BORDERED_FRAME_WIDTH - 1 : data.lineWidth() - 1 );
#endif
} else
@@ -1893,7 +1889,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQR
use[ 5 ], use[ NUM_SHADES ], use[ 0 ], use[ 5 ], use[ 2 ],
cg.text(), use[ NUM_SHADES ]
),
- flags & Style_Sunken, data.isDefault() ? QTC_DEF_FRAME_WIDTH : data.lineWidth() );
+ flags & Style_Sunken, data.isDefault() ? TQTC_DEF_FRAME_WIDTH : data.lineWidth() );
break;
}
case PE_PanelDockWindow:
@@ -1910,7 +1906,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQR
flags & Style_Sunken, 1
);
-#ifdef QTC_GRADIENT_TOOLBARS_AND_MENUBARS
+#ifdef TQTC_GRADIENT_TOOLBARS_AND_MENUBARS
if ( APPEARANCE_FLAT != appearance )
drawBevelGradient( use[ NUM_SHADES ],
@@ -1931,7 +1927,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQR
flags & Style_Sunken, 1
);
-#ifdef QTC_GRADIENT_TOOLBARS_AND_MENUBARS
+#ifdef TQTC_GRADIENT_TOOLBARS_AND_MENUBARS
if ( APPEARANCE_FLAT != appearance )
drawBevelGradient( use[ NUM_SHADES ],
@@ -1968,7 +1964,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQR
PE_ArrowDown == pe ? ROUNDED_BOTTOM :
PE_ArrowUp == pe ? ROUNDED_TOP : ROUNDED_NONE,
getFill( flags, use ), use );
- drawPrimitive( pe, p, r, cg, flags );
+ tqdrawPrimitive( pe, p, r, cg, flags );
break;
}
case PE_ScrollBarSubPage:
@@ -2037,7 +2033,7 @@ void KlearlookStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p, const TQR
break;
}
default:
- KStyle::drawPrimitive( pe, p, r, cg, flags, data );
+ KStyle::tqdrawPrimitive( pe, p, r, cg, flags, data );
}
}
@@ -2058,7 +2054,7 @@ void KlearlookStyle::drawKStylePrimitive( KStylePrimitive kpe, TQPainter *p, con
drawSliderHandle( p, r, cg, flags );
break;
case KPE_ListViewExpander: {
- int lvSize = QTC_LV_SIZE( lvExpander );
+ int lvSize = TQTC_LV_SIZE( lvExpander );
TQRect ar( r.x() + ( ( r.width() - ( lvSize + 4 ) ) >> 1 ),
r.y() + ( ( r.height() - ( lvSize + 4 ) ) >> 1 ), lvSize + 4, lvSize + 4 );
@@ -2200,7 +2196,7 @@ void KlearlookStyle::drawKStylePrimitive( KStylePrimitive kpe, TQPainter *p, con
}
}
-void KlearlookStyle::drawControl(
+void KlearlookStyle::tqdrawControl(
ControlElement control,
TQPainter *p,
const TQWidget *widget,
@@ -2216,11 +2212,11 @@ void KlearlookStyle::drawControl(
bool cornerWidget = false,
firstTab = 0 == tb->indexOf( data.tab() ->identifier() );
- if ( tqqt_cast<const TQTabWidget *>( tb->parent() ) ) {
- const TQTabWidget * tw = ( const TQTabWidget* ) tb->parent();
+ if ( ::tqqt_cast<const TQTabWidget *>( tb->tqparent() ) ) {
+ const TQTabWidget * tw = ( const TQTabWidget* ) tb->tqparent();
// is there a corner widget in the (top) left edge?
- if ( tw->cornerWidget( Qt::TopLeft ) )
+ if ( tw->cornerWidget( TQt::TopLeft ) )
cornerWidget = true;
}
@@ -2229,7 +2225,7 @@ void KlearlookStyle::drawControl(
fr( r );
int offset = rounded ? 2 : 0;
- switch ( tb->shape() ) {
+ switch ( tb->tqshape() ) {
case TQTabBar::TriangularAbove:
case TQTabBar::RoundedAbove:
if ( flags & Style_Selected ) {
@@ -2379,12 +2375,12 @@ void KlearlookStyle::drawControl(
p->fillRect( fr, flags & Style_Selected ? cg.background() : gray[ 2 ] );
break;
default:
- KStyle::drawControl( control, p, widget, r, cg, flags, data );
+ KStyle::tqdrawControl( control, p, widget, r, cg, flags, data );
}
} else {
TQRect br( r );
- switch ( tb->shape() ) {
+ switch ( tb->tqshape() ) {
case TQTabBar::TriangularAbove:
case TQTabBar::RoundedAbove:
if ( flags & Style_Selected ) {
@@ -2460,7 +2456,6 @@ void KlearlookStyle::drawControl(
}
break;
}
-#if QT_VERSION >= 0x030200
case CE_TabBarLabel: {
if ( data.isDefault() )
break;
@@ -2470,19 +2465,18 @@ void KlearlookStyle::drawControl(
TQRect tr = r;
if ( t->identifier() == tb->currentTab() ) {
- if ( TQTabBar::RoundedAbove == tb->shape() || TQTabBar::TriangularAbove == tb->shape() )
- tr.setBottom( tr.bottom() - pixelMetric( TQStyle::PM_TabBarTabShiftVertical, tb ) );
+ if ( TQTabBar::RoundedAbove == tb->tqshape() || TQTabBar::TriangularAbove == tb->tqshape() )
+ tr.setBottom( tr.bottom() - tqpixelMetric( TQStyle::PM_TabBarTabShiftVertical, tb ) );
} else
- if ( TQTabBar::RoundedBelow == tb->shape() || TQTabBar::TriangularBelow == tb->shape() )
- tr.setTop( tr.top() + pixelMetric( TQStyle::PM_TabBarTabShiftVertical, tb ) );
+ if ( TQTabBar::RoundedBelow == tb->tqshape() || TQTabBar::TriangularBelow == tb->tqshape() )
+ tr.setTop( tr.top() + tqpixelMetric( TQStyle::PM_TabBarTabShiftVertical, tb ) );
drawItem( p, tr, AlignCenter | ShowPrefix, cg, flags & Style_Enabled, 0, t->text() );
if ( ( flags & Style_HasFocus ) && !t->text().isEmpty() )
- drawPrimitive( PE_FocusRect, p, r, cg );
+ tqdrawPrimitive( PE_FocusRect, p, r, cg );
break;
}
-#endif
case CE_PushButtonLabel: // Taken from Highcolour and Plastik...
{
int x, y, w, h;
@@ -2495,23 +2489,23 @@ void KlearlookStyle::drawControl(
// 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 ),
- margin = pixelMetric( PM_ButtonMargin, widget );
+ int dx = tqpixelMetric( PM_MenuButtonIndicator, widget ),
+ margin = tqpixelMetric( PM_ButtonMargin, widget );
if ( button->iconSet() && !button->iconSet() ->isNull() &&
( 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 {
- drawPrimitive( PE_ArrowDown,
- p, visualRect( TQRect(
+ tqdrawPrimitive( PE_ArrowDown,
+ p, tqvisualRect( TQRect(
( x + w ) - ( dx + margin ), y, dx,
h ), r ), cg, flags, data );
@@ -2543,7 +2537,7 @@ void KlearlookStyle::drawControl(
pixmap );
else {
iw = button->pixmap() ? button->pixmap() ->width()
- : widget->fontMetrics().size( Qt::ShowPrefix, button->text() ).width();
+ : widget->fontMetrics().size( TQt::ShowPrefix, button->text() ).width();
int cw = iw + pw + constSpace;
@@ -2553,7 +2547,7 @@ void KlearlookStyle::drawControl(
}
if ( cornArrow ) //Draw over the icon
- drawPrimitive( PE_ArrowDown, p, visualRect( TQRect( 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, data );
if ( xo && iw ) {
@@ -2572,16 +2566,16 @@ void KlearlookStyle::drawControl(
for ( i = 0; i < j; i++ )
drawItem( p, TQRect( x + i, y, w, h ),
AlignCenter | ShowPrefix,
- button->colorGroup(),
+ button->tqcolorGroup(),
button->isEnabled(),
button->pixmap(),
button->text(), -1,
- &button->colorGroup().buttonText() );
+ &button->tqcolorGroup().buttonText() );
//Draw a focus rect if the button has focus
if ( flags & Style_HasFocus )
- drawPrimitive( PE_FocusRect, p,
- TQStyle::visualRect( subRect( SR_PushButtonFocusRect, widget ), widget ), cg, flags );
+ tqdrawPrimitive( PE_FocusRect, p,
+ TQStyle::tqvisualRect( subRect( SR_PushButtonFocusRect, widget ), widget ), cg, flags );
break;
}
@@ -2616,7 +2610,7 @@ void KlearlookStyle::drawControl(
break;
}
- maxpmw = QMAX( maxpmw, 16 );
+ maxpmw = TQMAX( maxpmw, 16 );
TQRect cr, ir, tr, sr;
if (menuIcons) {
@@ -2642,10 +2636,10 @@ void KlearlookStyle::drawControl(
bool reverse = TQApplication::reverseLayout();
if ( reverse ) {
- cr = visualRect( cr, r );
- sr = visualRect( sr, r );
- tr = visualRect( tr, r );
- ir = visualRect( ir, r );
+ cr = tqvisualRect( cr, r );
+ sr = tqvisualRect( sr, r );
+ tr = tqvisualRect( tr, r );
+ ir = tqvisualRect( ir, r );
}
if ( mi->iconSet() && menuIcons ) {
@@ -2653,7 +2647,7 @@ void KlearlookStyle::drawControl(
TQIconSet::Mode mode = flags & Style_Active
? ( mi->isEnabled() ? TQIconSet::Active : TQIconSet::Disabled )
: ( mi->isEnabled() ? TQIconSet::Normal : TQIconSet::Disabled );
- cr = visualRect( TQRect( x, y, maxpmw, h ), r );
+ cr = tqvisualRect( TQRect( x, y, maxpmw, h ), r );
// Do we have an icon and are checked at the same time?
// Then draw a "pressed" background behind the icon
@@ -2686,7 +2680,7 @@ void KlearlookStyle::drawControl(
ir.setCoords( cr.right() + 2, r.top(), tr.right() - 4, r.bottom() );
TQBrush brush( mi->isEnabled() ? cg.highlightedText() : cg.background() );
- drawPrimitiveMenu( PE_CheckMark, p, cr, cg,
+ tqdrawPrimitiveMenu( PE_CheckMark, p, cr, cg,
( flags & ( Style_Enabled | Style_Active ) ) | Style_On );
}
@@ -2724,7 +2718,7 @@ void KlearlookStyle::drawControl(
TQString text = mi->text();
if ( !text.isNull() ) {
- int t = text.find( '\t' );
+ int t = text.tqfind( '\t' );
// draw accelerator/tab-text
if ( t >= 0 ) {
@@ -2760,10 +2754,10 @@ void KlearlookStyle::drawControl(
TQPixmap pixmap = *mi->pixmap();
if ( 1 == pixmap.depth() )
- p->setBackgroundMode( OpaqueMode );
+ p->setBackgroundMode( Qt::OpaqueMode );
p->drawPixmap( ir.x(), ( ir.height() - pixmap.height() ) >> 1, pixmap );
if ( pixmap.depth() == 1 )
- p->setBackgroundMode( TransparentMode );
+ p->setBackgroundMode( Qt::TransparentMode );
}
if ( mi->popup() )
@@ -2777,7 +2771,7 @@ void KlearlookStyle::drawControl(
drawPBarOrMenu2( p, TQRect(r.x(), r.y(), r.width(), r.height()),
true, cg, true );
} else
-#ifdef QTC_GRADIENT_TOOLBARS_AND_MENUBARS
+#ifdef TQTC_GRADIENT_TOOLBARS_AND_MENUBARS
if ( APPEARANCE_FLAT != appearance )
drawBevelGradient( cg.background(), true, 0, p,
r,
@@ -2819,7 +2813,7 @@ void KlearlookStyle::drawControl(
break;
case CE_DockWindowEmptyArea:
-#ifdef QTC_GRADIENT_TOOLBARS_AND_MENUBARS
+#ifdef TQTC_GRADIENT_TOOLBARS_AND_MENUBARS
if ( APPEARANCE_FLAT != appearance )
drawBevelGradient( cg.background(), true, 1, p, r, true, SHADE_BAR_LIGHT, SHADE_BAR_DARK );
@@ -2847,7 +2841,7 @@ void KlearlookStyle::drawControl(
if ( cr.isValid() && ( progress > 0 || steps == 0 ) ) {
double pg = ( steps == 0 ) ? 0.1 : progress / steps;
- int width = QMIN( cr.width(), ( int ) ( pg * cr.width() ) );
+ int width = TQMIN( cr.width(), ( int ) ( pg * cr.width() ) );
if ( 0 == steps ) //Busy indicator
{
@@ -2885,7 +2879,7 @@ void KlearlookStyle::drawControl(
case CE_PushButton: {
const TQPushButton *button = static_cast<const TQPushButton *>( widget );
TQRect br( r );
- int dbi = pixelMetric( PM_ButtonDefaultIndicator, widget );
+ int dbi = tqpixelMetric( PM_ButtonDefaultIndicator, widget );
if ( rounded && isFormWidget( widget ) )
formMode = true;
@@ -2901,55 +2895,47 @@ void KlearlookStyle::drawControl(
p->save();
p->setBrushOrigin( -widget->backgroundOffset().x(), -widget->backgroundOffset().y() );
// draw button
- drawPrimitive( PE_ButtonCommand, p, br, cg, flags );
+ tqdrawPrimitive( PE_ButtonCommand, p, br, cg, flags );
if ( button->isDefault() && IND_FONT_COLOUR != defBtnIndicator )
- drawPrimitive( PE_ButtonDefault, p, r, cg, flags );
+ tqdrawPrimitive( PE_ButtonDefault, p, r, cg, flags );
p->restore();
formMode = false;
break;
}
case CE_CheckBox:
- drawPrimitive( PE_Indicator, p, r, cg, flags, data );
+ tqdrawPrimitive( PE_Indicator, p, r, cg, flags, data );
break;
case CE_CheckBoxLabel:
if ( crLabelHighlight ) {
const TQCheckBox * checkbox = ( const TQCheckBox * ) widget;
if ( flags & Style_MouseOver &&
-#if QT_VERSION >= 0x030200
HOVER_CHECK == hover && hoverWidget == widget &&
-#endif
!isFormWidget( widget ) ) {
-#if QT_VERSION >= 0x030200
TQRect cr( checkbox->rect() );
TQRegion r( TQRect( cr.x(), cr.y(),
- visualRect( subRect( SR_CheckBoxFocusRect, widget ), widget ).width() +
- pixelMetric( PM_IndicatorWidth ) + 4, cr.height() ) );
+ tqvisualRect( subRect( SR_CheckBoxFocusRect, widget ), widget ).width() +
+ tqpixelMetric( PM_IndicatorWidth ) + 4, cr.height() ) );
-#else
-
- TQRegion r( checkbox->rect() );
-#endif
-
- r -= visualRect( subRect( SR_CheckBoxIndicator, widget ), widget );
+ r -= tqvisualRect( subRect( SR_CheckBoxIndicator, widget ), widget );
p->setClipRegion( r );
- p->fillRect( checkbox->rect(), cg.background().light( QTC_HIGHLIGHT_FACTOR ) );
+ p->fillRect( checkbox->rect(), cg.background().light( TQTC_HIGHLIGHT_FACTOR ) );
p->setClipping( false );
}
- int alignment = TQApplication::reverseLayout() ? AlignRight : AlignLeft;
+ int tqalignment = TQApplication::reverseLayout() ? AlignRight : AlignLeft;
- drawItem( p, r, alignment | AlignVCenter | ShowPrefix, cg,
+ drawItem( p, r, tqalignment | AlignVCenter | ShowPrefix, cg,
flags & Style_Enabled, checkbox->pixmap(), checkbox->text() );
if ( checkbox->hasFocus() )
- drawPrimitive( PE_FocusRect, p,
- visualRect( subRect( SR_CheckBoxFocusRect, widget ), widget ), cg, flags );
+ tqdrawPrimitive( PE_FocusRect, p,
+ tqvisualRect( subRect( SR_CheckBoxFocusRect, widget ), widget ), cg, flags );
} else
- KStyle::drawControl( control, p, widget, r, cg, flags, data );
+ KStyle::tqdrawControl( control, p, widget, r, cg, flags, data );
break;
case CE_RadioButton:
formMode = isFormWidget( widget );
- drawPrimitive( PE_ExclusiveIndicator, p, r, cg, flags, data );
+ tqdrawPrimitive( PE_ExclusiveIndicator, p, r, cg, flags, data );
formMode = false;
break;
case CE_RadioButtonLabel:
@@ -2957,47 +2943,40 @@ void KlearlookStyle::drawControl(
const TQRadioButton * radiobutton = ( const TQRadioButton * ) widget;
if ( flags & Style_MouseOver &&
-#if QT_VERSION >= 0x030200
HOVER_RADIO == hover && hoverWidget == widget &&
-#endif
!isFormWidget( widget ) ) {
-#if QT_VERSION >= 0x030200
TQRect rb( radiobutton->rect() );
TQRegion r( TQRect( rb.x(), rb.y(),
- visualRect( subRect( SR_RadioButtonFocusRect, widget ), widget ).width() +
- pixelMetric( PM_ExclusiveIndicatorWidth ) + 4, rb.height() ) );
-#else
-
- TQRegion r( radiobutton->rect() );
-#endif
+ tqvisualRect( subRect( SR_RadioButtonFocusRect, widget ), widget ).width() +
+ tqpixelMetric( PM_ExclusiveIndicatorWidth ) + 4, rb.height() ) );
- r -= visualRect( subRect( SR_RadioButtonIndicator, widget ), widget );
+ r -= tqvisualRect( subRect( SR_RadioButtonIndicator, widget ), widget );
p->setClipRegion( r );
- p->fillRect( radiobutton->rect(), cg.background().light( QTC_HIGHLIGHT_FACTOR ) );
+ p->fillRect( radiobutton->rect(), cg.background().light( TQTC_HIGHLIGHT_FACTOR ) );
p->setClipping( false );
}
- int alignment = TQApplication::reverseLayout() ? AlignRight : AlignLeft;
+ int tqalignment = TQApplication::reverseLayout() ? AlignRight : AlignLeft;
- drawItem( p, r, alignment | AlignVCenter | ShowPrefix, cg,
+ drawItem( p, r, tqalignment | AlignVCenter | ShowPrefix, cg,
flags & Style_Enabled, radiobutton->pixmap(), radiobutton->text() );
if ( radiobutton->hasFocus() )
- drawPrimitive( PE_FocusRect, p,
- visualRect( subRect( SR_RadioButtonFocusRect, widget ), widget ), cg, flags );
+ tqdrawPrimitive( PE_FocusRect, p,
+ tqvisualRect( subRect( SR_RadioButtonFocusRect, widget ), widget ), cg, flags );
break;
}
default:
- KStyle::drawControl( control, p, widget, r, cg, flags, data );
+ KStyle::tqdrawControl( control, p, widget, r, cg, flags, data );
}
}
-void KlearlookStyle::drawControlMask( ControlElement control, TQPainter *p, const TQWidget *widget, const TQRect &r,
+void KlearlookStyle::tqdrawControlMask( ControlElement control, TQPainter *p, const TQWidget *widget, const TQRect &r,
const TQStyleOption &data ) const {
switch ( control ) {
case CE_PushButton:
if ( rounded ) {
- int offset = r.width() < QTC_MIN_BTN_SIZE || r.height() < QTC_MIN_BTN_SIZE ? 1 : 2;
+ int offset = r.width() < TQTC_MIN_BTN_SIZE || r.height() < TQTC_MIN_BTN_SIZE ? 1 : 2;
p->fillRect( r, color0 );
p->fillRect( r.x() + 1, r.y() + 1, r.width() - 2, r.height() - 2, color1 );
@@ -3012,19 +2991,19 @@ void KlearlookStyle::drawControlMask( ControlElement control, TQPainter *p, cons
p->fillRect( r, color1 );
break;
default:
- KStyle::drawControlMask( control, p, widget, r, data );
+ KStyle::tqdrawControlMask( control, p, widget, r, data );
}
}
-void KlearlookStyle::drawComplexControlMask( ComplexControl control, TQPainter *p, const TQWidget *widget, const TQRect &r,
+void KlearlookStyle::tqdrawComplexControlMask( ComplexControl control, TQPainter *p, const TQWidget *widget, const TQRect &r,
const TQStyleOption &data ) const {
switch ( control ) {
case CC_ToolButton:
case CC_ComboBox:
- drawControlMask( CE_PushButton, p, widget, r, data );
+ tqdrawControlMask( CE_PushButton, p, widget, r, data );
break;
default:
- KStyle::drawComplexControlMask( control, p, widget, r, data );
+ KStyle::tqdrawComplexControlMask( control, p, widget, r, data );
}
}
@@ -3040,7 +3019,7 @@ TQRect KlearlookStyle::subRect( SubRect subrect, const TQWidget *widget ) const
// if(button->isDefault() || button->autoDefault())
// {
- dbw1 = pixelMetric( PM_ButtonDefaultIndicator, widget );
+ dbw1 = tqpixelMetric( PM_ButtonDefaultIndicator, widget );
dbw2 = dbw1 * 2;
// }
@@ -3051,20 +3030,20 @@ TQRect KlearlookStyle::subRect( SubRect subrect, const TQWidget *widget ) const
break;
}
case SR_CheckBoxIndicator: {
- int h = pixelMetric( PM_IndicatorHeight );
+ int h = tqpixelMetric( PM_IndicatorHeight );
rect.setRect( ( widget->rect().height() - h ) >> 1,
( widget->rect().height() - h ) >> 1,
- pixelMetric( PM_IndicatorWidth ),
+ tqpixelMetric( PM_IndicatorWidth ),
h );
break;
}
case SR_RadioButtonIndicator: {
- int h = pixelMetric( PM_ExclusiveIndicatorHeight );
+ int h = tqpixelMetric( PM_ExclusiveIndicatorHeight );
rect.setRect( ( widget->rect().height() - h ) >> 1,
( widget->rect().height() - h ) >> 1,
- pixelMetric( PM_ExclusiveIndicatorWidth ), h );
+ tqpixelMetric( PM_ExclusiveIndicatorWidth ), h );
break;
}
case SR_ProgressBarContents:
@@ -3080,7 +3059,7 @@ TQRect KlearlookStyle::subRect( SubRect subrect, const TQWidget *widget ) const
return rect;
}
-void KlearlookStyle::drawComplexControl(
+void KlearlookStyle::tqdrawComplexControl(
ComplexControl control,
TQPainter *p,
const TQWidget *widget,
@@ -3104,19 +3083,19 @@ void KlearlookStyle::drawComplexControl(
SFlags bflags = flags, mflags = flags;
if ( APP_KORN == themedApp ) {
- drawPrimitive( PE_ButtonTool, p, button, cg, bflags, data );
+ tqdrawPrimitive( PE_ButtonTool, p, button, cg, bflags, data );
break;
}
bool onControlButtons = false,
- onToolbar = widget->parentWidget() && tqqt_cast<TQToolBar *>( widget->parentWidget() ),
+ onToolbar = widget->tqparentWidget() && ::tqqt_cast<TQToolBar *>( widget->tqparentWidget() ),
onExtender = !onToolbar &&
- widget->parentWidget() &&
- widget->parentWidget() ->inherits( "QToolBarExtensionWidget" ) &&
- tqqt_cast<TQToolBar *>( widget->parentWidget() ->parentWidget() );
+ widget->tqparentWidget() &&
+ widget->tqparentWidget() ->inherits( "TQToolBarExtensionWidget" ) &&
+ ::tqqt_cast<TQToolBar *>( widget->tqparentWidget() ->tqparentWidget() );
- if ( !onToolbar && !onExtender && widget->parentWidget() &&
- !qstrcmp( widget->parentWidget() ->name(), "qt_maxcontrols" ) )
+ if ( !onToolbar && !onExtender && widget->tqparentWidget() &&
+ !qstrcmp( widget->tqparentWidget() ->name(), "qt_maxcontrols" ) )
onControlButtons = true;
if ( active & SC_ToolButton )
@@ -3139,33 +3118,33 @@ void KlearlookStyle::drawComplexControl(
if ( !onToolbar && !onControlButtons )
bflags |= Style_Horizontal;
- drawPrimitive( PE_ButtonTool, p, button, cg, bflags, data );
+ tqdrawPrimitive( PE_ButtonTool, p, button, cg, bflags, data );
}
// Check whether to draw a background pixmap
- else if ( toolbutton->parentWidget() &&
- toolbutton->parentWidget() ->backgroundPixmap() &&
- !toolbutton->parentWidget() ->backgroundPixmap() ->isNull() ) {
+ else if ( toolbutton->tqparentWidget() &&
+ toolbutton->tqparentWidget() ->backgroundPixmap() &&
+ !toolbutton->tqparentWidget() ->backgroundPixmap() ->isNull() ) {
p->drawTiledPixmap( r,
- *( toolbutton->parentWidget() ->backgroundPixmap() ), toolbutton->pos() );
- } else if ( widget->parent() ) {
- if ( tqqt_cast<const TQToolBar *>( widget->parent() ) ) {
- TQToolBar * parent = ( TQToolBar* ) widget->parent();
+ *( toolbutton->tqparentWidget() ->backgroundPixmap() ), toolbutton->pos() );
+ } else if ( widget->tqparent() ) {
+ if ( ::tqqt_cast<const TQToolBar *>( widget->tqparent() ) ) {
+ TQToolBar * tqparent = ( TQToolBar* ) widget->tqparent();
-#ifdef QTC_GRADIENT_TOOLBARS_AND_MENUBARS
+#ifdef TQTC_GRADIENT_TOOLBARS_AND_MENUBARS
if ( APPEARANCE_FLAT != appearance )
drawBevelGradient( cg.background(), true, 0,
- p, parent->rect(), true, SHADE_BAR_LIGHT, SHADE_BAR_DARK );
+ p, tqparent->rect(), true, SHADE_BAR_LIGHT, SHADE_BAR_DARK );
else
#endif
- p->fillRect( parent->rect(), cg.background() );
- } else if ( widget->parent() ->inherits( "QToolBarExtensionWidget" ) ) {
- TQWidget * parent = ( TQWidget* ) widget->parent();
- TQToolBar *toolbar = ( TQToolBar* ) parent->parent();
+ p->fillRect( tqparent->rect(), cg.background() );
+ } else if ( widget->tqparent() ->inherits( "TQToolBarExtensionWidget" ) ) {
+ TQWidget * tqparent = ( TQWidget* ) widget->tqparent();
+ TQToolBar *toolbar = ( TQToolBar* ) tqparent->tqparent();
-#ifdef QTC_GRADIENT_TOOLBARS_AND_MENUBARS
+#ifdef TQTC_GRADIENT_TOOLBARS_AND_MENUBARS
if ( APPEARANCE_FLAT != appearance )
drawBevelGradient( cg.background(), true, 0, p, toolbar->rect(),
@@ -3180,27 +3159,27 @@ void KlearlookStyle::drawComplexControl(
if ( controls & SC_ToolButtonMenu ) {
if ( mflags & ( Style_Down | Style_On | Style_Raised ) )
- drawPrimitive( PE_ButtonDropDown, p, menuarea, cg, mflags, data );
- drawPrimitive( PE_ArrowDown, p, menuarea, cg, mflags, data );
+ tqdrawPrimitive( PE_ButtonDropDown, p, menuarea, cg, mflags, data );
+ tqdrawPrimitive( PE_ArrowDown, p, menuarea, cg, mflags, data );
}
if ( toolbutton->hasFocus() && !toolbutton->focusProxy() ) {
TQRect fr = toolbutton->rect();
fr.addCoords( 3, 3, -3, -3 );
- drawPrimitive( PE_FocusRect, p, fr, cg );
+ tqdrawPrimitive( PE_FocusRect, p, fr, cg );
}
break;
}
case CC_ComboBox: {
const TQComboBox *combobox = ( const TQComboBox * ) widget;
- TQRect frame( TQStyle::visualRect( querySubControlMetrics( CC_ComboBox,
+ TQRect frame( TQStyle::tqvisualRect( querySubControlMetrics( CC_ComboBox,
widget,SC_ComboBoxFrame,data ),widget ) ),
- arrow( TQStyle::visualRect( querySubControlMetrics( CC_ComboBox,
+ arrow( TQStyle::tqvisualRect( querySubControlMetrics( CC_ComboBox,
widget,SC_ComboBoxArrow,data),widget)),
- field( TQStyle::visualRect( querySubControlMetrics(CC_ComboBox,
+ field( TQStyle::tqvisualRect( querySubControlMetrics(CC_ComboBox,
widget,SC_ComboBoxEditField,data),widget));
const TQColor *use = buttonColors( cg );
@@ -3224,7 +3203,7 @@ void KlearlookStyle::drawComplexControl(
}
if ( controls & SC_ComboBoxArrow && arrow.isValid() ) {
- drawPrimitive( PE_ArrowDown, p, arrow, cg, flags & ~Style_MouseOver );
+ tqdrawPrimitive( PE_ArrowDown, p, arrow, cg, flags & ~Style_MouseOver );
p->setPen( use[ 4 ].light(70) );
arrow.addCoords( -1, -1, -1, 1 );
p->drawLine( arrow.left(), arrow.top(), arrow.left(), arrow.bottom() );
@@ -3232,10 +3211,10 @@ void KlearlookStyle::drawComplexControl(
if ( controls & SC_ComboBoxEditField && field.isValid() ) {
if ( ( flags & Style_HasFocus ) && ( ! combobox->editable() ) ) {
- TQRect fr = TQStyle::visualRect( subRect( SR_ComboBoxFocusRect, widget ), widget );
+ TQRect fr = TQStyle::tqvisualRect( subRect( SR_ComboBoxFocusRect, widget ), widget );
fr.addCoords( 0, 0, -2, 0 );
- drawPrimitive( PE_FocusRect,
+ tqdrawPrimitive( PE_FocusRect,
p, fr, cg, flags | Style_FocusAtBorder, TQStyleOption( cg.highlight() ) );
}
}
@@ -3257,32 +3236,32 @@ void KlearlookStyle::drawComplexControl(
qDrawShadePanel(
p, r, TQColorGroup( gray[ 5 ], gray[ NUM_SHADES ], gray[ 0 ],
gray[ 5 ], gray[ 2 ], cg.text(), gray[ NUM_SHADES ] ),
- true, pixelMetric( PM_SpinBoxFrameWidth )
+ true, tqpixelMetric( PM_SpinBoxFrameWidth )
);
if ( ( controls & SC_SpinWidgetUp ) && up.isValid() ) {
- PrimitiveElement pe = PE_SpinWidgetUp;
+ TQ_PrimitiveElement pe = PE_SpinWidgetUp;
SFlags upflags = flags;
if ( spinwidget->buttonSymbols() == TQSpinWidget::PlusMinus )
pe = PE_SpinWidgetPlus;
if ( !spinwidget->isUpEnabled() )
upflags ^= Style_Enabled;
- drawPrimitive(
+ tqdrawPrimitive(
pe, p, up, cg,
upflags | ( ( active == SC_SpinWidgetUp ) ? Style_On | Style_Sunken : Style_Raised )
);
}
if ( ( controls & SC_SpinWidgetDown ) && down.isValid() ) {
- PrimitiveElement pe = PE_SpinWidgetDown;
+ TQ_PrimitiveElement pe = PE_SpinWidgetDown;
SFlags downflags = flags;
if ( spinwidget->buttonSymbols() == TQSpinWidget::PlusMinus )
pe = PE_SpinWidgetMinus;
if ( !spinwidget->isDownEnabled() )
downflags ^= Style_Enabled;
- drawPrimitive(
+ tqdrawPrimitive(
pe, p, down, cg,
downflags | ( ( active == SC_SpinWidgetDown ) ? Style_On | Style_Sunken : Style_Raised )
);
@@ -3304,7 +3283,7 @@ void KlearlookStyle::drawComplexControl(
last( querySubControlMetrics( control, widget, SC_ScrollBarLast, data ) );
if ( ( controls & SC_ScrollBarSubLine ) && subline.isValid() )
- drawPrimitive(
+ tqdrawPrimitive(
PE_ScrollBarSubLine, p, subline, cg,
( hw && HOVER_SB_SUB == hover ? Style_MouseOver : Style_Default ) |
Style_Enabled |
@@ -3312,7 +3291,7 @@ void KlearlookStyle::drawComplexControl(
( ( scrollbar->orientation() == Qt::Horizontal ) ? Style_Horizontal : Style_Default )
);
if ( ( controls & SC_ScrollBarAddLine ) && addline.isValid() )
- drawPrimitive(
+ tqdrawPrimitive(
PE_ScrollBarAddLine, p, addline, cg,
( hw && HOVER_SB_ADD == hover ? Style_MouseOver : Style_Default ) |
Style_Enabled |
@@ -3320,27 +3299,27 @@ void KlearlookStyle::drawComplexControl(
( ( scrollbar->orientation() == Qt::Horizontal ) ? Style_Horizontal : Style_Default )
);
if ( ( controls & SC_ScrollBarSubPage ) && subpage.isValid() )
- drawPrimitive( PE_ScrollBarSubPage, p, subpage, cg,
+ tqdrawPrimitive( PE_ScrollBarSubPage, p, subpage, cg,
Style_Enabled |
( ( active == SC_ScrollBarSubPage ) ? Style_Down : Style_Default ) |
( ( scrollbar->orientation() == Qt::Horizontal ) ? Style_Horizontal : Style_Default ) );
if ( ( controls & SC_ScrollBarAddPage ) && addpage.isValid() )
- drawPrimitive( PE_ScrollBarAddPage, p, addpage, cg,
+ tqdrawPrimitive( PE_ScrollBarAddPage, p, addpage, cg,
( ( scrollbar->minValue() == scrollbar->maxValue() ) ? Style_Default : Style_Enabled ) |
( ( active == SC_ScrollBarAddPage ) ? Style_Down : Style_Default ) |
( ( scrollbar->orientation() == Qt::Horizontal ) ? Style_Horizontal : Style_Default ) );
if ( ( controls & SC_ScrollBarFirst ) && first.isValid() )
- drawPrimitive( PE_ScrollBarFirst, p, first, cg,
+ tqdrawPrimitive( PE_ScrollBarFirst, p, first, cg,
Style_Enabled |
( ( active == SC_ScrollBarFirst ) ? Style_Down : Style_Default ) |
( ( scrollbar->orientation() == Qt::Horizontal ) ? Style_Horizontal : Style_Default ) );
if ( ( controls & SC_ScrollBarLast ) && last.isValid() )
- drawPrimitive( PE_ScrollBarLast, p, last, cg,
+ tqdrawPrimitive( PE_ScrollBarLast, p, last, cg,
Style_Enabled |
( ( active == SC_ScrollBarLast ) ? Style_Down : Style_Default ) |
( ( scrollbar->orientation() == Qt::Horizontal ) ? Style_Horizontal : Style_Default ) );
if ( ( controls & SC_ScrollBarSlider ) && slider.isValid() ) {
- drawPrimitive( PE_ScrollBarSlider, p, slider, cg,
+ tqdrawPrimitive( PE_ScrollBarSlider, p, slider, cg,
( hw && HOVER_SB_SLIDER == hover ? Style_MouseOver : Style_Default ) |
Style_Enabled |
( ( active == SC_ScrollBarSlider ) ? Style_Down : Style_Default ) |
@@ -3348,7 +3327,7 @@ void KlearlookStyle::drawComplexControl(
// ### perhaps this should not be able to accept focus if maxedOut?
if ( scrollbar->hasFocus() )
- drawPrimitive( PE_FocusRect, p,
+ tqdrawPrimitive( PE_FocusRect, p,
TQRect( slider.x() + 2, slider.y() + 2, slider.width() - 5, slider.height() - 5 ),
cg, Style_Default );
}
@@ -3363,30 +3342,30 @@ void KlearlookStyle::drawComplexControl(
if ( ( controls & SC_SliderHandle ) && handle.isValid() )
drawSliderHandle( p, handle, cg, flags );
if ( controls & SC_SliderTickmarks )
- TQCommonStyle::drawComplexControl(
+ TQCommonStyle::tqdrawComplexControl(
control, p, widget, r, cg, flags, SC_SliderTickmarks, active, data
);
break;
}
default:
- KStyle::drawComplexControl( control, p, widget, r, cg, flags, controls, active, data );
+ KStyle::tqdrawComplexControl( control, p, widget, r, cg, flags, controls, active, data );
}
}
-TQRect KlearlookStyle::querySubControlMetrics( ComplexControl control, const TQWidget *widget, SubControl sc,
+TQRect KlearlookStyle::querySubControlMetrics( TQ_ComplexControl control, const TQWidget *widget, SubControl sc,
const TQStyleOption &data ) const {
switch ( control ) {
case CC_SpinWidget: {
if ( !widget )
return TQRect();
- int fw = pixelMetric( PM_SpinBoxFrameWidth, 0 );
+ int fw = tqpixelMetric( PM_SpinBoxFrameWidth, 0 );
TQSize bs;
bs.setHeight( widget->height() >> 1 );
if ( bs.height() < 8 )
bs.setHeight( 8 );
- bs.setWidth( QMIN( bs.height() * 8 / 6, widget->width() / 4 ) );
+ bs.setWidth( TQMIN( bs.height() * 8 / 6, widget->width() / 4 ) );
bs = bs.expandedTo( TQApplication::globalStrut() );
if ( !( bs.width() % 2 ) )
@@ -3416,7 +3395,7 @@ TQRect KlearlookStyle::querySubControlMetrics( ComplexControl control, const TQW
}
}
-int KlearlookStyle::pixelMetric( PixelMetric metric, const TQWidget *widget ) const {
+int KlearlookStyle::tqpixelMetric( PixelMetric metric, const TQWidget *widget ) const {
switch ( metric ) {
case PM_MenuButtonIndicator:
return 7;
@@ -3425,23 +3404,21 @@ int KlearlookStyle::pixelMetric( PixelMetric metric, const TQWidget *widget ) co
}
case PM_ButtonMargin:
return 5;
-#if QT_VERSION >= 0x030200
case PM_TabBarTabShiftVertical: {
- const TQTabBar *tb = tqqt_cast<const TQTabBar *>( widget );
+ const TQTabBar *tb = ::tqqt_cast<const TQTabBar *>( widget );
- return TQTabBar::RoundedAbove == tb->shape() || TQTabBar::TriangularAbove == tb->shape()
+ return TQTabBar::RoundedAbove == tb->tqshape() || TQTabBar::TriangularAbove == tb->tqshape()
? 1
: -1;
}
case PM_TabBarTabShiftHorizontal:
return 0;
-#endif
case PM_TabBarTabVSpace: {
const TQTabBar * tb = ( const TQTabBar * ) widget;
- if ( tb->shape() == TQTabBar::RoundedAbove ||
- tb->shape() == TQTabBar::RoundedBelow )
+ if ( tb->tqshape() == TQTabBar::RoundedAbove ||
+ tb->tqshape() == TQTabBar::RoundedBelow )
return 12;
else
return 4;
@@ -3454,21 +3431,21 @@ int KlearlookStyle::pixelMetric( PixelMetric metric, const TQWidget *widget ) co
case PM_ButtonDefaultIndicator:
return IND_BORDER == defBtnIndicator ? 1 : 0;
case PM_DefaultFrameWidth:
- return borderFrame && widget && ( tqqt_cast<const TQTabBar *>( widget ) ||
- tqqt_cast<const TQWidgetStack *>( widget ) ||
- tqqt_cast<const TQPopupMenu *>( widget ) )
+ return borderFrame && widget && ( ::tqqt_cast<const TQTabBar *>( widget ) ||
+ ::tqqt_cast<const TQWidgetStack *>( widget ) ||
+ ::tqqt_cast<const TQPopupMenu *>( widget ) )
? 2
- : QTC_DEF_FRAME_WIDTH;
+ : TQTC_DEF_FRAME_WIDTH;
case PM_SpinBoxFrameWidth:
return 1;
case PM_MenuBarFrameWidth:
return 1;
case PM_IndicatorWidth:
case PM_IndicatorHeight:
- return QTC_CHECK_SIZE;
+ return TQTC_CHECK_SIZE;
case PM_ExclusiveIndicatorWidth:
case PM_ExclusiveIndicatorHeight:
- return QTC_RADIO_SIZE;
+ return TQTC_RADIO_SIZE;
case PM_TabBarTabOverlap:
return 1;
case PM_ProgressBarChunkWidth:
@@ -3490,7 +3467,7 @@ int KlearlookStyle::pixelMetric( PixelMetric metric, const TQWidget *widget ) co
case PM_MaximumDragDistance:
return -1;
default:
- return KStyle::pixelMetric( metric, widget );
+ return KStyle::tqpixelMetric( metric, widget );
}
}
@@ -3503,7 +3480,7 @@ int KlearlookStyle::kPixelMetric( KStylePixelMetric kpm, const TQWidget *widget
}
}
-TQSize KlearlookStyle::sizeFromContents( ContentsType t,
+TQSize KlearlookStyle::tqsizeFromContents( ContentsType t,
const TQWidget *widget,
const TQSize &s,
const TQStyleOption &opt ) const {
@@ -3519,8 +3496,8 @@ TQSize KlearlookStyle::sizeFromContents( ContentsType t,
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() ) {
@@ -3530,22 +3507,22 @@ TQSize KlearlookStyle::sizeFromContents( ContentsType t,
h = 8;
} else {
if ( mi->pixmap() ) {
- h = QMAX( h, mi->pixmap() ->height() + 2 );
+ h = TQMAX( h, mi->pixmap() ->height() + 2 );
} else {
- h = QMAX( h, 21 );
+ h = TQMAX( h, 21 );
TQSettings s;
if ( menuIcons )
- h = QMAX( h, popup->fontMetrics().height() + MENU_POPUP_ITEM_HIGH_HI );
+ h = TQMAX( h, popup->fontMetrics().height() + MENU_POPUP_ITEM_HIGH_HI );
else
- h = QMAX( h, popup->fontMetrics().height() + MENU_POPUP_ITEM_HIGH_LO );
+ h = TQMAX( h, popup->fontMetrics().height() + MENU_POPUP_ITEM_HIGH_LO );
}
if ( mi->iconSet() ) {
- h = QMAX( h, mi->iconSet() ->pixmap( TQIconSet::Small, TQIconSet::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;
@@ -3569,8 +3546,8 @@ TQSize KlearlookStyle::sizeFromContents( ContentsType t,
case CT_PushButton: {
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 );
+ 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 button size
@@ -3578,23 +3555,23 @@ TQSize KlearlookStyle::sizeFromContents( ContentsType t,
}
case CT_ToolButton: {
- if ( widget->parent() && tqqt_cast<TQToolBar*>( widget->parent() ) )
+ if ( widget->tqparent() && ::tqqt_cast<TQToolBar*>( widget->tqparent() ) )
return TQSize( s.width() + 2 * 4, 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 KlearlookStyle::styleHint( StyleHint stylehint, const TQWidget *widget, const TQStyleOption &option, QStyleHintReturn *returnData ) const {
+int KlearlookStyle::tqstyleHint( StyleHint stylehint, const TQWidget *widget, const TQStyleOption &option, TQStyleHintReturn *returnData ) const {
switch ( stylehint ) {
case SH_EtchDisabledText:
case SH_Slider_SnapToValue:
@@ -3616,7 +3593,7 @@ int KlearlookStyle::styleHint( StyleHint stylehint, const TQWidget *widget, cons
case SH_PopupMenu_AllowActiveAndDisabled:
return 0;
default:
- return KStyle::styleHint( stylehint, widget, option, returnData );
+ return KStyle::tqstyleHint( stylehint, widget, option, returnData );
}
}
@@ -3852,7 +3829,7 @@ void KlearlookStyle::drawSliderGroove
TQRect fr( groove );
fr.addCoords( -1, -1, 1, 1 );
- drawPrimitive( PE_FocusRect, p, fr, TQColorGroup() );
+ tqdrawPrimitive( PE_FocusRect, p, fr, TQColorGroup() );
}
if ( Qt::Horizontal == slider->orientation() ) {
@@ -3873,12 +3850,12 @@ void KlearlookStyle::drawSliderGroove
}
void KlearlookStyle::shadeColors( const TQColor &base, TQColor *vals ) const {
- QTC_SHADES
+ TQTC_SHADES
int i;
for ( i = 0; i < NUM_SHADES; ++i )
- shade( base, &vals[ i ], QTC_SHADE( appearance, contrast, i ) );
+ shade( base, &vals[ i ], TQTC_SHADE( appearance, contrast, i ) );
vals[ NUM_SHADES ] = base;
}
@@ -3908,10 +3885,8 @@ bool KlearlookStyle::redrawHoverWidget() {
TQPoint cursor( TQCursor::pos() ),
widgetZero( hoverWidget->mapToGlobal( TQPoint( 0, 0 ) ) );
-#if QT_VERSION >= 0x030200
-
//
- // Qt>=3.2 sets the sensitive part of a check/radio to the image + label -> anything else
+ // TQt>=3.2 sets the sensitive part of a check/radio to the image + label -> anything else
// is not sensitive. But,
// the widget can ocupy a larger area - and this whole are will react to mouse over.
// This needs to be coounteracted
@@ -3920,25 +3895,24 @@ bool KlearlookStyle::redrawHoverWidget() {
if ( rb ) {
TQRect rect( widgetZero.x(), widgetZero.y(),
- visualRect( subRect( SR_RadioButtonFocusRect, rb ), rb ).width() +
- pixelMetric( PM_ExclusiveIndicatorWidth ) + 4, hoverWidget->height() );
+ tqvisualRect( subRect( SR_RadioButtonFocusRect, rb ), rb ).width() +
+ tqpixelMetric( PM_ExclusiveIndicatorWidth ) + 4, hoverWidget->height() );
- hover = rect.contains( cursor ) ? HOVER_RADIO : HOVER_NONE;
- return ( HOVER_NONE != hover && !rect.contains( oldCursor ) ) ||
- ( HOVER_NONE == hover && rect.contains( oldCursor ) );
+ hover = rect.tqcontains( cursor ) ? HOVER_RADIO : HOVER_NONE;
+ return ( HOVER_NONE != hover && !rect.tqcontains( oldCursor ) ) ||
+ ( HOVER_NONE == hover && rect.tqcontains( oldCursor ) );
} else {
TQCheckBox *cb = dynamic_cast<TQCheckBox *>( hoverWidget );
if ( cb ) {
TQRect rect( widgetZero.x(), widgetZero.y(),
- visualRect( subRect( SR_CheckBoxFocusRect, cb ), cb ).width() +
- pixelMetric( PM_IndicatorWidth ) + 4, hoverWidget->height() );
+ tqvisualRect( subRect( SR_CheckBoxFocusRect, cb ), cb ).width() +
+ tqpixelMetric( PM_IndicatorWidth ) + 4, hoverWidget->height() );
- hover = rect.contains( cursor ) ? HOVER_CHECK : HOVER_NONE;
- return ( HOVER_NONE != hover && !rect.contains( oldCursor ) ) ||
- ( HOVER_NONE == hover && rect.contains( oldCursor ) );
+ hover = rect.tqcontains( cursor ) ? HOVER_CHECK : HOVER_NONE;
+ return ( HOVER_NONE != hover && !rect.tqcontains( oldCursor ) ) ||
+ ( HOVER_NONE == hover && rect.tqcontains( oldCursor ) );
} else {
-#endif
TQScrollBar *sb = dynamic_cast<TQScrollBar *>( hoverWidget );
if ( sb ) // So, are we over add button, sub button, slider, or none?
@@ -3954,21 +3928,21 @@ bool KlearlookStyle::redrawHoverWidget() {
slider.moveLeft( slider.x() + widgetZero.x() );
slider.moveTop( slider.y() + widgetZero.y() );
- if ( slider.contains( cursor ) )
+ if ( slider.tqcontains( cursor ) )
hover = HOVER_SB_SLIDER;
- else if ( subline.contains( cursor ) )
+ else if ( subline.tqcontains( cursor ) )
hover = HOVER_SB_SUB;
- else if ( addline.contains( cursor ) )
+ else if ( addline.tqcontains( cursor ) )
hover = HOVER_SB_ADD;
else
hover = HOVER_NONE;
- return ( HOVER_SB_SLIDER == hover && !slider.contains( oldCursor ) ) ||
- ( HOVER_SB_SLIDER != hover && slider.contains( oldCursor ) ) ||
- ( HOVER_SB_SUB == hover && !subline.contains( oldCursor ) ) ||
- ( HOVER_SB_SUB != hover && subline.contains( oldCursor ) ) ||
- ( HOVER_SB_ADD == hover && !addline.contains( oldCursor ) ) ||
- ( HOVER_SB_ADD != hover && addline.contains( oldCursor ) );
+ return ( HOVER_SB_SLIDER == hover && !slider.tqcontains( oldCursor ) ) ||
+ ( HOVER_SB_SLIDER != hover && slider.tqcontains( oldCursor ) ) ||
+ ( HOVER_SB_SUB == hover && !subline.tqcontains( oldCursor ) ) ||
+ ( HOVER_SB_SUB != hover && subline.tqcontains( oldCursor ) ) ||
+ ( HOVER_SB_ADD == hover && !addline.tqcontains( oldCursor ) ) ||
+ ( HOVER_SB_ADD != hover && addline.tqcontains( oldCursor ) );
} else {
#if KDE_VERSION >= 0x30400
TQToolButton *tb = dynamic_cast<TQToolButton *>( hoverWidget );
@@ -3994,22 +3968,22 @@ bool KlearlookStyle::redrawHoverWidget() {
int s = 0;
bool redraw = false;
- hover = rect.contains( cursor ) ? HOVER_HEADER : HOVER_NONE;
- hoverSect = QTC_NO_SECT;
+ hover = rect.tqcontains( cursor ) ? HOVER_HEADER : HOVER_NONE;
+ hoverSect = TQTC_NO_SECT;
- for ( s = 0; s < hd->count() && ( QTC_NO_SECT == hoverSect || !redraw ); ++s ) {
+ for ( s = 0; s < hd->count() && ( TQTC_NO_SECT == hoverSect || !redraw ); ++s ) {
TQRect r( hd->sectionRect( s ) );
r.moveLeft( r.x() + widgetZero.x() );
r.moveTop( r.y() + widgetZero.y() );
- bool hasNew = r.contains( cursor );
+ bool hasNew = r.tqcontains( cursor );
if ( hasNew )
hoverSect = s;
if ( !redraw ) {
- bool hasOld = r.contains( oldCursor );
+ bool hasOld = r.tqcontains( oldCursor );
if ( ( hasNew && !hasOld ) || ( !hasNew && hasOld ) )
redraw = true;
@@ -4024,11 +3998,8 @@ bool KlearlookStyle::redrawHoverWidget() {
#endif
}
-#if QT_VERSION >= 0x030200
-
}
}
-#endif
return false;
}