@ -690,12 +690,12 @@ bool KlearlookStyle::eventFilter( TQObject *object, TQEvent *event ) {
if ( toolbar )
horiz_grad = toolbar - > orientation ( ) = = TQt : : Vertical ;
drawBevelGradient ( parent - > tq colorGroup( ) . background ( ) , true , 1 , & TQPainter ( widget ) ,
drawBevelGradient ( parent - > colorGroup( ) . 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 - > tq colorGroup( ) . background ( ) ) ;
TQPainter ( widget ) . fillRect ( widget - > rect ( ) , parent - > colorGroup( ) . background ( ) ) ;
# endif
return false ; // Now draw the contents
@ -707,10 +707,10 @@ bool KlearlookStyle::eventFilter( TQObject *object, TQEvent *event ) {
TQPainter painter ( frame ) ;
if ( TQFrame : : VLine = = frame - > frameShape ( ) )
tqdrawPrimitive ( PE_DockWindowSeparator , & painter ,
frame - > rect ( ) , frame - > tq colorGroup( ) , Style_Horizontal ) ;
frame - > rect ( ) , frame - > colorGroup( ) , Style_Horizontal ) ;
else if ( TQFrame : : HLine = = frame - > frameShape ( ) )
tqdrawPrimitive ( PE_DockWindowSeparator , & painter ,
frame - > rect ( ) , frame - > tq colorGroup( ) ) ;
frame - > rect ( ) , frame - > colorGroup( ) ) ;
else
return false ;
return true ; // been drawn!
@ -2196,7 +2196,7 @@ void KlearlookStyle::drawKStylePrimitive( KStylePrimitive kpe, TQPainter *p, con
}
}
void KlearlookStyle : : tq drawControl(
void KlearlookStyle : : drawControl(
ControlElement control ,
TQPainter * p ,
const TQWidget * widget ,
@ -2375,7 +2375,7 @@ void KlearlookStyle::tqdrawControl(
p - > fillRect ( fr , flags & Style_Selected ? cg . background ( ) : gray [ 2 ] ) ;
break ;
default :
KStyle : : tq drawControl( control , p , widget , r , cg , flags , data ) ;
KStyle : : drawControl( control , p , widget , r , cg , flags , data ) ;
}
} else {
TQRect br ( r ) ;
@ -2466,10 +2466,10 @@ void KlearlookStyle::tqdrawControl(
if ( t - > identifier ( ) = = tb - > currentTab ( ) ) {
if ( TQTabBar : : RoundedAbove = = tb - > tqshape ( ) | | TQTabBar : : TriangularAbove = = tb - > tqshape ( ) )
tr . setBottom ( tr . bottom ( ) - tq pixelMetric( TQStyle : : PM_TabBarTabShiftVertical , tb ) ) ;
tr . setBottom ( tr . bottom ( ) - pixelMetric( TQStyle : : PM_TabBarTabShiftVertical , tb ) ) ;
} else
if ( TQTabBar : : RoundedBelow = = tb - > tqshape ( ) | | TQTabBar : : TriangularBelow = = tb - > tqshape ( ) )
tr . setTop ( tr . top ( ) + tq pixelMetric( TQStyle : : PM_TabBarTabShiftVertical , tb ) ) ;
tr . setTop ( tr . top ( ) + pixelMetric( TQStyle : : PM_TabBarTabShiftVertical , tb ) ) ;
drawItem ( p , tr , AlignCenter | ShowPrefix , cg , flags & Style_Enabled , 0 , t - > text ( ) ) ;
@ -2489,15 +2489,15 @@ void KlearlookStyle::tqdrawControl(
// Shift button contents if pushed.
if ( active ) {
x + = tq pixelMetric( PM_ButtonShiftHorizontal , widget ) ;
y + = tq pixelMetric( PM_ButtonShiftVertical , widget ) ;
x + = pixelMetric( PM_ButtonShiftHorizontal , widget ) ;
y + = pixelMetric( PM_ButtonShiftVertical , widget ) ;
flags | = Style_Sunken ;
}
// Does the button have a popup menu?
if ( button - > isMenuButton ( ) ) {
int dx = tq pixelMetric( PM_MenuButtonIndicator , widget ) ,
margin = tq pixelMetric( PM_ButtonMargin , widget ) ;
int dx = pixelMetric( PM_MenuButtonIndicator , widget ) ,
margin = pixelMetric( PM_ButtonMargin , widget ) ;
if ( button - > iconSet ( ) & & ! button - > iconSet ( ) - > isNull ( ) & &
( dx + button - > iconSet ( ) - > pixmap ( TQIconSet : : Small , TQIconSet : : Normal ,
@ -2505,7 +2505,7 @@ void KlearlookStyle::tqdrawControl(
cornArrow = true ; //To little room. Draw the arrow in the corner, don't adjust the widget
else {
tqdrawPrimitive ( PE_ArrowDown ,
p , tq visualRect( TQRect (
p , visualRect( TQRect (
( x + w ) - ( dx + margin ) , y , dx ,
h ) , r ) , cg , flags , data ) ;
@ -2547,7 +2547,7 @@ void KlearlookStyle::tqdrawControl(
}
if ( cornArrow ) //Draw over the icon
tqdrawPrimitive ( PE_ArrowDown , p , tq visualRect( TQRect ( x + w - 6 , x + h - 6 , 7 , 7 ) , r ) ,
tqdrawPrimitive ( PE_ArrowDown , p , visualRect( TQRect ( x + w - 6 , x + h - 6 , 7 , 7 ) , r ) ,
cg , flags , data ) ;
if ( xo & & iw ) {
@ -2566,16 +2566,16 @@ void KlearlookStyle::tqdrawControl(
for ( i = 0 ; i < j ; i + + )
drawItem ( p , TQRect ( x + i , y , w , h ) ,
AlignCenter | ShowPrefix ,
button - > tq colorGroup( ) ,
button - > colorGroup( ) ,
button - > isEnabled ( ) ,
button - > pixmap ( ) ,
button - > text ( ) , - 1 ,
& button - > tq colorGroup( ) . buttonText ( ) ) ;
& button - > colorGroup( ) . buttonText ( ) ) ;
//Draw a focus rect if the button has focus
if ( flags & Style_HasFocus )
tqdrawPrimitive ( PE_FocusRect , p ,
TQStyle : : tq visualRect( subRect ( SR_PushButtonFocusRect , widget ) , widget ) , cg , flags ) ;
TQStyle : : visualRect( subRect ( SR_PushButtonFocusRect , widget ) , widget ) , cg , flags ) ;
break ;
}
@ -2636,10 +2636,10 @@ void KlearlookStyle::tqdrawControl(
bool reverse = TQApplication : : reverseLayout ( ) ;
if ( reverse ) {
cr = tq visualRect( cr , r ) ;
sr = tq visualRect( sr , r ) ;
tr = tq visualRect( tr , r ) ;
ir = tq visualRect( ir , r ) ;
cr = visualRect( cr , r ) ;
sr = visualRect( sr , r ) ;
tr = visualRect( tr , r ) ;
ir = visualRect( ir , r ) ;
}
if ( mi - > iconSet ( ) & & menuIcons ) {
@ -2647,7 +2647,7 @@ void KlearlookStyle::tqdrawControl(
TQIconSet : : Mode mode = flags & Style_Active
? ( mi - > isEnabled ( ) ? TQIconSet : : Active : TQIconSet : : Disabled )
: ( mi - > isEnabled ( ) ? TQIconSet : : Normal : TQIconSet : : Disabled ) ;
cr = tq visualRect( TQRect ( x , y , maxpmw , h ) , r ) ;
cr = visualRect( 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
@ -2879,7 +2879,7 @@ void KlearlookStyle::tqdrawControl(
case CE_PushButton : {
const TQPushButton * button = static_cast < const TQPushButton * > ( widget ) ;
TQRect br ( r ) ;
int dbi = tq pixelMetric( PM_ButtonDefaultIndicator , widget ) ;
int dbi = pixelMetric( PM_ButtonDefaultIndicator , widget ) ;
if ( rounded & & isFormWidget ( widget ) )
formMode = true ;
@ -2914,10 +2914,10 @@ void KlearlookStyle::tqdrawControl(
! isFormWidget ( widget ) ) {
TQRect cr ( checkbox - > rect ( ) ) ;
TQRegion r ( TQRect ( cr . x ( ) , cr . y ( ) ,
tq visualRect( subRect ( SR_CheckBoxFocusRect , widget ) , widget ) . width ( ) +
tq pixelMetric( PM_IndicatorWidth ) + 4 , cr . height ( ) ) ) ;
visualRect( subRect ( SR_CheckBoxFocusRect , widget ) , widget ) . width ( ) +
pixelMetric( PM_IndicatorWidth ) + 4 , cr . height ( ) ) ) ;
r - = tq visualRect( subRect ( SR_CheckBoxIndicator , widget ) , widget ) ;
r - = visualRect( subRect ( SR_CheckBoxIndicator , widget ) , widget ) ;
p - > setClipRegion ( r ) ;
p - > fillRect ( checkbox - > rect ( ) , cg . background ( ) . light ( TQTC_HIGHLIGHT_FACTOR ) ) ;
p - > setClipping ( false ) ;
@ -2929,9 +2929,9 @@ void KlearlookStyle::tqdrawControl(
if ( checkbox - > hasFocus ( ) )
tqdrawPrimitive ( PE_FocusRect , p ,
tq visualRect( subRect ( SR_CheckBoxFocusRect , widget ) , widget ) , cg , flags ) ;
visualRect( subRect ( SR_CheckBoxFocusRect , widget ) , widget ) , cg , flags ) ;
} else
KStyle : : tq drawControl( control , p , widget , r , cg , flags , data ) ;
KStyle : : drawControl( control , p , widget , r , cg , flags , data ) ;
break ;
case CE_RadioButton :
formMode = isFormWidget ( widget ) ;
@ -2947,10 +2947,10 @@ void KlearlookStyle::tqdrawControl(
! isFormWidget ( widget ) ) {
TQRect rb ( radiobutton - > rect ( ) ) ;
TQRegion r ( TQRect ( rb . x ( ) , rb . y ( ) ,
tq visualRect( subRect ( SR_RadioButtonFocusRect , widget ) , widget ) . width ( ) +
tq pixelMetric( PM_ExclusiveIndicatorWidth ) + 4 , rb . height ( ) ) ) ;
visualRect( subRect ( SR_RadioButtonFocusRect , widget ) , widget ) . width ( ) +
pixelMetric( PM_ExclusiveIndicatorWidth ) + 4 , rb . height ( ) ) ) ;
r - = tq visualRect( subRect ( SR_RadioButtonIndicator , widget ) , widget ) ;
r - = visualRect( subRect ( SR_RadioButtonIndicator , widget ) , widget ) ;
p - > setClipRegion ( r ) ;
p - > fillRect ( radiobutton - > rect ( ) , cg . background ( ) . light ( TQTC_HIGHLIGHT_FACTOR ) ) ;
p - > setClipping ( false ) ;
@ -2963,15 +2963,15 @@ void KlearlookStyle::tqdrawControl(
if ( radiobutton - > hasFocus ( ) )
tqdrawPrimitive ( PE_FocusRect , p ,
tq visualRect( subRect ( SR_RadioButtonFocusRect , widget ) , widget ) , cg , flags ) ;
visualRect( subRect ( SR_RadioButtonFocusRect , widget ) , widget ) , cg , flags ) ;
break ;
}
default :
KStyle : : tq drawControl( control , p , widget , r , cg , flags , data ) ;
KStyle : : drawControl( control , p , widget , r , cg , flags , data ) ;
}
}
void KlearlookStyle : : tq drawControlMask( ControlElement control , TQPainter * p , const TQWidget * widget , const TQRect & r ,
void KlearlookStyle : : drawControlMask( ControlElement control , TQPainter * p , const TQWidget * widget , const TQRect & r ,
const TQStyleOption & data ) const {
switch ( control ) {
case CE_PushButton :
@ -2991,19 +2991,19 @@ void KlearlookStyle::tqdrawControlMask( ControlElement control, TQPainter *p, co
p - > fillRect ( r , color1 ) ;
break ;
default :
KStyle : : tq drawControlMask( control , p , widget , r , data ) ;
KStyle : : drawControlMask( control , p , widget , r , data ) ;
}
}
void KlearlookStyle : : tq drawComplexControlMask( ComplexControl control , TQPainter * p , const TQWidget * widget , const TQRect & r ,
void KlearlookStyle : : drawComplexControlMask( ComplexControl control , TQPainter * p , const TQWidget * widget , const TQRect & r ,
const TQStyleOption & data ) const {
switch ( control ) {
case CC_ToolButton :
case CC_ComboBox :
tq drawControlMask( CE_PushButton , p , widget , r , data ) ;
drawControlMask( CE_PushButton , p , widget , r , data ) ;
break ;
default :
KStyle : : tq drawComplexControlMask( control , p , widget , r , data ) ;
KStyle : : drawComplexControlMask( control , p , widget , r , data ) ;
}
}
@ -3019,7 +3019,7 @@ TQRect KlearlookStyle::subRect( SubRect subrect, const TQWidget *widget ) const
// if(button->isDefault() || button->autoDefault())
// {
dbw1 = tq pixelMetric( PM_ButtonDefaultIndicator , widget ) ;
dbw1 = pixelMetric( PM_ButtonDefaultIndicator , widget ) ;
dbw2 = dbw1 * 2 ;
// }
@ -3030,20 +3030,20 @@ TQRect KlearlookStyle::subRect( SubRect subrect, const TQWidget *widget ) const
break ;
}
case SR_CheckBoxIndicator : {
int h = tq pixelMetric( PM_IndicatorHeight ) ;
int h = pixelMetric( PM_IndicatorHeight ) ;
rect . setRect ( ( widget - > rect ( ) . height ( ) - h ) > > 1 ,
( widget - > rect ( ) . height ( ) - h ) > > 1 ,
tq pixelMetric( PM_IndicatorWidth ) ,
pixelMetric( PM_IndicatorWidth ) ,
h ) ;
break ;
}
case SR_RadioButtonIndicator : {
int h = tq pixelMetric( PM_ExclusiveIndicatorHeight ) ;
int h = pixelMetric( PM_ExclusiveIndicatorHeight ) ;
rect . setRect ( ( widget - > rect ( ) . height ( ) - h ) > > 1 ,
( widget - > rect ( ) . height ( ) - h ) > > 1 ,
tq pixelMetric( PM_ExclusiveIndicatorWidth ) , h ) ;
pixelMetric( PM_ExclusiveIndicatorWidth ) , h ) ;
break ;
}
case SR_ProgressBarContents :
@ -3059,7 +3059,7 @@ TQRect KlearlookStyle::subRect( SubRect subrect, const TQWidget *widget ) const
return rect ;
}
void KlearlookStyle : : tq drawComplexControl(
void KlearlookStyle : : drawComplexControl(
ComplexControl control ,
TQPainter * p ,
const TQWidget * widget ,
@ -3173,13 +3173,13 @@ void KlearlookStyle::tqdrawComplexControl(
case CC_ComboBox : {
const TQComboBox * combobox = ( const TQComboBox * ) widget ;
TQRect frame ( TQStyle : : tq visualRect( querySubControlMetrics ( CC_ComboBox ,
TQRect frame ( TQStyle : : visualRect( querySubControlMetrics ( CC_ComboBox ,
widget , SC_ComboBoxFrame , data ) , widget ) ) ,
arrow ( TQStyle : : tq visualRect( querySubControlMetrics ( CC_ComboBox ,
arrow ( TQStyle : : visualRect( querySubControlMetrics ( CC_ComboBox ,
widget , SC_ComboBoxArrow , data ) , widget ) ) ,
field ( TQStyle : : tq visualRect( querySubControlMetrics ( CC_ComboBox ,
field ( TQStyle : : visualRect( querySubControlMetrics ( CC_ComboBox ,
widget , SC_ComboBoxEditField , data ) , widget ) ) ;
const TQColor * use = buttonColors ( cg ) ;
@ -3211,7 +3211,7 @@ void KlearlookStyle::tqdrawComplexControl(
if ( controls & SC_ComboBoxEditField & & field . isValid ( ) ) {
if ( ( flags & Style_HasFocus ) & & ( ! combobox - > editable ( ) ) ) {
TQRect fr = TQStyle : : tq visualRect( subRect ( SR_ComboBoxFocusRect , widget ) , widget ) ;
TQRect fr = TQStyle : : visualRect( subRect ( SR_ComboBoxFocusRect , widget ) , widget ) ;
fr . addCoords ( 0 , 0 , - 2 , 0 ) ;
tqdrawPrimitive ( PE_FocusRect ,
@ -3236,7 +3236,7 @@ void KlearlookStyle::tqdrawComplexControl(
qDrawShadePanel (
p , r , TQColorGroup ( gray [ 5 ] , gray [ NUM_SHADES ] , gray [ 0 ] ,
gray [ 5 ] , gray [ 2 ] , cg . text ( ) , gray [ NUM_SHADES ] ) ,
true , tq pixelMetric( PM_SpinBoxFrameWidth )
true , pixelMetric( PM_SpinBoxFrameWidth )
) ;
if ( ( controls & SC_SpinWidgetUp ) & & up . isValid ( ) ) {
@ -3342,13 +3342,13 @@ void KlearlookStyle::tqdrawComplexControl(
if ( ( controls & SC_SliderHandle ) & & handle . isValid ( ) )
drawSliderHandle ( p , handle , cg , flags ) ;
if ( controls & SC_SliderTickmarks )
TQCommonStyle : : tq drawComplexControl(
TQCommonStyle : : drawComplexControl(
control , p , widget , r , cg , flags , SC_SliderTickmarks , active , data
) ;
break ;
}
default :
KStyle : : tq drawComplexControl( control , p , widget , r , cg , flags , controls , active , data ) ;
KStyle : : drawComplexControl( control , p , widget , r , cg , flags , controls , active , data ) ;
}
}
@ -3359,7 +3359,7 @@ TQRect KlearlookStyle::querySubControlMetrics( TQ_ComplexControl control, const
if ( ! widget )
return TQRect ( ) ;
int fw = tq pixelMetric( PM_SpinBoxFrameWidth , 0 ) ;
int fw = pixelMetric( PM_SpinBoxFrameWidth , 0 ) ;
TQSize bs ;
bs . setHeight ( widget - > height ( ) > > 1 ) ;
@ -3395,7 +3395,7 @@ TQRect KlearlookStyle::querySubControlMetrics( TQ_ComplexControl control, const
}
}
int KlearlookStyle : : tq pixelMetric( PixelMetric metric , const TQWidget * widget ) const {
int KlearlookStyle : : pixelMetric( PixelMetric metric , const TQWidget * widget ) const {
switch ( metric ) {
case PM_MenuButtonIndicator :
return 7 ;
@ -3467,7 +3467,7 @@ int KlearlookStyle::tqpixelMetric( PixelMetric metric, const TQWidget *widget )
case PM_MaximumDragDistance :
return - 1 ;
default :
return KStyle : : tq pixelMetric( metric , widget ) ;
return KStyle : : pixelMetric( metric , widget ) ;
}
}
@ -3496,8 +3496,8 @@ TQSize KlearlookStyle::tqsizeFromContents( ContentsType t,
bool checkable = popup - > isCheckable ( ) ;
if ( mi - > custom ( ) ) {
w = mi - > custom ( ) - > tq sizeHint( ) . width ( ) ;
h = mi - > custom ( ) - > tq sizeHint( ) . height ( ) ;
w = mi - > custom ( ) - > sizeHint( ) . width ( ) ;
h = mi - > custom ( ) - > sizeHint( ) . height ( ) ;
if ( ! mi - > custom ( ) - > fullSpan ( ) )
h + = 4 ;
} else if ( mi - > widget ( ) ) {
@ -3546,8 +3546,8 @@ TQSize KlearlookStyle::tqsizeFromContents( ContentsType t,
case CT_PushButton : {
const TQPushButton * btn = static_cast < const TQPushButton * > ( widget ) ;
int w = s . width ( ) + 2 * tq pixelMetric( PM_ButtonMargin , widget ) ;
int h = s . height ( ) + 2 * tq pixelMetric( PM_ButtonMargin , widget ) ;
int w = s . width ( ) + 2 * pixelMetric( PM_ButtonMargin , widget ) ;
int h = s . height ( ) + 2 * pixelMetric( PM_ButtonMargin , widget ) ;
if ( btn - > text ( ) . isEmpty ( ) & & s . width ( ) < 32 )
return TQSize ( w , h ) ;
// return button size
@ -3571,7 +3571,7 @@ TQSize KlearlookStyle::tqsizeFromContents( ContentsType t,
int KlearlookStyle : : tq styleHint( StyleHint stylehint , const TQWidget * widget , const TQStyleOption & option , TQStyleHintReturn * returnData ) const {
int KlearlookStyle : : styleHint( StyleHint stylehint , const TQWidget * widget , const TQStyleOption & option , TQStyleHintReturn * returnData ) const {
switch ( stylehint ) {
case SH_EtchDisabledText :
case SH_Slider_SnapToValue :
@ -3593,7 +3593,7 @@ int KlearlookStyle::tqstyleHint( StyleHint stylehint, const TQWidget *widget, co
case SH_PopupMenu_AllowActiveAndDisabled :
return 0 ;
default :
return KStyle : : tq styleHint( stylehint , widget , option , returnData ) ;
return KStyle : : styleHint( stylehint , widget , option , returnData ) ;
}
}
@ -3895,8 +3895,8 @@ bool KlearlookStyle::redrawHoverWidget() {
if ( rb ) {
TQRect rect ( widgetZero . x ( ) , widgetZero . y ( ) ,
tq visualRect( subRect ( SR_RadioButtonFocusRect , rb ) , rb ) . width ( ) +
tq pixelMetric( PM_ExclusiveIndicatorWidth ) + 4 , hoverWidget - > height ( ) ) ;
visualRect( subRect ( SR_RadioButtonFocusRect , rb ) , rb ) . width ( ) +
pixelMetric( PM_ExclusiveIndicatorWidth ) + 4 , hoverWidget - > height ( ) ) ;
hover = rect . contains ( cursor ) ? HOVER_RADIO : HOVER_NONE ;
return ( HOVER_NONE ! = hover & & ! rect . contains ( oldCursor ) ) | |
@ -3906,8 +3906,8 @@ bool KlearlookStyle::redrawHoverWidget() {
if ( cb ) {
TQRect rect ( widgetZero . x ( ) , widgetZero . y ( ) ,
tq visualRect( subRect ( SR_CheckBoxFocusRect , cb ) , cb ) . width ( ) +
tq pixelMetric( PM_IndicatorWidth ) + 4 , hoverWidget - > height ( ) ) ;
visualRect( subRect ( SR_CheckBoxFocusRect , cb ) , cb ) . width ( ) +
pixelMetric( PM_IndicatorWidth ) + 4 , hoverWidget - > height ( ) ) ;
hover = rect . contains ( cursor ) ? HOVER_CHECK : HOVER_NONE ;
return ( HOVER_NONE ! = hover & & ! rect . contains ( oldCursor ) ) | |