@ -157,7 +157,7 @@ class PolyesterStylePlugin : public TQStylePlugin
}
} ;
KDE_ Q_EXPORT_PLUGIN( PolyesterStylePlugin )
T Q_EXPORT_PLUGIN( PolyesterStylePlugin )
// -- end --
PolyesterStyle : : PolyesterStyle ( ) : TDEStyle ( AllowMenuTransparency , ThreeButtonScrollBar ) ,
@ -315,9 +315,11 @@ void PolyesterStyle::animate() {
for ( AnimWidgetMap : : iterator it = animWidgets . begin ( ) ; it ! = animWidgets . end ( ) ; + + it ) {
TQWidget * widget = it . key ( ) ;
if ( animWidgets [ widget ] . active = = true ) {
int frame = abs ( ( int ) animWidgets [ widget ] . animFrame ) ;
if ( animWidgets [ widget ] . active ) {
mustStop = false ;
if ( abs ( animWidgets [ widget ] . animFrame ) < ANIMATIONSTEPS ) {
if ( frame < ANIMATIONSTEPS ) {
if ( _animateButton ) {
animWidgets [ widget ] . animFrame + = animationDelta ;
widget - > repaint ( false ) ;
@ -326,7 +328,7 @@ void PolyesterStyle::animate() {
}
}
} else {
if ( abs ( animWidgets [ widget ] . animFrame ) > 0 ) {
if ( frame > 0 ) {
mustStop = false ;
if ( _animateButton ) {
animWidgets [ widget ] . animFrame - = animationDelta ;
@ -353,16 +355,23 @@ PolyesterStyle::~PolyesterStyle()
delete verticalLine ;
}
void PolyesterStyle : : polish ( TQApplication * app )
void PolyesterStyle : : applicationPolish ( const TQStyleControlElementData & ceData , ControlElementFlags , void * ptr )
{
if ( ceData . widgetObjectTypes . contains ( " TQApplication " ) )
{
TQApplication * app = reinterpret_cast < TQApplication * > ( ptr ) ;
if ( ! qstrcmp ( app - > argv ( ) [ 0 ] , " kicker " ) )
kickerMode = true ;
else if ( ! qstrcmp ( app - > argv ( ) [ 0 ] , " korn " ) )
kornMode = true ;
}
}
void PolyesterStyle : : polish ( TQWidget * widget )
void PolyesterStyle : : polish ( const TQStyleControlElementData & ceData , ControlElementFlags elementFlags , void * ptr )
{
if ( ceData . widgetObjectTypes . contains ( " TQWidget " ) ) {
TQWidget * widget = reinterpret_cast < TQWidget * > ( ptr ) ;
if ( ! strcmp ( widget - > name ( ) , " __tdehtml " ) ) { // is it a tdehtml widget...?
tdehtmlWidgets [ widget ] = true ;
connect ( widget , TQ_SIGNAL ( destroyed ( TQObject * ) ) , this , TQ_SLOT ( tdehtmlWidgetDestroyed ( TQObject * ) ) ) ;
@ -370,10 +379,10 @@ void PolyesterStyle::polish(TQWidget* widget)
// use tqt_cast where possible to check if the widget inheits one of the classes. might improve
// performance compared to TQObject::inherits()
if ( : : tqt_cast < TQPushButton * > ( widget ) | | : : tqt_cast < TQComboBox * > ( widget ) | |
: : tqt_cast < TQSpinWidget * > ( widget ) | | : : tqt_cast < TQSlider * > ( widget ) | |
: : tqt_cast < TQCheckBox * > ( widget ) | | : : tqt_cast < TQRadioButton * > ( widget ) | |
: : tqt_cast < TQToolButton * > ( widget ) | | widget - > inherits ( " TQSplitterHandle " ) )
if ( widget - > inherits ( " TQPushButton " ) | | widget - > inherits ( " TQComboBox " ) | |
widget - > inherits ( " TQSpinWidget " ) | | widget - > inherits ( " TQSlider " ) | |
widget - > inherits ( " TQCheckBox " ) | | widget - > inherits ( " TQRadioButton " ) | |
widget - > inherits ( " TQToolButton " ) | | widget - > inherits ( " TQSplitterHandle " ) )
{
// widget->setBackgroundMode(PaletteBackground);
widget - > installEventFilter ( this ) ;
@ -394,23 +403,23 @@ void PolyesterStyle::polish(TQWidget* widget)
connect ( slider , TQ_SIGNAL ( sliderMoved ( int ) ) , this , TQ_SLOT ( sliderThumbMoved ( int ) ) ) ;
connect ( slider , TQ_SIGNAL ( valueChanged ( int ) ) , this , TQ_SLOT ( sliderThumbMoved ( int ) ) ) ;
}
} else if ( : : tqt_cast < TQLineEdit * > ( widget ) ) {
} else if ( widget - > inherits ( " TQLineEdit " ) ) {
widget - > installEventFilter ( this ) ;
} else if ( : : tqt_cast < TQTabBar * > ( widget ) ) {
} else if ( widget - > inherits ( " TQTabBar " ) ) {
widget - > setMouseTracking ( true ) ;
widget - > installEventFilter ( this ) ;
} else if ( : : tqt_cast < TQPopupMenu * > ( widget ) ) {
} else if ( widget - > inherits ( " TQPopupMenu " ) ) {
widget - > setBackgroundMode ( NoBackground ) ;
} else if ( ! qstrcmp ( widget - > name ( ) , " tde toolbar widget " ) ) {
widget - > installEventFilter ( this ) ;
} else if ( : : tqt_cast < TQHeader * > ( widget ) ) {
} else if ( widget - > inherits ( " TQHeader " ) ) {
connect ( widget - > parent ( ) , TQ_SIGNAL ( contentsMoving ( int , int ) ) , widget , TQ_SLOT ( update ( ) ) ) ;
widget - > installEventFilter ( this ) ;
} else if ( : : tqt_cast < TQScrollBar * > ( widget ) ) {
} else if ( widget - > inherits ( " TQScrollBar " ) ) {
widget - > installEventFilter ( this ) ;
}
if ( _animateProgressBar & & : : tqt_cast < TQProgressBar * > ( widget ) )
if ( _animateProgressBar & & widget - > inherits ( " TQProgressBar " ) )
{
widget - > installEventFilter ( this ) ;
progAnimWidgets [ widget ] = 0 ;
@ -418,48 +427,52 @@ void PolyesterStyle::polish(TQWidget* widget)
if ( ! animationTimer - > isActive ( ) )
animationTimer - > start ( 50 , false ) ;
}
}
TDEStyle : : polish ( widget ) ;
TDEStyle : : polish ( ceData , elementFlags , ptr ) ;
}
void PolyesterStyle : : unPolish ( TQWidget * widget )
void PolyesterStyle : : unPolish ( const TQStyleControlElementData & ceData , ControlElementFlags elementFlags , void * ptr )
{
if ( ceData . widgetObjectTypes . contains ( " TQWidget " ) ) {
TQWidget * widget = reinterpret_cast < TQWidget * > ( ptr ) ;
if ( ! strcmp ( widget - > name ( ) , " __tdehtml " ) ) { // is it a tdehtml widget...?
tdehtmlWidgets . remove ( widget ) ;
}
// use tqt_cast to check if the widget inheits one of the classes.
if ( : : tqt_cast < TQPushButton * > ( widget ) | | : : tqt_cast < TQComboBox * > ( widget ) | |
: : tqt_cast < TQSpinWidget * > ( widget ) | | : : tqt_cast < TQSlider * > ( widget ) | |
: : tqt_cast < TQCheckBox * > ( widget ) | | : : tqt_cast < TQRadioButton * > ( widget ) | |
: : tqt_cast < TQToolButton * > ( widget ) | | : : tqt_cast < TQLineEdit * > ( widget ) | |
if ( widget - > inherits ( " TQPushButton " ) | | widget - > inherits ( " TQComboBox " ) | |
widget - > inherits ( " TQSpinWidget " ) | | widget - > inherits ( " TQSlider " ) | |
widget - > inherits ( " TQCheckBox " ) | | widget - > inherits ( " TQRadioButton " ) | |
widget - > inherits ( " TQToolButton " ) | | widget - > inherits ( " TQLineEdit " ) | |
widget - > inherits ( " TQSplitterHandle " ) )
{
widget - > removeEventFilter ( this ) ;
animWidgets . remove ( widget ) ;
}
else if ( : : tqt_cast < TQTabBar * > ( widget ) | | : : tqt_cast < TQHeader * > ( widget )
| | : : tqt_cast < TQScrollBar * > ( widget ) ) {
else if ( widget - > inherits ( " TQTabBar " ) | | widget - > inherits ( " TQHeader " ) | |
widget - > inherits ( " TQScrollBar " ) )
{
widget - > setMouseTracking ( false ) ;
widget - > removeEventFilter ( this ) ;
} else if ( : : tqt_cast < TQPopupMenu * > ( widget ) ) {
} else if ( widget - > inherits ( " TQPopupMenu " ) ) {
widget - > setBackgroundMode ( PaletteBackground ) ;
} else if ( ! qstrcmp ( widget - > name ( ) , " tde toolbar widget " ) ) {
widget - > removeEventFilter ( this ) ;
}
const TQSlider * slider = : : tq t_cast< TQSlider * > ( widget ) ;
const TQSlider * slider = reinterpre t_cast< TQSlider * > ( widget ) ;
if ( slider & & sliderValues . contains ( slider ) )
sliderValues . remove ( slider ) ;
if ( : : tqt_cast < TQProgressBar * > ( widget ) )
if ( widget - > inherits ( " TQProgressBar " ) )
{
progAnimWidgets . remove ( widget ) ;
}
TDEStyle : : unPolish ( widget ) ;
}
TDEStyle : : unPolish ( ceData, elementFlags , ptr ) ;
}
/*a bunch of TQ_SLOTs stuff...*/
@ -795,13 +808,13 @@ void PolyesterStyle::renderSurface(TQPainter *p,
if ( drawLeft ) left + + ;
if ( drawTop ) top + + ;
if ( ! strcmp ( _buttonStyle , " gradients " ) /*|| sunken*/ ) {
if ( _buttonStyle = = " gradients " /*|| sunken*/ ) {
//polyester style
renderGradient ( p , TQRect ( drawLeft ? r . left ( ) + 1 : r . left ( ) ,
drawTop ? r . top ( ) + 1 : r . top ( ) , width , height ) ,
colorTop2 , colorBottom2 , horizontal ) ;
}
else if ( ! strcmp ( _buttonStyle , " glass " ) ) {
else if ( _buttonStyle = = " glass " ) {
//glass buttons
/*create a copy of the two colors, otherwise ugly things(tm) happens...*/
const TQColor colorTop3 = TQColor ( colorTop1 . rgb ( ) ) . light ( 100 + _contrast ) ;
@ -822,7 +835,7 @@ void PolyesterStyle::renderSurface(TQPainter *p,
horizontal ? top + height / 2 : top ,
horizontal ? width : halfsize , horizontal ? halfsize : height ) ,
colorBottom2 , colorTop2 , horizontal ) ;
} else if ( ! strcmp ( _buttonStyle , " reverseGradients " ) ) {
} else if ( _buttonStyle = = " reverseGradients " ) {
//lipstik style
renderGradient ( p , TQRect ( drawLeft ? r . left ( ) + 1 : r . left ( ) ,
drawTop ? r . top ( ) + 1 : r . top ( ) , width , height ) ,
@ -1107,15 +1120,15 @@ void PolyesterStyle::renderGradient(TQPainter *painter,
int rDiff , gDiff , bDiff ;
int rc , gc , bc ;
register int x , y ;
int x , y ;
rDiff = ( c2 . red ( ) ) - ( rc = c1 . red ( ) ) ;
gDiff = ( c2 . green ( ) ) - ( gc = c1 . green ( ) ) ;
bDiff = ( c2 . blue ( ) ) - ( bc = c1 . blue ( ) ) ;
register int rl = rc < < 16 ;
register int gl = gc < < 16 ;
register int bl = bc < < 16 ;
int rl = rc < < 16 ;
int gl = gc < < 16 ;
int bl = bc < < 16 ;
int rdelta = ( ( 1 < < 16 ) / ( horizontal ? r_h : r_w ) ) * rDiff ;
int gdelta = ( ( 1 < < 16 ) / ( horizontal ? r_h : r_w ) ) * gDiff ;
@ -1279,17 +1292,17 @@ void PolyesterStyle::renderTab(TQPainter *p,
renderGradient ( p , TQRect ( Rs . right ( ) , Rs . y ( ) + 1 , 1 , Rs . height ( ) - 1 ) ,
getColor ( g , PanelDark ) , getColor ( g , PanelDark2 ) ) ;
if ( ! strcmp ( _buttonStyle , " glass " ) ) {
if ( _buttonStyle = = " glass " ) {
renderGradient ( p , TQRect ( Rs . x ( ) + 1 , Rs . y ( ) + 1 , Rs . width ( ) - 2 , Rs . height ( ) / 2 ) ,
g . background ( ) . light ( 100 + _contrast ) ,
g . background ( ) ) ;
renderGradient ( p , TQRect ( Rs . x ( ) + 1 , Rs . y ( ) + Rs . height ( ) / 2 , Rs . width ( ) - 2 , Rs . height ( ) / 2 ) ,
g . background ( ) . dark ( 100 + _contrast ) ,
g . background ( ) ) ;
} else if ( ! strcmp ( _buttonStyle , " gradients " ) )
} else if ( _buttonStyle = = " gradients " )
renderGradient ( p , TQRect ( Rs . x ( ) + 1 , Rs . y ( ) + 1 , Rs . width ( ) - 2 , Rs . height ( ) - 1 ) ,
getColor ( g , PanelLight ) , g . background ( ) ) ;
else if ( ! strcmp ( _buttonStyle , " reverseGradients " ) )
else if ( _buttonStyle = = " reverseGradients " )
renderGradient ( p , TQRect ( Rs . x ( ) + 1 , Rs . y ( ) + 1 , Rs . width ( ) - 2 ,
Rs . height ( ) - 1 ) ,
g . background ( ) . dark ( 100 + _contrast ) , g . background ( ) ) ;
@ -1549,11 +1562,13 @@ void PolyesterStyle::sliderThumbMoved(int val)
void PolyesterStyle : : drawTDEStylePrimitive ( TDEStylePrimitive kpe ,
TQPainter * p ,
const TQWidget * widget ,
const TQStyleControlElementData & ceData ,
ControlElementFlags elementFlags ,
const TQRect & r ,
const TQColorGroup & cg ,
SFlags flags ,
const TQStyleOption & opt ) const
const TQStyleOption & opt ,
const TQWidget * widget ) const
{
// some "global" vars...
const bool enabled = ( flags & Style_Enabled ) ;
@ -1562,7 +1577,7 @@ void PolyesterStyle::drawTDEStylePrimitive(TDEStylePrimitive kpe,
// ------
switch ( kpe ) {
case KPE_SliderGroove : {
const TQSlider * slider = ( const TQSlider * ) widget ;
const TQSlider * slider = static_cast < const TQSlider * > ( widget ) ;
bool horizontal = slider - > orientation ( ) = = Horizontal ;
int value = slider - > value ( ) ;
@ -1572,8 +1587,8 @@ void PolyesterStyle::drawTDEStylePrimitive(TDEStylePrimitive kpe,
if ( horizontal ) {
int center = r . y ( ) + r . height ( ) / 2 ;
//double coloredWidth = ((double)r.width()/slider->maxValue())*slider->value();
double sliderLength = pixelMetric ( PM_SliderLength , widget) ;
double halfSliderLength = pixelMetric ( PM_SliderLength , widget) / 2 ;
double sliderLength = pixelMetric ( PM_SliderLength , ceData, elementFlags , widget) ;
double halfSliderLength = pixelMetric ( PM_SliderLength , ceData, elementFlags , widget) / 2 ;
double coloredWidth = ( ( ( ( double ) r . width ( ) - sliderLength ) /
( slider - > maxValue ( ) - slider - > minValue ( ) ) ) *
( slider - > value ( ) - slider - > minValue ( ) )
@ -1614,8 +1629,8 @@ void PolyesterStyle::drawTDEStylePrimitive(TDEStylePrimitive kpe,
} else {
int center = r . x ( ) + r . width ( ) / 2 ;
//double coloredHeight = ((double)r.height()/slider->maxValue())*slider->value();
double sliderLength = pixelMetric ( PM_SliderLength , widget) ;
double halfSliderLength = pixelMetric ( PM_SliderLength , widget) / 2 ;
double sliderLength = pixelMetric ( PM_SliderLength , ceData, elementFlags , widget) ;
double halfSliderLength = pixelMetric ( PM_SliderLength , ceData, elementFlags , widget) / 2 ;
double nonColoredHeight = ( ( ( ( double ) r . height ( ) - sliderLength ) /
( slider - > maxValue ( ) - slider - > minValue ( ) ) ) *
( slider - > value ( ) - slider - > minValue ( ) )
@ -1653,7 +1668,7 @@ void PolyesterStyle::drawTDEStylePrimitive(TDEStylePrimitive kpe,
}
case KPE_SliderHandle : {
const TQSlider * slider = ( const TQSlider * ) widget ;
const TQSlider * slider = static_cast < const TQSlider * > ( widget ) ;
bool horizontal = slider - > orientation ( ) = = Horizontal ;
const bool pressed = ( flags & Style_Active ) ;
@ -1836,9 +1851,9 @@ void PolyesterStyle::drawTDEStylePrimitive(TDEStylePrimitive kpe,
p - > drawLine ( centerx , centery - radius , centerx , centery + radius ) ;
} else if ( _drawTriangularExpander ) {
if ( flags & Style_On )
drawPrimitive ( PE_ArrowRight , p , TQRect( r . x ( ) + 1 , r . y ( ) + 1 , r . width ( ) , r . height ( ) ) , cg , ButtonContour , flags ) ;
drawPrimitive ( PE_ArrowRight , p , ceData, elementFlags , TQRect( r . x ( ) + 1 , r . y ( ) + 1 , r . width ( ) , r . height ( ) ) , cg , ButtonContour , flags ) ;
if ( flags & Style_Off )
drawPrimitive ( PE_ArrowDown , p , TQRect( r . x ( ) + 1 , r . y ( ) + 1 , r . width ( ) , r . height ( ) ) , cg , ButtonContour , flags ) ;
drawPrimitive ( PE_ArrowDown , p , ceData, elementFlags , TQRect( r . x ( ) + 1 , r . y ( ) + 1 , r . width ( ) , r . height ( ) ) , cg , ButtonContour , flags ) ;
}
break ;
@ -1917,13 +1932,15 @@ void PolyesterStyle::drawTDEStylePrimitive(TDEStylePrimitive kpe,
}
default :
TDEStyle : : drawTDEStylePrimitive ( kpe , p , widget , r , cg , flags , op t) ;
TDEStyle : : drawTDEStylePrimitive ( kpe , p , ceData, elementFlags , r , cg , flags , op t, widge t) ;
}
}
void PolyesterStyle : : drawPrimitive ( PrimitiveElement pe ,
TQPainter * p ,
const TQStyleControlElementData & ceData ,
ControlElementFlags elementFlags ,
const TQRect & r ,
const TQColorGroup & cg ,
SFlags flags ,
@ -2344,7 +2361,7 @@ void PolyesterStyle::drawPrimitive(PrimitiveElement pe,
surfaceFlags ) ;
p - > setPen ( cg . foreground ( ) ) ;
drawPrimitive ( ( horiz ? PE_ArrowLeft : PE_ArrowUp ) , p , r, cg , flags ) ;
drawPrimitive ( ( horiz ? PE_ArrowLeft : PE_ArrowUp ) , p , ceData, elementFlags , r, cg , flags ) ;
break ;
}
@ -2395,7 +2412,7 @@ void PolyesterStyle::drawPrimitive(PrimitiveElement pe,
surfaceFlags ) ;
p - > setPen ( cg . foreground ( ) ) ;
drawPrimitive ( ( horiz ? PE_ArrowRight : PE_ArrowDown ) , p , r, cg , flags ) ;
drawPrimitive ( ( horiz ? PE_ArrowRight : PE_ArrowDown ) , p , ceData, elementFlags , r, cg , flags ) ;
break ;
}
@ -2425,7 +2442,7 @@ void PolyesterStyle::drawPrimitive(PrimitiveElement pe,
renderSurface ( p , TQRect ( r . x ( ) + 1 , r . y ( ) + 1 , r . width ( ) - 2 , r . height ( ) - 2 ) ,
cg . background ( ) , contentColor , getColor ( cg , MouseOverHighlight ) , enabled ? _contrast + 3 : ( _contrast / 2 ) , surfaceFlags ) ;
drawPrimitive ( PE_CheckMark , p , r, cg , flags ) ;
drawPrimitive ( PE_CheckMark , p , ceData, elementFlags , r, cg , flags ) ;
break ;
}
@ -2822,8 +2839,8 @@ void PolyesterStyle::drawPrimitive(PrimitiveElement pe,
const TQWMatrix oldMatrix ( p - > worldMatrix ( ) ) ;
if ( flags & Style_Down ) {
p - > translate ( pixelMetric ( PM_ButtonShiftHorizontal ),
pixelMetric ( PM_ButtonShiftVertical )) ;
p - > translate ( pixelMetric ( PM_ButtonShiftHorizontal , ceData , elementFlags ),
pixelMetric ( PM_ButtonShiftVertical , ceData , elementFlags )) ;
}
int x = r . x ( ) ;
@ -2873,7 +2890,7 @@ void PolyesterStyle::drawPrimitive(PrimitiveElement pe,
}
default : {
return TDEStyle : : drawPrimitive ( pe , p , r, cg , flags , opt ) ;
return TDEStyle : : drawPrimitive ( pe , p , ceData, elementFlags , r, cg , flags , opt ) ;
}
}
}
@ -2881,11 +2898,13 @@ void PolyesterStyle::drawPrimitive(PrimitiveElement pe,
void PolyesterStyle : : drawControl ( ControlElement element ,
TQPainter * p ,
const TQWidget * widget ,
const TQStyleControlElementData & ceData ,
ControlElementFlags elementFlags ,
const TQRect & r ,
const TQColorGroup & cg ,
SFlags flags ,
const TQStyleOption & opt ) const
const TQStyleOption & opt ,
const TQWidget * widget ) const
{
const bool reverseLayout = TQApplication : : reverseLayout ( ) ;
@ -3063,9 +3082,9 @@ void PolyesterStyle::drawControl(ControlElement element,
if ( t - > identifier ( ) = = tb - > currentTab ( ) )
{
tr . moveTop ( tr . top ( ) -
pixelMetric ( TQStyle : : PM_TabBarTabShiftVertical , tb ) ) ;
pixelMetric ( TQStyle : : PM_TabBarTabShiftVertical , ceData, elementFlags , tb ) ) ;
tr . moveLeft ( tr . left ( ) -
pixelMetric ( TQStyle : : PM_TabBarTabShiftHorizontal , tb ) ) ;
pixelMetric ( TQStyle : : PM_TabBarTabShiftHorizontal , ceData, elementFlags , tb ) ) ;
}
if ( _shadowedButtonsText )
@ -3079,7 +3098,7 @@ void PolyesterStyle::drawControl(ControlElement element,
flags & Style_Enabled , 0 , t - > text ( ) ) ;
if ( ( flags & Style_HasFocus ) & & ! t - > text ( ) . isEmpty ( ) )
drawPrimitive ( PE_FocusRect , p , r, cg , Style_Default , opt ) ;
drawPrimitive ( PE_FocusRect , p , ceData, elementFlags , r, cg , Style_Default , opt ) ;
break ;
}
@ -3087,7 +3106,7 @@ void PolyesterStyle::drawControl(ControlElement element,
// RADIOBUTTONS
// ------------
case CE_RadioButton : {
drawPrimitive ( PE_ExclusiveIndicator , p , r, cg , flags ) ;
drawPrimitive ( PE_ExclusiveIndicator , p , ceData, elementFlags , r, cg , flags ) ;
const TQColor contentColor = enabled ? cg . base ( ) : cg . background ( ) ;
TQColor checkmarkColor = enabled ? getColor ( cg , CheckMark ) : cg . background ( ) ;
@ -3169,7 +3188,7 @@ void PolyesterStyle::drawControl(ControlElement element,
renderTab ( p , r , cg , mouseOver , selected , true , pos , false , cornerWidget ) ;
break ;
default :
TDEStyle : : drawControl ( element , p , widget , r , cg , flags , op t) ;
TDEStyle : : drawControl ( element , p , ceData, elementFlags , r , cg , flags , op t, widge t) ;
}
break ;
@ -3196,12 +3215,12 @@ void PolyesterStyle::drawControl(ControlElement element,
g2 . setColor ( TQColorGroup : : Button , cg . button ( ) . light ( 100 + animFrame ) ) ;
}
drawPrimitive ( PE_ButtonBevel , p ,
drawPrimitive ( PE_ButtonBevel , p , ceData , elementFlags ,
isDefault ? TQRect ( r . x ( ) + 1 , r . y ( ) + 1 , r . width ( ) - 2 , r . height ( ) - 2 ) : r ,
g2 , flags , TQStyleOption ( button ) ) ;
if ( isDefault ) {
drawPrimitive ( PE_ButtonDefault , p , r, cg , flags ) ;
drawPrimitive ( PE_ButtonDefault , p , ceData, elementFlags , r, cg , flags ) ;
}
break ;
@ -3219,15 +3238,15 @@ void PolyesterStyle::drawControl(ControlElement element,
// Shift button contents if pushed.
if ( active )
{
x + = pixelMetric ( PM_ButtonShiftHorizontal , widget) ;
y + = pixelMetric ( PM_ButtonShiftVertical , widget) ;
x + = pixelMetric ( PM_ButtonShiftHorizontal , ceData, elementFlags , widget) ;
y + = pixelMetric ( PM_ButtonShiftVertical , ceData, elementFlags , widget) ;
flags | = Style_Sunken ;
}
// Does the button have a popup menu?
if ( button - > isMenuButton ( ) )
{
int dx = pixelMetric ( PM_MenuButtonIndicator , widget ) ;
int dx = pixelMetric ( PM_MenuButtonIndicator , ceData, elementFlags , widget ) ;
if ( button - > iconSet ( ) & & ! button - > iconSet ( ) - > isNull ( ) & &
( dx + button - > iconSet ( ) - > pixmap ( TQIconSet : : Small , TQIconSet : : Normal , TQIconSet : : Off ) . width ( ) ) > = w )
{
@ -3235,7 +3254,7 @@ void PolyesterStyle::drawControl(ControlElement element,
}
else
{
drawPrimitive ( PE_ArrowDown , p , visualRect( TQRect ( x + w - dx - 8 , y + 2 , dx , h - 4 ) , r ) ,
drawPrimitive ( PE_ArrowDown , p , ceData, elementFlags , visualRect( TQRect ( x + w - dx - 8 , y + 2 , dx , h - 4 ) , r ) ,
cg , flags , opt ) ;
w - = dx ;
}
@ -3261,7 +3280,7 @@ void PolyesterStyle::drawControl(ControlElement element,
p - > drawPixmap ( x + 4 , y + h / 2 - pixmap . height ( ) / 2 , pixmap ) ;
if ( cornArrow ) //Draw over the icon
drawPrimitive ( PE_ArrowDown , p , visualRect( TQRect ( x + w - 6 , x + h - 6 , 7 , 7 ) , r ) ,
drawPrimitive ( PE_ArrowDown , p , ceData, elementFlags , visualRect( TQRect ( x + w - 6 , x + h - 6 , 7 , 7 ) , r ) ,
cg , flags , opt ) ;
@ -3305,8 +3324,8 @@ void PolyesterStyle::drawControl(ControlElement element,
{
TQColorGroup g2 = cg ;
drawPrimitive ( PE_FocusRect , p ,
visualRect ( subRect ( SR_PushButtonFocusRect , widget ) , widget ) ,
drawPrimitive ( PE_FocusRect , p , ceData , elementFlags ,
visualRect ( subRect ( SR_PushButtonFocusRect , ceData, elementFlags , widget ) , widget ) ,
g2 , flags , opt ) ;
}
break ;
@ -3338,7 +3357,7 @@ void PolyesterStyle::drawControl(ControlElement element,
if ( active & & focused ) {
if ( down ) {
//drawPrimitive(PE_ButtonTool, p, r, cg, flags|Style_Down, opt);
//drawPrimitive(PE_ButtonTool, p, ceData, elementFlags, r, cg, flags|Style_Down, opt);
//code to draw the menubar item as a tab (ugly?)
renderSurface ( p , TQRect ( r . left ( ) + 1 , r . top ( ) + 1 , r . width ( ) - 2 , r . height ( ) ) ,
cg . highlight ( ) , cg . highlight ( ) , cg . highlight ( ) ,
@ -3351,7 +3370,7 @@ void PolyesterStyle::drawControl(ControlElement element,
_contrast , Is_Horizontal | Draw_Right | Draw_Top | Draw_Left | Draw_Bottom ) ;
renderContour ( p , r , getColor ( cg , MenuBarEmphasis ) , getColor ( cg , MenuBarEmphasis ) . dark ( 120 + _contrast * 8 ) , Draw_Right | Draw_Top | Draw_Left | Round_UpperRight | Round_UpperLeft | Draw_Bottom | Round_BottomRight | Round_BottomLeft ) ;
//not used this because of the possible custom menubar color
//drawPrimitive(PE_ButtonTool, p, r, cg, flags, opt);
//drawPrimitive(PE_ButtonTool, p, ceData, elementFlags, r, cg, flags, opt);
}
}
@ -3395,7 +3414,7 @@ void PolyesterStyle::drawControl(ControlElement element,
bool enabled = mi - > isEnabled ( ) ;
bool checkable = popupmenu - > isCheckable ( ) ;
bool active = flags & Style_Active ;
bool etchtext = styleHint ( SH_EtchDisabledText ) ;
bool etchtext = styleHint ( SH_EtchDisabledText , ceData , elementFlags ) ;
bool reverse = TQApplication : : reverseLayout ( ) ;
if ( checkable )
checkcol = TQMAX ( checkcol , 20 ) ;
@ -3511,7 +3530,7 @@ void PolyesterStyle::drawControl(ControlElement element,
// Do we have an icon and are checked at the same time?
// Then draw a "pressed" background behind the icon
if ( checkable & & /*!active &&*/ mi - > isChecked ( ) )
drawPrimitive ( TQStyle : : PE_Indicator , p , c r, cg ,
drawPrimitive ( TQStyle : : PE_Indicator , p , c eData, elementFlags , c r, cg ,
TQStyle : : Style_Enabled | TQStyle : : Style_Active | TQStyle : : Style_Off ) ;
/*qDrawShadePanel( p, cr.x(), cr.y(), cr.width(), cr.height(),
cg , true , 1 , & cg . brush ( TQColorGroup : : Midlight ) ) ; */
@ -3526,7 +3545,7 @@ void PolyesterStyle::drawControl(ControlElement element,
else if ( checkable & & mi - > isChecked ( ) )
{
int style = TQStyle : : Style_Enabled | TQStyle : : Style_Active | TQStyle : : Style_On ;
drawPrimitive ( TQStyle : : PE_Indicator , p , c r, cg , style ) ;
drawPrimitive ( TQStyle : : PE_Indicator , p , c eData, elementFlags , c r, cg , style ) ;
}
// Time to draw the menu item label...
@ -3632,7 +3651,7 @@ void PolyesterStyle::drawControl(ControlElement element,
// Does the menu item have a submenu?
if ( mi - > popup ( ) ) {
PrimitiveElement arrow = reverse ? PE_ArrowLeft : PE_ArrowRight ;
int dim = pixelMetric ( PM_MenuButtonIndicator ) - 1 ;
int dim = pixelMetric ( PM_MenuButtonIndicator , ceData , elementFlags ) - 1 ;
TQRect vr = visualRect ( TQRect ( r . x ( ) + r . width ( ) - 5 - 1 - dim ,
r . y ( ) + r . height ( ) / 2 - dim / 2 , dim , dim ) , r ) ;
@ -3644,9 +3663,9 @@ void PolyesterStyle::drawControl(ControlElement element,
TQColorGroup g2 ( discol , cg . highlight ( ) , white , white ,
enabled ? white : discol , discol , white ) ;
drawPrimitive ( arrow , p , vr, g2 , Style_Enabled ) ;
drawPrimitive ( arrow , p , ceData, elementFlags , vr, g2 , Style_Enabled ) ;
} else
drawPrimitive ( arrow , p , vr, cg ,
drawPrimitive ( arrow , p , ceData, elementFlags , vr, cg ,
enabled ? Style_Enabled : Style_Default ) ;
}
break ;
@ -3720,15 +3739,17 @@ void PolyesterStyle::drawControl(ControlElement element,
}
default :
TDEStyle : : drawControl ( element , p , widget , r , cg , flags , op t) ;
TDEStyle : : drawControl ( element , p , ceData, elementFlags , r , cg , flags , op t, widge t) ;
}
}
void PolyesterStyle : : drawControlMask ( ControlElement element ,
TQPainter * p ,
const TQWidget * w ,
const TQStyleControlElementData & ceData ,
ControlElementFlags elementFlags ,
const TQRect & r ,
const TQStyleOption & opt ) const
const TQStyleOption & opt ,
const TQWidget * w ) const
{
switch ( element ) {
case CE_PushButton : {
@ -3739,16 +3760,18 @@ void PolyesterStyle::drawControlMask(ControlElement element,
}
default : {
TDEStyle : : drawControlMask ( element , p , w, r , opt ) ;
TDEStyle : : drawControlMask ( element , p , ceData, elementFlags , r , opt , w ) ;
}
}
}
void PolyesterStyle : : drawComplexControlMask ( ComplexControl c ,
TQPainter * p ,
const TQWidget * w ,
const TQStyleControlElementData & ceData ,
ControlElementFlags elementFlags ,
const TQRect & r ,
const TQStyleOption & o ) const
const TQStyleOption & o ,
const TQWidget * w ) const
{
switch ( c ) {
case CC_SpinWidget :
@ -3760,20 +3783,22 @@ void PolyesterStyle::drawComplexControlMask(ComplexControl c,
break ;
}
default : {
TDEStyle : : drawComplexControlMask ( c , p , w, r , o ) ;
TDEStyle : : drawComplexControlMask ( c , p , ceData, elementFlags , r , o , w ) ;
}
}
}
void PolyesterStyle : : drawComplexControl ( ComplexControl control ,
TQPainter * p ,
const TQWidget * widget ,
const TQStyleControlElementData & ceData ,
ControlElementFlags elementFlags ,
const TQRect & r ,
const TQColorGroup & cg ,
SFlags flags ,
SCFlags controls ,
SCFlags active ,
const TQStyleOption & opt ) const
const TQStyleOption & opt ,
const TQWidget * widget ) const
{
const bool reverseLayout = TQApplication : : reverseLayout ( ) ;
@ -3811,7 +3836,7 @@ void PolyesterStyle::drawComplexControl(ComplexControl control,
if ( _inputFocusHighlight & & hasFocus & & editable & & enabled )
{
TQRect editField = querySubControlMetrics ( control , widget, SC_ComboBoxEditField ) ;
TQRect editField = querySubControlMetrics ( control , ceData, elementFlags , SC_ComboBoxEditField , opt , widget ) ;
TQRect editFrame = r ;
TQRect buttonFrame = r ;
@ -3893,7 +3918,7 @@ void PolyesterStyle::drawComplexControl(ComplexControl control,
cg . background ( ) , buttonColor , highlightColor , enabled ? _contrast + 3 : ( _contrast / 2 ) ,
surfaceFlags ) ;
if ( hasFocus ) {
drawPrimitive ( PE_FocusRect , p ,
drawPrimitive ( PE_FocusRect , p , ceData , elementFlags ,
TQRect ( RcontentSurface . x ( ) + 2 ,
RcontentSurface . y ( ) + 2 ,
RcontentSurface . width ( ) - 4 ,
@ -3932,7 +3957,7 @@ void PolyesterStyle::drawComplexControl(ComplexControl control,
}
p - > setPen ( cg . foreground ( ) ) ;
drawPrimitive ( PE_SpinWidgetDown , p , RbuttonSurface, cg , Style_Default | Style_Enabled | Style_Raised ) ;
drawPrimitive ( PE_SpinWidgetDown , p , ceData, elementFlags , RbuttonSurface, cg , Style_Default | Style_Enabled | Style_Raised ) ;
// TQComboBox draws the text using cg.text(), we can override this
// from here TODO: shadow here?
@ -3954,8 +3979,8 @@ void PolyesterStyle::drawComplexControl(ComplexControl control,
}
TQRect button , menuarea ;
button = querySubControlMetrics ( control , widget , SC_ToolButton , op t) ;
menuarea = querySubControlMetrics ( control , widget , SC_ToolButtonMenu , op t) ;
button = querySubControlMetrics ( control , ceData, elementFlags , SC_ToolButton , op t, widge t) ;
menuarea = querySubControlMetrics ( control , ceData, elementFlags , SC_ToolButtonMenu , op t, widge t) ;
SFlags bflags = flags ,
mflags = flags ;
@ -3963,7 +3988,7 @@ void PolyesterStyle::drawComplexControl(ComplexControl control,
Round_UpperLeft | Round_UpperRight | Round_BottomLeft | Round_BottomRight ;
if ( kornMode ) {
drawPrimitive ( PE_ButtonTool , p , button, g2 , bflags , opt ) ;
drawPrimitive ( PE_ButtonTool , p , ceData, elementFlags , button, g2 , bflags , opt ) ;
break ;
} else {
@ -3983,7 +4008,7 @@ void PolyesterStyle::drawComplexControl(ComplexControl control,
if ( controls & SC_ToolButton ) {
// If we're pressed, on, or raised...
if ( bflags & ( Style_Down | Style_On | Style_Raised ) | | widget = = hoverWidget ) {
drawPrimitive ( PE_ButtonTool , p , button, g2 , bflags , opt ) ;
drawPrimitive ( PE_ButtonTool , p , ceData, elementFlags , button, g2 , bflags , opt ) ;
if ( _animateButton & & tb - > autoRaise ( ) & & ! ( bflags & Style_On ) & & ! active )
renderContour ( p , r , cg . background ( ) , cg . background ( ) . dark ( 100 + ( abs ( animFrame ) * _contrast ) ) ,
borderFlags ) ;
@ -3998,15 +4023,15 @@ void PolyesterStyle::drawComplexControl(ComplexControl control,
// Draw a toolbutton menu indicator if required
if ( controls & SC_ToolButtonMenu ) {
if ( mflags & ( Style_Down | Style_On | Style_Raised ) ) {
drawPrimitive ( PE_ButtonDropDown , p , menuarea, g2 , mflags , opt ) ;
drawPrimitive ( PE_ButtonDropDown , p , ceData, elementFlags , menuarea, g2 , mflags , opt ) ;
}
drawPrimitive ( PE_ArrowDown , p , menuarea, g2 , mflags , opt ) ;
drawPrimitive ( PE_ArrowDown , p , ceData, elementFlags , menuarea, g2 , mflags , opt ) ;
}
if ( tb - > hasFocus ( ) & & ! tb - > focusProxy ( ) ) {
TQRect fr = tb - > rect ( ) ;
fr . addCoords ( 2 , 2 , - 2 , - 2 ) ;
drawPrimitive ( PE_FocusRect , p , fr, g2 , Style_Default , opt ) ;
drawPrimitive ( PE_FocusRect , p , ceData, elementFlags , fr, g2 , Style_Default , opt ) ;
}
// Set the color for the ToolButton menu indicator
@ -4041,7 +4066,7 @@ void PolyesterStyle::drawComplexControl(ComplexControl control,
const bool heightDividable = ( ( r . height ( ) % 2 ) = = 0 ) ;
if ( _inputFocusHighlight & & hasFocus & & enabled )
{
TQRect editField = querySubControlMetrics ( control , widget, SC_SpinWidgetEditField ) ;
TQRect editField = querySubControlMetrics ( control , ceData, elementFlags , SC_SpinWidgetEditField , opt , widget ) ;
TQRect editFrame = r ;
TQRect buttonFrame = r ;
@ -4072,7 +4097,7 @@ void PolyesterStyle::drawComplexControl(ComplexControl control,
}
else
{
renderContour ( p , querySubControlMetrics ( control , widget, SC_SpinWidgetFrame ) ,
renderContour ( p , querySubControlMetrics ( control , ceData, elementFlags , SC_SpinWidgetFrame , opt , widget ) ,
cg . background ( ) , getColor ( cg , ButtonContour , enabled ) ) ;
}
p - > setPen ( alphaBlendColors ( cg . background ( ) , getColor ( cg , ButtonContour , enabled ) , 50 ) ) ;
@ -4139,7 +4164,7 @@ void PolyesterStyle::drawComplexControl(ComplexControl control,
else
pe = PE_SpinWidgetUp ;
p - > setPen ( cg . foreground ( ) ) ;
drawPrimitive ( pe , p , upRect, cg , sflags ) ;
drawPrimitive ( pe , p , ceData, elementFlags , upRect, cg , sflags ) ;
sflags = Style_Default | Style_Enabled ;
if ( active = = SC_SpinWidgetDown ) {
@ -4152,7 +4177,7 @@ void PolyesterStyle::drawComplexControl(ComplexControl control,
else
pe = PE_SpinWidgetDown ;
p - > setPen ( cg . foreground ( ) ) ;
drawPrimitive ( pe , p , downRect, cg , sflags ) ;
drawPrimitive ( pe , p , ceData, elementFlags , downRect, cg , sflags ) ;
// thin frame around the input area
const TQRect Rcontent = TQRect ( reverseLayout ? r . left ( ) + 1 + handleWidth + 1 : r . left ( ) + 1 , r . top ( ) + 1 ,
@ -4185,19 +4210,22 @@ void PolyesterStyle::drawComplexControl(ComplexControl control,
}
default :
TDEStyle : : drawComplexControl ( control , p , widget ,
TDEStyle : : drawComplexControl ( control , p , ceData, elementFlags ,
r , cg , flags , controls ,
active , opt );
active , opt , widget );
break ;
}
}
TQRect PolyesterStyle : : subRect ( SubRect r , const TQWidget * widget ) const
TQRect PolyesterStyle : : subRect ( SubRect r ,
const TQStyleControlElementData & ceData ,
ControlElementFlags elementFlags ,
const TQWidget * widget ) const
{
switch ( r ) {
case SR_ComboBoxFocusRect : {
return querySubControlMetrics ( CC_ComboBox , widget, SC_ComboBoxEditField ) ;
return querySubControlMetrics ( CC_ComboBox , ceData, elementFlags , SC_ComboBoxEditField , TQStyleOption : : Default , widget ) ;
}
// Don't use TDEStyles progressbar subrect
@ -4212,15 +4240,17 @@ TQRect PolyesterStyle::subRect(SubRect r, const TQWidget *widget) const
}
default : {
return TDEStyle : : subRect ( r , widget) ;
return TDEStyle : : subRect ( r , ceData, elementFlags , widget) ;
}
}
}
TQRect PolyesterStyle : : querySubControlMetrics ( ComplexControl control ,
const TQWidget * widget ,
const TQStyleControlElementData & ceData ,
ControlElementFlags elementFlags ,
SubControl subcontrol ,
const TQStyleOption & opt ) const
const TQStyleOption & opt ,
const TQWidget * widget ) const
{
if ( ! widget ) {
return TQRect ( ) ;
@ -4235,7 +4265,7 @@ TQRect PolyesterStyle::querySubControlMetrics(ComplexControl control,
return TQRect ( r . left ( ) + 2 , r . top ( ) + 2 , r . width ( ) - 4 - 15 - 1 , r . height ( ) - 4 ) ;
}
default : {
return TDEStyle : : querySubControlMetrics ( control , widget, subcontrol , op t) ;
return TDEStyle : : querySubControlMetrics ( control , ceData, elementFlags , subcontrol , opt , widge t) ;
}
}
break ;
@ -4279,18 +4309,21 @@ TQRect PolyesterStyle::querySubControlMetrics(ComplexControl control,
return TQRect ( buttonsLeft , r . top ( ) + 1 , bs . width ( ) , r . height ( ) - 2 ) ;
}
default : {
return TDEStyle : : querySubControlMetrics ( control , widget, subcontrol , op t) ;
return TDEStyle : : querySubControlMetrics ( control , ceData, elementFlags , subcontrol , opt , widge t) ;
}
}
break ;
}
default : {
return TDEStyle : : querySubControlMetrics ( control , widget, subcontrol , op t) ;
return TDEStyle : : querySubControlMetrics ( control , ceData, elementFlags , subcontrol , opt , widge t) ;
}
}
}
int PolyesterStyle : : pixelMetric ( PixelMetric m , const TQWidget * widget ) const
int PolyesterStyle : : pixelMetric ( PixelMetric m ,
const TQStyleControlElementData & ceData ,
ControlElementFlags elementFlags ,
const TQWidget * widget ) const
{
switch ( m ) {
// TABS
@ -4307,20 +4340,15 @@ int PolyesterStyle::pixelMetric(PixelMetric m, const TQWidget *widget) const
return 1 ;
}
# if (TQT_VERSION >= 0x030300) // requires TQt 3.3
// extra space between menubar items
case PM_MenuBarItemSpacing : {
return 5 ;
}
# endif
// #if (TQT_VERSION >= 0x030300) // requires TQt 3.3
// // extra space between toolbar items
// case PM_ToolBarItemSpacing: {
// return 4;
// }
// #endif
// SCROLL BAR
case PM_ScrollBarSliderMin : {
@ -4391,26 +4419,31 @@ int PolyesterStyle::pixelMetric(PixelMetric m, const TQWidget *widget) const
}
default :
return TDEStyle : : pixelMetric ( m , widget) ;
return TDEStyle : : pixelMetric ( m , ceData, elementFlags , widget) ;
}
}
int PolyesterStyle : : kPixelMetric ( TDEStylePixelMetric kpm , const TQWidget * widget ) const
int PolyesterStyle : : kPixelMetric ( TDEStylePixelMetric kpm ,
const TQStyleControlElementData & ceData ,
ControlElementFlags elementFlags ,
const TQWidget * widget ) const
{
switch ( kpm )
{
case KPM_MenuItemSeparatorHeight :
return 2 ;
default :
return TDEStyle : : kPixelMetric ( kpm , widget) ;
return TDEStyle : : kPixelMetric ( kpm , ceData, elementFlags , widget) ;
}
}
TQSize PolyesterStyle : : sizeFromContents ( ContentsType t ,
const TQWidget * widget ,
const TQStyleControlElementData & ceData ,
ControlElementFlags elementFlags ,
const TQSize & s ,
const TQStyleOption & opt ) const
const TQStyleOption & opt ,
const TQWidget * widget ) const
{
switch ( t ) {
case CT_PopupMenuItem : {
@ -4471,8 +4504,8 @@ TQSize PolyesterStyle::sizeFromContents(ContentsType t,
{
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 * pixelMetric ( PM_ButtonMargin , ceData, elementFlags , widget) ;
int h = s . height ( ) + 2 * pixelMetric ( PM_ButtonMargin , ceData, elementFlags , widget) ;
if ( btn - > text ( ) . isEmpty ( ) & & s . width ( ) < 32 ) return TQSize ( w , h ) ;
return TQSize ( w + 25 , h + 5 ) ;
@ -4483,20 +4516,22 @@ TQSize PolyesterStyle::sizeFromContents(ContentsType t,
if ( widget - > parent ( ) & & : : tqt_cast < TQToolBar * > ( widget - > parent ( ) ) )
return TQSize ( s . width ( ) + 2 * 4 , s . height ( ) + 2 * 4 ) ;
else
return TDEStyle : : sizeFromContents ( t , widget, s , op t) ;
return TDEStyle : : sizeFromContents ( t , ceData, elementFlags , s , opt , widge t) ;
}
default :
return TDEStyle : : sizeFromContents ( t , widget, s , op t) ;
return TDEStyle : : sizeFromContents ( t , ceData, elementFlags , s , opt , widge t) ;
}
return TDEStyle : : sizeFromContents ( t , widget, s , op t) ;
return TDEStyle : : sizeFromContents ( t , ceData, elementFlags , s , opt , widge t) ;
}
int PolyesterStyle : : styleHint ( StyleHint stylehint ,
const TQWidget * widget ,
const TQStyleControlElementData & ceData ,
ControlElementFlags elementFlags ,
const TQStyleOption & option ,
TQStyleHintReturn * returnData ) const
TQStyleHintReturn * returnData ,
const TQWidget * widget ) const
{
switch ( stylehint ) {
case SH_PopupMenu_SubMenuPopupDelay :
@ -4507,10 +4542,6 @@ int PolyesterStyle::styleHint( StyleHint stylehint,
if ( _centeredTabBar & & ! TQApplication : : reverseLayout ( ) )
return TQt : : AlignHCenter ;
//Suggestion by Daniel Molkentin,
//algorithm from QT4 TQWindowsXPStyle Copyright 2006 Trolltech
//this exists since TQt3.2
# if (TQT_VERSION >= 0x030200)
case SH_LineEdit_PasswordCharacter :
{
if ( widget )
@ -4530,9 +4561,9 @@ int PolyesterStyle::styleHint( StyleHint stylehint,
return ' * ' ;
}
}
# endif
default :
return TDEStyle : : styleHint ( stylehint , widget , option , returnData ) ;
return TDEStyle : : styleHint ( stylehint , ceData, elementFlags , option , returnData , widget ) ;
}
}
@ -4545,7 +4576,7 @@ bool PolyesterStyle::eventFilter(TQObject *obj, TQEvent *ev)
if ( ! obj - > isWidgetType ( ) ) return false ;
//header mouse over
if ( : : tqt_cast < TQHeader * > ( obj ) ) {
if ( obj - > inherits ( " TQHeader " ) ) {
TQWidget * widget = static_cast < TQWidget * > ( obj ) ;
if ( ( ev - > type ( ) = = TQEvent : : Leave ) & & static_cast < TQWidget * > ( obj ) - > isEnabled ( ) )
{
@ -4571,7 +4602,7 @@ bool PolyesterStyle::eventFilter(TQObject *obj, TQEvent *ev)
}
}
/*Scrollbar Mouse over*/
if ( : : tqt_cast < TQScrollBar * > ( obj ) ) {
if ( obj - > inherits ( " TQScrollBar " ) ) {
TQWidget * widget = static_cast < TQWidget * > ( obj ) ;
if ( ( ev - > type ( ) = = TQEvent : : Enter ) & & static_cast < TQWidget * > ( obj ) - > isEnabled ( ) )
@ -4586,10 +4617,10 @@ bool PolyesterStyle::eventFilter(TQObject *obj, TQEvent *ev)
}
}
// focus highlight
if ( : : tqt_cast < TQLineEdit * > ( obj ) ) {
if ( obj - > inherits ( " TQLineEdit " ) ) {
TQWidget * widget = static_cast < TQWidget * > ( obj ) ;
if ( : : tqt_cast < TQSpinWidget * > ( widget - > parentWidget ( ) ) )
if ( widget - > parentWidget ( ) - > inherits ( " TQSpinWidget " ) )
{
TQWidget * spinbox = widget - > parentWidget ( ) ;
if ( ( ev - > type ( ) = = TQEvent : : FocusIn ) | | ( ev - > type ( ) = = TQEvent : : FocusOut ) )
@ -4607,9 +4638,10 @@ bool PolyesterStyle::eventFilter(TQObject *obj, TQEvent *ev)
}
//Hover highlight... use tqt_cast to check if the widget inheits one of the classes.
if ( : : tqt_cast < TQPushButton * > ( obj ) | | : : tqt_cast < TQComboBox * > ( obj ) | |
: : tqt_cast < TQSpinWidget * > ( obj ) | | : : tqt_cast < TQCheckBox * > ( obj ) | |
: : tqt_cast < TQRadioButton * > ( obj ) | | : : tqt_cast < TQToolButton * > ( obj ) | | obj - > inherits ( " TQSplitterHandle " ) )
if ( obj - > inherits ( " TQPushButton " ) | | obj - > inherits ( " TQComboBox " ) | |
obj - > inherits ( " TQSpinWidget " ) | | obj - > inherits ( " TQCheckBox " ) | |
obj - > inherits ( " TQRadioButton " ) | | obj - > inherits ( " TQToolButton " ) | |
obj - > inherits ( " TQSplitterHandle " ) )
{
if ( ( ev - > type ( ) = = TQEvent : : Enter ) & & static_cast < TQWidget * > ( obj ) - > isEnabled ( ) )
{
@ -4645,7 +4677,7 @@ bool PolyesterStyle::eventFilter(TQObject *obj, TQEvent *ev)
}
return false ;
}
if ( : : tqt_cast < TQTabBar * > ( obj ) ) {
if ( obj - > inherits ( " TQTabBar " ) ) {
if ( ( ev - > type ( ) = = TQEvent : : Enter ) & & static_cast < TQWidget * > ( obj ) - > isEnabled ( ) )
{
TQWidget * tabbar = static_cast < TQWidget * > ( obj ) ;
@ -4683,7 +4715,7 @@ bool PolyesterStyle::eventFilter(TQObject *obj, TQEvent *ev)
return false ;
}
// Track show events for progress bars
if ( _animateProgressBar & & : : tqt_cast < TQProgressBar * > ( obj ) )
if ( _animateProgressBar & & obj - > inherits ( " TQProgressBar " ) )
{
if ( ( ev - > type ( ) = = TQEvent : : Show ) & & ! animationTimer - > isActive ( ) )
{