@ -15,7 +15,7 @@
( c ) 2002 , 2003 Maksim Orlovich < mo002j @ mail . rochester . edu >
( c ) 2002 , 2003 Maksim Orlovich < mo002j @ mail . rochester . edu >
based on the KDE3 HighColor Style
based on the KDE3 HighColor Style
Copyright ( C ) 2001 - 2002 Karol Szwed < gallium @ kde . org >
Copyright ( C ) 2001 - 2002 Karol Szwed < gallium @ kde . org >
( C ) 2001 - 2002 Fredrik H ö glund < fredrik @ kde . org >
( C ) 2001 - 2002 Fredrik H <EFBFBD> glund < fredrik @ kde . org >
Drawing routines adapted from the KDE2 HCStyle ,
Drawing routines adapted from the KDE2 HCStyle ,
Copyright ( C ) 2000 Daniel M . Duley < mosfet @ kde . org >
Copyright ( C ) 2000 Daniel M . Duley < mosfet @ kde . org >
( C ) 2000 Dirk Mueller < mueller @ kde . org >
( C ) 2000 Dirk Mueller < mueller @ kde . org >
@ -1357,9 +1357,9 @@ void PlastikStyle::drawKStylePrimitive(KStylePrimitive kpe,
p - > drawLine ( centerx , centery - radius , centerx , centery + radius ) ;
p - > drawLine ( centerx , centery - radius , centerx , centery + radius ) ;
} else if ( _drawTriangularExpander ) {
} else if ( _drawTriangularExpander ) {
if ( flags & Style_On )
if ( flags & Style_On )
drawPrimitive( PE_ArrowRight , p , TQRect ( r . x ( ) + 1 , r . y ( ) + 1 , r . width ( ) , r . height ( ) ) , cg , ButtonContour , flags ) ;
tq drawPrimitive( PE_ArrowRight , p , TQRect ( r . x ( ) + 1 , r . y ( ) + 1 , r . width ( ) , r . height ( ) ) , cg , ButtonContour , flags ) ;
if ( flags & Style_Off )
if ( flags & Style_Off )
drawPrimitive( PE_ArrowDown , p , TQRect ( r . x ( ) + 1 , r . y ( ) + 1 , r . width ( ) , r . height ( ) ) , cg , ButtonContour , flags ) ;
tq drawPrimitive( PE_ArrowDown , p , TQRect ( r . x ( ) + 1 , r . y ( ) + 1 , r . width ( ) , r . height ( ) ) , cg , ButtonContour , flags ) ;
}
}
break ;
break ;
@ -1443,7 +1443,7 @@ void PlastikStyle::drawKStylePrimitive(KStylePrimitive kpe,
}
}
void PlastikStyle : : drawPrimitive( PrimitiveElement pe ,
void PlastikStyle : : tq drawPrimitive( TQ_ PrimitiveElement pe ,
TQPainter * p ,
TQPainter * p ,
const TQRect & r ,
const TQRect & r ,
const TQColorGroup & cg ,
const TQColorGroup & cg ,
@ -1660,7 +1660,7 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe,
surfaceFlags ) ;
surfaceFlags ) ;
p - > setPen ( cg . foreground ( ) ) ;
p - > setPen ( cg . foreground ( ) ) ;
drawPrimitive( ( horiz ? PE_ArrowLeft : PE_ArrowUp ) , p , r , cg , flags ) ;
tq drawPrimitive( ( horiz ? PE_ArrowLeft : PE_ArrowUp ) , p , r , cg , flags ) ;
break ;
break ;
}
}
@ -1686,7 +1686,7 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe,
surfaceFlags ) ;
surfaceFlags ) ;
p - > setPen ( cg . foreground ( ) ) ;
p - > setPen ( cg . foreground ( ) ) ;
drawPrimitive( ( horiz ? PE_ArrowRight : PE_ArrowDown ) , p , r , cg , flags ) ;
tq drawPrimitive( ( horiz ? PE_ArrowRight : PE_ArrowDown ) , p , r , cg , flags ) ;
break ;
break ;
}
}
@ -1715,7 +1715,7 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe,
renderSurface ( p , TQRect ( r . x ( ) + 1 , r . y ( ) + 1 , r . width ( ) - 2 , r . height ( ) - 2 ) ,
renderSurface ( p , TQRect ( r . x ( ) + 1 , r . y ( ) + 1 , r . width ( ) - 2 , r . height ( ) - 2 ) ,
cg . background ( ) , contentColor , getColor ( cg , MouseOverHighlight ) , enabled ? _contrast + 3 : ( _contrast / 2 ) , surfaceFlags ) ;
cg . background ( ) , contentColor , getColor ( cg , MouseOverHighlight ) , enabled ? _contrast + 3 : ( _contrast / 2 ) , surfaceFlags ) ;
drawPrimitive( PE_CheckMark , p , r , cg , flags ) ;
tq drawPrimitive( PE_CheckMark , p , r , cg , flags ) ;
break ;
break ;
}
}
@ -2138,7 +2138,7 @@ void PlastikStyle::drawPrimitive(PrimitiveElement pe,
}
}
void PlastikStyle : : tqdrawControl ( ControlElement element ,
void PlastikStyle : : tqdrawControl ( TQ_ ControlElement element ,
TQPainter * p ,
TQPainter * p ,
const TQWidget * widget ,
const TQWidget * widget ,
const TQRect & r ,
const TQRect & r ,
@ -2356,12 +2356,12 @@ void PlastikStyle::tqdrawControl(ControlElement element,
TQColorGroup g2 = cg ;
TQColorGroup g2 = cg ;
if ( isDefault )
if ( isDefault )
g2 . setColor ( TQColorGroup : : Background , cg . background ( ) . dark ( 120 ) ) ;
g2 . setColor ( TQColorGroup : : Background , cg . background ( ) . dark ( 120 ) ) ;
drawPrimitive( PE_ButtonBevel , p ,
tq drawPrimitive( PE_ButtonBevel , p ,
isDefault ? TQRect ( r . x ( ) + 1 , r . y ( ) + 1 , r . width ( ) - 2 , r . height ( ) - 2 ) : r ,
isDefault ? TQRect ( r . x ( ) + 1 , r . y ( ) + 1 , r . width ( ) - 2 , r . height ( ) - 2 ) : r ,
g2 , flags , TQStyleOption ( button ) ) ;
g2 , flags , TQStyleOption ( button ) ) ;
if ( isDefault ) {
if ( isDefault ) {
drawPrimitive( PE_ButtonDefault , p , r , cg , flags ) ;
tq drawPrimitive( PE_ButtonDefault , p , r , cg , flags ) ;
}
}
break ;
break ;
@ -2396,7 +2396,7 @@ void PlastikStyle::tqdrawControl(ControlElement element,
else
else
{
{
p - > setPen ( cg . buttonText ( ) ) ;
p - > setPen ( cg . buttonText ( ) ) ;
drawPrimitive( PE_ArrowDown , p , tqvisualRect ( TQRect ( x + w - dx - 8 , y + 2 , dx , h - 4 ) , r ) ,
tq drawPrimitive( PE_ArrowDown , p , tqvisualRect ( TQRect ( x + w - dx - 8 , y + 2 , dx , h - 4 ) , r ) ,
cg , flags , opt ) ;
cg , flags , opt ) ;
w - = dx ;
w - = dx ;
}
}
@ -2422,7 +2422,7 @@ void PlastikStyle::tqdrawControl(ControlElement element,
p - > drawPixmap ( x + 4 , y + h / 2 - pixmap . height ( ) / 2 , pixmap ) ;
p - > drawPixmap ( x + 4 , y + h / 2 - pixmap . height ( ) / 2 , pixmap ) ;
if ( cornArrow ) //Draw over the icon
if ( cornArrow ) //Draw over the icon
drawPrimitive( PE_ArrowDown , p , tqvisualRect ( TQRect ( x + w - 6 , x + h - 6 , 7 , 7 ) , r ) ,
tq drawPrimitive( PE_ArrowDown , p , tqvisualRect ( TQRect ( x + w - 6 , x + h - 6 , 7 , 7 ) , r ) ,
cg , flags , opt ) ;
cg , flags , opt ) ;
@ -2438,7 +2438,7 @@ void PlastikStyle::tqdrawControl(ControlElement element,
if ( flags & Style_HasFocus )
if ( flags & Style_HasFocus )
drawPrimitive( PE_FocusRect , p ,
tq drawPrimitive( PE_FocusRect , p ,
tqvisualRect ( subRect ( SR_PushButtonFocusRect , widget ) , widget ) ,
tqvisualRect ( subRect ( SR_PushButtonFocusRect , widget ) , widget ) ,
cg , flags ) ;
cg , flags ) ;
break ;
break ;
@ -2458,9 +2458,9 @@ void PlastikStyle::tqdrawControl(ControlElement element,
if ( active & & focused ) {
if ( active & & focused ) {
if ( down ) {
if ( down ) {
drawPrimitive( PE_ButtonTool , p , r , cg , flags | Style_Down , opt ) ;
tq drawPrimitive( PE_ButtonTool , p , r , cg , flags | Style_Down , opt ) ;
} else {
} else {
drawPrimitive( PE_ButtonTool , p , r , cg , flags , opt ) ;
tq drawPrimitive( PE_ButtonTool , p , r , cg , flags , opt ) ;
}
}
}
}
@ -2561,7 +2561,7 @@ void PlastikStyle::tqdrawControl(ControlElement element,
SFlags cflags = Style_On ;
SFlags cflags = Style_On ;
if ( enabled )
if ( enabled )
cflags | = Style_Enabled ;
cflags | = Style_Enabled ;
drawPrimitive( PE_CheckMark , p , cr , cg , cflags ) ;
tq drawPrimitive( PE_CheckMark , p , cr , cg , cflags ) ;
}
}
// Time to draw the menu item label...
// Time to draw the menu item label...
@ -2667,7 +2667,7 @@ void PlastikStyle::tqdrawControl(ControlElement element,
// Does the menu item have a submenu?
// Does the menu item have a submenu?
if ( mi - > popup ( ) ) {
if ( mi - > popup ( ) ) {
PrimitiveElement arrow = reverse ? PE_ArrowLeft : PE_ArrowRight ;
TQ_ PrimitiveElement arrow = reverse ? PE_ArrowLeft : PE_ArrowRight ;
int dim = tqpixelMetric ( PM_MenuButtonIndicator ) - 1 ;
int dim = tqpixelMetric ( PM_MenuButtonIndicator ) - 1 ;
TQRect vr = tqvisualRect ( TQRect ( r . x ( ) + r . width ( ) - 5 - 1 - dim ,
TQRect vr = tqvisualRect ( TQRect ( r . x ( ) + r . width ( ) - 5 - 1 - dim ,
r . y ( ) + r . height ( ) / 2 - dim / 2 , dim , dim ) , r ) ;
r . y ( ) + r . height ( ) / 2 - dim / 2 , dim , dim ) , r ) ;
@ -2680,9 +2680,9 @@ void PlastikStyle::tqdrawControl(ControlElement element,
TQColorGroup g2 ( discol , cg . highlight ( ) , white , white ,
TQColorGroup g2 ( discol , cg . highlight ( ) , white , white ,
enabled ? white : discol , discol , white ) ;
enabled ? white : discol , discol , white ) ;
drawPrimitive( arrow , p , vr , g2 , Style_Enabled ) ;
tq drawPrimitive( arrow , p , vr , g2 , Style_Enabled ) ;
} else
} else
drawPrimitive( arrow , p , vr , cg ,
tq drawPrimitive( arrow , p , vr , cg ,
enabled ? Style_Enabled : Style_Default ) ;
enabled ? Style_Enabled : Style_Default ) ;
}
}
break ;
break ;
@ -2709,7 +2709,7 @@ void PlastikStyle::tqdrawControl(ControlElement element,
}
}
}
}
void PlastikStyle : : tqdrawControlMask ( ControlElement element ,
void PlastikStyle : : tqdrawControlMask ( TQ_ ControlElement element ,
TQPainter * p ,
TQPainter * p ,
const TQWidget * w ,
const TQWidget * w ,
const TQRect & r ,
const TQRect & r ,
@ -2729,7 +2729,7 @@ void PlastikStyle::tqdrawControlMask(ControlElement element,
}
}
}
}
void PlastikStyle : : tqdrawComplexControlMask ( ComplexControl c ,
void PlastikStyle : : tqdrawComplexControlMask ( TQ_ ComplexControl c ,
TQPainter * p ,
TQPainter * p ,
const TQWidget * w ,
const TQWidget * w ,
const TQRect & r ,
const TQRect & r ,
@ -2750,7 +2750,7 @@ void PlastikStyle::tqdrawComplexControlMask(ComplexControl c,
}
}
}
}
void PlastikStyle : : tqdrawComplexControl ( ComplexControl control ,
void PlastikStyle : : tqdrawComplexControl ( TQ_ ComplexControl control ,
TQPainter * p ,
TQPainter * p ,
const TQWidget * widget ,
const TQWidget * widget ,
const TQRect & r ,
const TQRect & r ,
@ -2872,7 +2872,7 @@ void PlastikStyle::tqdrawComplexControl(ComplexControl control,
cg . background ( ) , buttonColor , getColor ( cg , MouseOverHighlight ) , enabled ? _contrast + 3 : ( _contrast / 2 ) ,
cg . background ( ) , buttonColor , getColor ( cg , MouseOverHighlight ) , enabled ? _contrast + 3 : ( _contrast / 2 ) ,
surfaceFlags ) ;
surfaceFlags ) ;
if ( hasFocus ) {
if ( hasFocus ) {
drawPrimitive( PE_FocusRect , p ,
tq drawPrimitive( PE_FocusRect , p ,
TQRect ( RcontentSurface . x ( ) + 2 ,
TQRect ( RcontentSurface . x ( ) + 2 ,
RcontentSurface . y ( ) + 2 ,
RcontentSurface . y ( ) + 2 ,
RcontentSurface . width ( ) - 4 ,
RcontentSurface . width ( ) - 4 ,
@ -2911,7 +2911,7 @@ void PlastikStyle::tqdrawComplexControl(ComplexControl control,
}
}
p - > setPen ( cg . foreground ( ) ) ;
p - > setPen ( cg . foreground ( ) ) ;
drawPrimitive( PE_SpinWidgetDown , p , RbuttonSurface , cg , Style_Default | Style_Enabled | Style_Raised ) ;
tq drawPrimitive( PE_SpinWidgetDown , p , RbuttonSurface , cg , Style_Default | Style_Enabled | Style_Raised ) ;
// TQComboBox draws the text using cg.text(), we can override this
// TQComboBox draws the text using cg.text(), we can override this
// from here
// from here
@ -2933,7 +2933,7 @@ void PlastikStyle::tqdrawComplexControl(ComplexControl control,
mflags = flags ;
mflags = flags ;
if ( kornMode ) {
if ( kornMode ) {
drawPrimitive( PE_ButtonTool , p , button , cg , bflags , opt ) ;
tq drawPrimitive( PE_ButtonTool , p , button , cg , bflags , opt ) ;
break ;
break ;
} else {
} else {
// don't want to have the buttoncolor as the background...
// don't want to have the buttoncolor as the background...
@ -2950,7 +2950,7 @@ void PlastikStyle::tqdrawComplexControl(ComplexControl control,
if ( controls & SC_ToolButton ) {
if ( controls & SC_ToolButton ) {
// If we're pressed, on, or raised...
// If we're pressed, on, or raised...
if ( bflags & ( Style_Down | Style_On | Style_Raised ) | | widget = = hoverWidget ) {
if ( bflags & ( Style_Down | Style_On | Style_Raised ) | | widget = = hoverWidget ) {
drawPrimitive( PE_ButtonTool , p , button , cg , bflags , opt ) ;
tq drawPrimitive( PE_ButtonTool , p , button , cg , bflags , opt ) ;
} else if ( tb - > tqparentWidget ( ) & &
} else if ( tb - > tqparentWidget ( ) & &
tb - > tqparentWidget ( ) - > backgroundPixmap ( ) & &
tb - > tqparentWidget ( ) - > backgroundPixmap ( ) & &
! tb - > tqparentWidget ( ) - > backgroundPixmap ( ) - > isNull ( ) ) {
! tb - > tqparentWidget ( ) - > backgroundPixmap ( ) - > isNull ( ) ) {
@ -2962,15 +2962,15 @@ void PlastikStyle::tqdrawComplexControl(ComplexControl control,
// Draw a toolbutton menu indicator if required
// Draw a toolbutton menu indicator if required
if ( controls & SC_ToolButtonMenu ) {
if ( controls & SC_ToolButtonMenu ) {
if ( mflags & ( Style_Down | Style_On | Style_Raised ) ) {
if ( mflags & ( Style_Down | Style_On | Style_Raised ) ) {
drawPrimitive( PE_ButtonDropDown , p , menuarea , cg , mflags , opt ) ;
tq drawPrimitive( PE_ButtonDropDown , p , menuarea , cg , mflags , opt ) ;
}
}
drawPrimitive( PE_ArrowDown , p , menuarea , cg , mflags , opt ) ;
tq drawPrimitive( PE_ArrowDown , p , menuarea , cg , mflags , opt ) ;
}
}
if ( tb - > hasFocus ( ) & & ! tb - > focusProxy ( ) ) {
if ( tb - > hasFocus ( ) & & ! tb - > focusProxy ( ) ) {
TQRect fr = tb - > rect ( ) ;
TQRect fr = tb - > rect ( ) ;
fr . addCoords ( 2 , 2 , - 2 , - 2 ) ;
fr . addCoords ( 2 , 2 , - 2 , - 2 ) ;
drawPrimitive( PE_FocusRect , p , fr , cg ) ;
tq drawPrimitive( PE_FocusRect , p , fr , cg ) ;
}
}
// Set the color for the ToolButton menu indicator
// Set the color for the ToolButton menu indicator
@ -2986,7 +2986,7 @@ void PlastikStyle::tqdrawComplexControl(ComplexControl control,
const TQSpinWidget * sw = dynamic_cast < const TQSpinWidget * > ( widget ) ;
const TQSpinWidget * sw = dynamic_cast < const TQSpinWidget * > ( widget ) ;
SFlags sflags = flags ;
SFlags sflags = flags ;
PrimitiveElement pe ;
TQ_ PrimitiveElement pe ;
bool hasFocus = false ;
bool hasFocus = false ;
if ( sw )
if ( sw )
@ -3094,7 +3094,7 @@ void PlastikStyle::tqdrawComplexControl(ComplexControl control,
else
else
pe = PE_SpinWidgetUp ;
pe = PE_SpinWidgetUp ;
p - > setPen ( cg . foreground ( ) ) ;
p - > setPen ( cg . foreground ( ) ) ;
drawPrimitive( pe , p , upRect , cg , sflags ) ;
tq drawPrimitive( pe , p , upRect , cg , sflags ) ;
sflags = Style_Default | Style_Enabled ;
sflags = Style_Default | Style_Enabled ;
if ( active = = SC_SpinWidgetDown ) {
if ( active = = SC_SpinWidgetDown ) {
@ -3107,7 +3107,7 @@ void PlastikStyle::tqdrawComplexControl(ComplexControl control,
else
else
pe = PE_SpinWidgetDown ;
pe = PE_SpinWidgetDown ;
p - > setPen ( cg . foreground ( ) ) ;
p - > setPen ( cg . foreground ( ) ) ;
drawPrimitive( pe , p , downRect , cg , sflags ) ;
tq drawPrimitive( pe , p , downRect , cg , sflags ) ;
// thin frame around the input area
// thin frame around the input area
const TQRect Rcontent = TQRect ( reverseLayout ? r . left ( ) + 1 + handleWidth + 1 : r . left ( ) + 1 , r . top ( ) + 1 ,
const TQRect Rcontent = TQRect ( reverseLayout ? r . left ( ) + 1 + handleWidth + 1 : r . left ( ) + 1 , r . top ( ) + 1 ,
@ -3172,7 +3172,7 @@ TQRect PlastikStyle::subRect(SubRect r, const TQWidget *widget) const
}
}
}
}
TQRect PlastikStyle : : querySubControlMetrics ( ComplexControl control ,
TQRect PlastikStyle : : querySubControlMetrics ( TQ_ ComplexControl control ,
const TQWidget * widget ,
const TQWidget * widget ,
SubControl subcontrol ,
SubControl subcontrol ,
const TQStyleOption & opt ) const
const TQStyleOption & opt ) const
@ -3347,7 +3347,7 @@ int PlastikStyle::tqpixelMetric(PixelMetric m, const TQWidget *widget) const
}
}
TQSize PlastikStyle : : sizeFromContents( ContentsType t ,
TQSize PlastikStyle : : tq sizeFromContents( ContentsType t ,
const TQWidget * widget ,
const TQWidget * widget ,
const TQSize & s ,
const TQSize & s ,
const TQStyleOption & opt ) const
const TQStyleOption & opt ) const