@ -110,6 +110,7 @@ dimension, so as to draw the scrollbar at the correct size.
# include <iostream>
# include <iostream>
# define COMMON_FUNCTIONS
# define COMMON_FUNCTIONS
# include "qtcurve.h"
# include "qtcurve.h"
# include "shortcuthandler.h"
# define CONFIG_READ
# define CONFIG_READ
# include "config_file.c"
# include "config_file.c"
# include "pixmaps.h"
# include "pixmaps.h"
@ -511,6 +512,20 @@ static bool inStackWidget(const TQWidget *w)
return false ;
return false ;
}
}
static bool isOnToolbar ( const TQWidget * widget , TQPainter * p )
{
const TQWidget * wid = widget ? widget - > parentWidget ( ) : ( p & & p - > device ( ) ? dynamic_cast < TQWidget * > ( p - > device ( ) ) : 0L ) ;
while ( wid )
{
if ( : : tqqt_cast < const TQToolBar * > ( wid ) )
return true ;
wid = wid - > parentWidget ( ) ;
}
return false ;
}
static void setRgb ( TQColor * col , const TQStringList & rgb )
static void setRgb ( TQColor * col , const TQStringList & rgb )
{
{
if ( 3 = = rgb . size ( ) )
if ( 3 = = rgb . size ( ) )
@ -715,11 +730,11 @@ enum ECacheFlags
CACHE_COL_SEL_TAB
CACHE_COL_SEL_TAB
} ;
} ;
static TQString createKey ( int size , TQRgb color , bool horiz , int app , ECacheFlags flags )
static TQString createKey ( int size , TQRgb color , TQRgb bgnd , bool horiz , int app , ECacheFlags flags )
{
{
TQString key ;
TQString key ;
TQTextOStream ( & key ) < < size < < ' - ' < < color < < ' - ' < < horiz < < ' - ' < < app < < ' - ' < < flags ;
TQTextOStream ( & key ) < < size < < ' - ' < < color < < ' - ' < < bgnd < < ' - ' < < horiz < < ' - ' < < app < < ' - ' < < flags ;
return key ;
return key ;
}
}
@ -841,6 +856,7 @@ QtCurveStyle::QtCurveStyle(const TQString &name)
QtCurveStyle : : QtCurveStyle ( )
QtCurveStyle : : QtCurveStyle ( )
# endif
# endif
: BASE_STYLE ( AllowMenuTransparency , WindowsStyleScrollBar ) ,
: BASE_STYLE ( AllowMenuTransparency , WindowsStyleScrollBar ) ,
itsPopupMenuCols ( 0L ) ,
itsSliderCols ( 0L ) ,
itsSliderCols ( 0L ) ,
itsDefBtnCols ( 0L ) ,
itsDefBtnCols ( 0L ) ,
itsMouseOverCols ( 0L ) ,
itsMouseOverCols ( 0L ) ,
@ -866,7 +882,8 @@ QtCurveStyle::QtCurveStyle()
itsActive ( true ) ,
itsActive ( true ) ,
itsIsSpecialHover ( false ) ,
itsIsSpecialHover ( false ) ,
itsDragWidget ( 0L ) ,
itsDragWidget ( 0L ) ,
itsDragWidgetHadMouseTracking ( false )
itsDragWidgetHadMouseTracking ( false ) ,
itsShortcutHandler ( new ShortcutHandler ( this ) )
{
{
# ifdef TQTC_STYLE_SUPPORT
# ifdef TQTC_STYLE_SUPPORT
TQString rcFile ;
TQString rcFile ;
@ -1108,10 +1125,6 @@ QtCurveStyle::QtCurveStyle()
setMenuColors ( TQApplication : : palette ( ) . active ( ) ) ;
setMenuColors ( TQApplication : : palette ( ) . active ( ) ) ;
if ( USE_LIGHTER_POPUP_MENU )
itsLighterPopupMenuBgndCol = shade ( itsBackgroundCols [ ORIGINAL_SHADE ] ,
TO_FACTOR ( opts . lighterPopupMenuBgnd ) ) ;
if ( ( SHADE_CUSTOM = = opts . shadeMenubars | | SHADE_BLEND_SELECTED = = opts . shadeMenubars | | SHADE_SELECTED = = opts . shadeMenubars ) & &
if ( ( SHADE_CUSTOM = = opts . shadeMenubars | | SHADE_BLEND_SELECTED = = opts . shadeMenubars | | SHADE_SELECTED = = opts . shadeMenubars ) & &
" soffice.bin " = = TQString ( tqApp - > argv ( ) [ 0 ] ) & & TOO_DARK ( SHADE_CUSTOM = = opts . shadeMenubars
" soffice.bin " = = TQString ( tqApp - > argv ( ) [ 0 ] ) & & TOO_DARK ( SHADE_CUSTOM = = opts . shadeMenubars
? opts . customMenubarsColor
? opts . customMenubarsColor
@ -1143,9 +1156,10 @@ QtCurveStyle::QtCurveStyle()
QtCurveStyle : : ~ QtCurveStyle ( )
QtCurveStyle : : ~ QtCurveStyle ( )
{
{
if ( itsSidebarButtonsCols ! = itsSliderCols & &
if ( itsSidebarButtonsCols ! = itsSliderCols & & itsSidebarButtonsCols ! = itsDefBtnCols )
itsSidebarButtonsCols ! = itsDefBtnCols )
delete [ ] itsSidebarButtonsCols ;
delete [ ] itsSidebarButtonsCols ;
if ( itsPopupMenuCols & & itsPopupMenuCols ! = itsMenubarCols & & itsPopupMenuCols ! = itsBackgroundCols & & itsPopupMenuCols ! = itsActiveMdiColors )
delete [ ] itsPopupMenuCols ;
if ( itsActiveMdiColors & & itsActiveMdiColors ! = itsHighlightCols & & itsActiveMdiColors ! = itsBackgroundCols )
if ( itsActiveMdiColors & & itsActiveMdiColors ! = itsHighlightCols & & itsActiveMdiColors ! = itsBackgroundCols )
delete [ ] itsActiveMdiColors ;
delete [ ] itsActiveMdiColors ;
if ( itsMdiColors & & itsMdiColors ! = itsBackgroundCols )
if ( itsMdiColors & & itsMdiColors ! = itsBackgroundCols )
@ -1184,6 +1198,12 @@ static TQString getFile(const TQString &f)
return d ;
return d ;
}
}
inline void addEventFilter ( TQObject * object , TQObject * filter )
{
object - > removeEventFilter ( filter ) ;
object - > installEventFilter ( filter ) ;
}
void QtCurveStyle : : applicationPolish ( const TQStyleControlElementData & ceData , ControlElementFlags elementFlags , void * ptr )
void QtCurveStyle : : applicationPolish ( const TQStyleControlElementData & ceData , ControlElementFlags elementFlags , void * ptr )
{
{
if ( ceData . widgetObjectTypes . contains ( TQAPPLICATION_OBJECT_NAME_STRING ) ) {
if ( ceData . widgetObjectTypes . contains ( TQAPPLICATION_OBJECT_NAME_STRING ) ) {
@ -1276,6 +1296,19 @@ void QtCurveStyle::applicationPolish(const TQStyleControlElementData &ceData, Co
if ( opts . fixParentlessDialogs & & ( opts . noDlgFixApps . contains ( appName ) | | opts . noDlgFixApps . contains ( " kde " ) ) )
if ( opts . fixParentlessDialogs & & ( opts . noDlgFixApps . contains ( appName ) | | opts . noDlgFixApps . contains ( " kde " ) ) )
opts . fixParentlessDialogs = false ;
opts . fixParentlessDialogs = false ;
# endif
# endif
// BASE_STYLE::polish(app);
if ( opts . hideShortcutUnderline )
addEventFilter ( app , itsShortcutHandler ) ;
}
}
void QtCurveStyle : : applicationUnPolish ( const TQStyleControlElementData & ceData , ControlElementFlags elementFlags , void * ptr )
{
if ( ceData . widgetObjectTypes . contains ( TQAPPLICATION_OBJECT_NAME_STRING ) ) {
TQApplication * app = reinterpret_cast < TQApplication * > ( ptr ) ;
if ( opts . hideShortcutUnderline )
app - > removeEventFilter ( itsShortcutHandler ) ;
// BASE_STYLE::unPolish(app);
}
}
}
}
@ -1408,10 +1441,6 @@ void QtCurveStyle::polish(TQPalette &pal)
shadeColors ( midColor ( itsHighlightCols [ ORIGINAL_SHADE ] ,
shadeColors ( midColor ( itsHighlightCols [ ORIGINAL_SHADE ] ,
itsButtonCols [ ORIGINAL_SHADE ] ) , itsSidebarButtonsCols ) ;
itsButtonCols [ ORIGINAL_SHADE ] ) , itsSidebarButtonsCols ) ;
if ( USE_LIGHTER_POPUP_MENU & & newGray )
itsLighterPopupMenuBgndCol = shade ( itsBackgroundCols [ ORIGINAL_SHADE ] ,
TO_FACTOR ( opts . lighterPopupMenuBgnd ) ) ;
if ( newCheckRadioSelCols ) {
if ( newCheckRadioSelCols ) {
if ( SHADE_BLEND_SELECTED = = opts . crColor ) {
if ( SHADE_BLEND_SELECTED = = opts . crColor ) {
shadeColors ( midColor ( itsHighlightCols [ ORIGINAL_SHADE ] , itsButtonCols [ ORIGINAL_SHADE ] ) , itsCheckRadioSelCols ) ;
shadeColors ( midColor ( itsHighlightCols [ ORIGINAL_SHADE ] , itsButtonCols [ ORIGINAL_SHADE ] ) , itsCheckRadioSelCols ) ;
@ -2130,7 +2159,8 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
{
{
TQWidget * widget = ( TQWidget * ) object ;
TQWidget * widget = ( TQWidget * ) object ;
TQPainter painter ( widget ) ;
TQPainter painter ( widget ) ;
TQColor col ( popupMenuCol ( widget - > palette ( ) . active ( ) ) ) ;
const TQColor * pc ( popupMenuCols ( widget - > palette ( ) . active ( ) ) ) ;
TQColor col ( pc [ ORIGINAL_SHADE ] ) ;
if ( APPEARANCE_STRIPED = = opts . menuBgndAppearance )
if ( APPEARANCE_STRIPED = = opts . menuBgndAppearance )
{
{
@ -2143,7 +2173,7 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
}
}
else
else
{
{
drawBevelGradientReal ( col , & painter , ceData . rect , GT_HORIZ = = opts . menuBgndGrad , false ,
drawBevelGradientReal ( col , col , & painter , ceData . rect , GT_HORIZ = = opts . menuBgndGrad , false ,
opts . menuBgndAppearance , WIDGET_OTHER ) ;
opts . menuBgndAppearance , WIDGET_OTHER ) ;
}
}
return false ;
return false ;
@ -2478,12 +2508,13 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
itsHoverTab = 0L ;
itsHoverTab = 0L ;
itsHoverWidget - > repaint ( false ) ;
itsHoverWidget - > repaint ( false ) ;
}
}
else if ( ! itsHoverWidget - > hasMouseTracking ( ) | |
else if ( ! itsHoverWidget - > hasMouseTracking ( ) | | ( itsFormMode = isFormWidget ( itsHoverWidget ) ) )
( itsFormMode = isFormWidget ( itsHoverWidget ) ) )
{
{
itsHoverWidget - > repaint ( false ) ;
itsHoverWidget - > repaint ( false ) ;
itsFormMode = false ;
itsFormMode = false ;
}
}
else if ( opts . highlightScrollViews & & : : tqqt_cast < TQScrollView * > ( itsHoverWidget ) )
itsHoverWidget - > repaint ( false ) ;
}
}
else
else
itsHoverWidget = 0L ;
itsHoverWidget = 0L ;
@ -2519,38 +2550,38 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
return BASE_STYLE : : objectEventHandler ( ceData , elementFlags , source , event ) ;
return BASE_STYLE : : objectEventHandler ( ceData , elementFlags , source , event ) ;
}
}
void QtCurveStyle : : drawLightBevel ( const TQColor & bgnd , TQPainter * p , const TQRect & rOrig ,
void QtCurveStyle : : drawLightBevel ( const TQColor & bgnd , TQPainter * p , const TQRect & rOrig , const TQColorGroup & cg , SFlags flags , int round ,
const TQColorGroup & cg , SFlags flags ,
const TQColor & fill , const TQColor * custom , bool doBorder , bool doCorners , EWidget w , const TQWidget * widget ) const
int round , const TQColor & fill , const TQColor * custom ,
bool doBorder , bool doCorners , EWidget w ) const
{
{
EAppearance app ( widgetApp ( w , & opts ) ) ;
EAppearance app ( widgetApp ( APPEARANCE_NONE ! = opts . tbarBtnAppearance & &
( WIDGET_TOOLBAR_BUTTON = = w | | ( WIDGET_BUTTON ( w ) & & isOnToolbar ( widget , p ) ) )
? WIDGET_TOOLBAR_BUTTON : w , & opts ) ) ;
TQRect r ( rOrig ) ,
TQRect r ( rOrig ) ,
br ( r ) ;
br ( r ) ;
bool bevelledButton ( WIDGET_BUTTON ( w ) & & APPEARANCE_BEVELLED = = app ) ,
bool bevelledButton ( WIDGET_BUTTON ( w ) & & APPEARANCE_BEVELLED = = app ) ,
sunken ( flags & ( Style_Down | Style_On | Style_Sunken ) ) ,
sunken ( flags & ( Style_Down | Style_On | Style_Sunken ) ) ,
flatWidget ( WIDGET_PROGRESSBAR = = w & & ! opts . borderProgress ) ,
flatWidget ( WIDGET_PROGRESSBAR = = w & & ! opts . borderProgress ) ,
lightBorder ( ! flatWidget & & DRAW_LIGHT_BORDER ( sunken , w , app ) ) ,
lightBorder ( ! flatWidget & & DRAW_LIGHT_BORDER ( sunken , w , app ) ) ,
draw3dfull ( ! flatWidget & & ! lightBorder & & DRAW_3D_FULL_BORDER ( sunken , app ) ) ,
draw3dfull ( ! flatWidget & & ! lightBorder & & DRAW_3D_FULL_BORDER ( sunken , app ) ) ,
draw3d ( ! flatWidget & & ( draw3dfull | | ( ! lightBorder & & DRAW_3D_BORDER ( sunken , app ) ) ) ) ,
draw3d ( ! flatWidget & & ( draw3dfull | | ( ! lightBorder & & DRAW_3D_BORDER ( sunken , app ) ) ) ) ,
doColouredMouseOver ( ! sunken & & doBorder & &
doColouredMouseOver ( ! sunken & & doBorder & &
opts . coloredMouseOver & & flags & Style_MouseOver & &
opts . coloredMouseOver & & flags & Style_MouseOver & &
WIDGET_SPIN ! = w & & WIDGET_COMBO_BUTTON ! = w & & WIDGET_SB_BUTTON ! = w & &
WIDGET_SPIN ! = w & & WIDGET_COMBO_BUTTON ! = w & & WIDGET_SB_BUTTON ! = w & &
( WIDGET_SB_SLIDER ! = w | | ! opts . colorSliderMouseOver ) & &
( WIDGET_SB_SLIDER ! = w | | ! opts . colorSliderMouseOver ) & &
! ( flags & DW_CLOSE_BUTTON ) & &
! ( flags & DW_CLOSE_BUTTON ) & &
( opts . coloredTbarMo | | ! ( flags & STD_TOOLBUTTON ) ) & &
( opts . coloredTbarMo | | ! ( flags & STD_TOOLBUTTON ) ) & &
( flags & CHECK_BUTTON | | flags & TOGGLE_BUTTON | | ! sunken ) ) ,
( flags & CHECK_BUTTON | | flags & TOGGLE_BUTTON | | ! sunken ) ) ,
plastikMouseOver ( doColouredMouseOver & & MO_PLASTIK = = opts . coloredMouseOver ) ,
plastikMouseOver ( doColouredMouseOver & & MO_PLASTIK = = opts . coloredMouseOver ) ,
colouredMouseOver ( doColouredMouseOver & &
colouredMouseOver ( doColouredMouseOver & &
( MO_COLORED = = opts . coloredMouseOver | | MO_COLORED_THICK = = opts . coloredMouseOver | |
( MO_COLORED = = opts . coloredMouseOver | | MO_COLORED_THICK = = opts . coloredMouseOver | |
( MO_GLOW = = opts . coloredMouseOver & & itsFormMode ) ) ) ,
( MO_GLOW = = opts . coloredMouseOver & & itsFormMode ) ) ) ,
doEtch ( ! itsFormMode & & doBorder & & ETCH_WIDGET ( w ) & & ! ( flags & CHECK_BUTTON ) & &
doEtch ( ! itsFormMode & & doBorder & & ETCH_WIDGET ( w ) & & ! ( flags & CHECK_BUTTON ) & &
DO_EFFECT ) ,
DO_EFFECT ) ,
glowFocus ( doEtch & & USE_GLOW_FOCUS ( flags & Style_MouseOver ) & & flags & Style_HasFocus & & flags & Style_Enabled ) ,
glowFocus ( doEtch & & USE_GLOW_FOCUS ( flags & Style_MouseOver ) & & flags & Style_HasFocus & & flags & Style_Enabled ) ,
sunkenToggleMo ( sunken & & ! ( flags & Style_Down ) & & flags & ( Style_MouseOver | TOGGLE_BUTTON ) ) ,
sunkenToggleMo ( sunken & & ! ( flags & Style_Down ) & & flags & ( Style_MouseOver | TOGGLE_BUTTON ) ) ,
horiz ( flags & Style_Horizontal ) ;
horiz ( flags & Style_Horizontal ) ;
const TQColor * cols ( custom ? custom : itsBackgroundCols ) ,
const TQColor * cols ( custom ? custom : itsBackgroundCols ) ,
* border ( colouredMouseOver ? borderColors ( flags , cols ) : cols ) ;
* border ( colouredMouseOver ? borderColors ( flags , cols ) : cols ) ;
p - > save ( ) ;
p - > save ( ) ;
@ -2570,7 +2601,7 @@ void QtCurveStyle::drawLightBevel(const TQColor &bgnd, TQPainter *p, const TQRec
p - > setClipRegion ( p - > clipRegion ( ) . eor ( TQRegion ( br ) ) ) ;
p - > setClipRegion ( p - > clipRegion ( ) . eor ( TQRegion ( br ) ) ) ;
}
}
br . addCoords ( 1 , 1 , - 1 , - 1 ) ;
br . addCoords ( 1 , 1 , - 1 , - 1 ) ;
drawBevelGradient ( fill , p, br , horiz , sunken , app , w ) ;
drawBevelGradient ( fill , bgnd, p, br , horiz , sunken , app , w ) ;
br . addCoords ( - 1 , - 1 , 1 , 1 ) ;
br . addCoords ( - 1 , - 1 , 1 , 1 ) ;
if ( WIDGET_PROGRESSBAR = = w & & opts . stripedProgress )
if ( WIDGET_PROGRESSBAR = = w & & opts . stripedProgress )
p - > restore ( ) ;
p - > restore ( ) ;
@ -2642,16 +2673,16 @@ void QtCurveStyle::drawLightBevel(const TQColor &bgnd, TQPainter *p, const TQRec
if ( horiz )
if ( horiz )
{
{
drawBevelGradient ( itsMouseOverCols [ col ] , p, TQRect ( r . x ( ) + so , r . y ( ) , len , r . height ( ) ) ,
drawBevelGradient ( itsMouseOverCols [ col ] , bgnd, p, TQRect ( r . x ( ) + so , r . y ( ) , len , r . height ( ) ) ,
horiz , sunken , app , w ) ;
horiz , sunken , app , w ) ;
drawBevelGradient ( itsMouseOverCols [ col ] , p, TQRect ( r . x ( ) + r . width ( ) - eo , r . y ( ) , len , r . height ( ) ) ,
drawBevelGradient ( itsMouseOverCols [ col ] , bgnd, p, TQRect ( r . x ( ) + r . width ( ) - eo , r . y ( ) , len , r . height ( ) ) ,
horiz , sunken , app , w ) ;
horiz , sunken , app , w ) ;
}
}
else
else
{
{
drawBevelGradient ( itsMouseOverCols [ col ] , p, TQRect ( r . x ( ) , r . y ( ) + so , r . width ( ) , len ) ,
drawBevelGradient ( itsMouseOverCols [ col ] , bgnd, p, TQRect ( r . x ( ) , r . y ( ) + so , r . width ( ) , len ) ,
horiz , sunken , app , w ) ;
horiz , sunken , app , w ) ;
drawBevelGradient ( itsMouseOverCols [ col ] , p, TQRect ( r . x ( ) , r . y ( ) + r . height ( ) - eo , r . width ( ) , len ) ,
drawBevelGradient ( itsMouseOverCols [ col ] , bgnd, p, TQRect ( r . x ( ) , r . y ( ) + r . height ( ) - eo , r . width ( ) , len ) ,
horiz , sunken , app , w ) ;
horiz , sunken , app , w ) ;
}
}
}
}
@ -2736,7 +2767,7 @@ void QtCurveStyle::drawLightBevel(const TQColor &bgnd, TQPainter *p, const TQRec
drawGlow ( p , rOrig , cg , WIDGET_DEF_BUTTON = = w & & flags & Style_MouseOver ? WIDGET_STD_BUTTON : w ,
drawGlow ( p , rOrig , cg , WIDGET_DEF_BUTTON = = w & & flags & Style_MouseOver ? WIDGET_STD_BUTTON : w ,
glowFocus ? itsFocusCols : 0 ) ;
glowFocus ? itsFocusCols : 0 ) ;
else
else
drawEtch ( p , rOrig , cg , EFFECT_SHADOW = = opts . buttonEffect & & WIDGET_BUTTON ( w ) & & ! sunken , ROUNDED_NONE = = round );
drawEtch ( p , rOrig , cg , EFFECT_SHADOW = = opts . buttonEffect & & WIDGET_BUTTON ( w ) & & ! sunken , ROUNDED_NONE = = round , w );
}
}
p - > restore ( ) ;
p - > restore ( ) ;
@ -2777,12 +2808,15 @@ void QtCurveStyle::drawGlow(TQPainter *p, const TQRect &r, const TQColorGroup &c
}
}
}
}
void QtCurveStyle : : drawEtch ( TQPainter * p , const TQRect & r , const TQColorGroup & cg , bool raised , bool square ) const
void QtCurveStyle : : drawEtch ( TQPainter * p , const TQRect & r , const TQColorGroup & cg , bool raised , bool square , EWidget w ) const
{
{
square = square | | ROUND_NONE = = opts . round ;
square = square | | ROUND_NONE = = opts . round ;
int mod ( square ? 0 : 2 ) ;
int mod ( square ? 0 : 2 ) ;
if ( WIDGET_TOOLBAR_BUTTON = = w & & EFFECT_ETCH = = opts . tbarBtnEffect )
raised = false ;
{
{
TQColor col ( raised ? shade ( cg . background ( ) , ETCHED_DARK ) : itsBackgroundCols [ 1 ] ) ;
TQColor col ( raised ? shade ( cg . background ( ) , ETCHED_DARK ) : itsBackgroundCols [ 1 ] ) ;
@ -3311,7 +3345,7 @@ void QtCurveStyle::drawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const TQS
bool sunken ( flags & ( Style_Down | Style_On | Style_Sunken ) ) ;
bool sunken ( flags & ( Style_Down | Style_On | Style_Sunken ) ) ;
drawBevelGradient ( getFill ( flags , use ) , p, r , flags & Style_Horizontal ,
drawBevelGradient ( getFill ( flags , use ) , cg. background ( ) , p, r , flags & Style_Horizontal ,
sunken , opts . lvAppearance , WIDGET_LISTVIEW_HEADER ) ;
sunken , opts . lvAppearance , WIDGET_LISTVIEW_HEADER ) ;
if ( APPEARANCE_RAISED = = opts . lvAppearance )
if ( APPEARANCE_RAISED = = opts . lvAppearance )
@ -3589,7 +3623,7 @@ void QtCurveStyle::drawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const TQS
if ( IS_FLAT ( opts . appearance ) )
if ( IS_FLAT ( opts . appearance ) )
p - > fillRect ( TQRect ( rect . x ( ) + 1 , rect . y ( ) + 1 , rect . width ( ) - 2 , rect . height ( ) - 2 ) , bgnd ) ;
p - > fillRect ( TQRect ( rect . x ( ) + 1 , rect . y ( ) + 1 , rect . width ( ) - 2 , rect . height ( ) - 2 ) , bgnd ) ;
else
else
drawBevelGradient ( bgnd , p, TQRect ( rect . x ( ) + 1 , rect . y ( ) + 1 , rect . width ( ) - 2 , rect . height ( ) - 2 ) , true ,
drawBevelGradient ( bgnd , bgnd, p, TQRect ( rect . x ( ) + 1 , rect . y ( ) + 1 , rect . width ( ) - 2 , rect . height ( ) - 2 ) , true ,
drawSunken , app , wid ) ;
drawSunken , app , wid ) ;
if ( MO_NONE ! = opts . coloredMouseOver & & ! glow & & sflags & Style_MouseOver & & sflags & Style_Enabled )
if ( MO_NONE ! = opts . coloredMouseOver & & ! glow & & sflags & Style_MouseOver & & sflags & Style_Enabled )
@ -3722,7 +3756,7 @@ void QtCurveStyle::drawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const TQS
p - > save ( ) ;
p - > save ( ) ;
if ( opts . crHighlight & & sflags & Style_MouseOver )
if ( opts . crHighlight & & sflags & Style_MouseOver )
drawBevelGradient ( shade ( cg . background ( ) , TO_FACTOR ( opts . crHighlight ) ) , p, r , true ,
drawBevelGradient ( shade ( cg . background ( ) , TO_FACTOR ( opts . crHighlight ) ) , cg. background ( ) , p, r , true ,
false , opts . selectionAppearance , WIDGET_SELECTION ) ;
false , opts . selectionAppearance , WIDGET_SELECTION ) ;
else
else
p - > fillRect ( r , cg . background ( ) ) ;
p - > fillRect ( r , cg . background ( ) ) ;
@ -3739,7 +3773,7 @@ void QtCurveStyle::drawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const TQS
if ( IS_FLAT ( opts . appearance ) )
if ( IS_FLAT ( opts . appearance ) )
p - > fillRect ( TQRect ( x + 1 , y + 1 , rect . width ( ) - 2 , rect . height ( ) - 2 ) , bgnd ) ;
p - > fillRect ( TQRect ( x + 1 , y + 1 , rect . width ( ) - 2 , rect . height ( ) - 2 ) , bgnd ) ;
else
else
drawBevelGradient ( bgnd , p, TQRect ( x + 1 , y + 1 , rect . width ( ) - 2 , rect . height ( ) - 2 ) , true ,
drawBevelGradient ( bgnd , bgnd, p, TQRect ( x + 1 , y + 1 , rect . width ( ) - 2 , rect . height ( ) - 2 ) , true ,
drawSunken , app , wid ) ;
drawSunken , app , wid ) ;
if ( coloredMo )
if ( coloredMo )
@ -3865,7 +3899,7 @@ void QtCurveStyle::drawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const TQS
color = shade ( color , TO_FACTOR ( opts . tabBgnd ) ) ;
color = shade ( color , TO_FACTOR ( opts . tabBgnd ) ) ;
if ( flags & Style_MouseOver & & opts . splitterHighlight )
if ( flags & Style_MouseOver & & opts . splitterHighlight )
drawBevelGradient ( shade ( cg . background ( ) , TO_FACTOR ( opts . splitterHighlight ) ) , p, r , ! ( flags & Style_Horizontal ) ,
drawBevelGradient ( shade ( cg . background ( ) , TO_FACTOR ( opts . splitterHighlight ) ) , cg. background ( ) , p, r , ! ( flags & Style_Horizontal ) ,
false , opts . selectionAppearance , WIDGET_SELECTION ) ;
false , opts . selectionAppearance , WIDGET_SELECTION ) ;
else
else
p - > fillRect ( r , color ) ;
p - > fillRect ( r , color ) ;
@ -3930,8 +3964,6 @@ void QtCurveStyle::drawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const TQS
( sv | |
( sv | |
( widget & & widget - > parentWidget ( ) & & : : tqqt_cast < const TQFrame * > ( widget ) & &
( widget & & widget - > parentWidget ( ) & & : : tqqt_cast < const TQFrame * > ( widget ) & &
widget - > parentWidget ( ) - > inherits ( " KateView " ) ) ) ) ;
widget - > parentWidget ( ) - > inherits ( " KateView " ) ) ) ) ;
const TQColor * use ( opts . highlightScrollViews & & /*!square &&*/ flags & Style_HasFocus ? itsHighlightCols :
backgroundColors ( cg ) ) ;
// if(square)
// if(square)
// {
// {
@ -3950,19 +3982,29 @@ void QtCurveStyle::drawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const TQS
flags & = ~ Style_HasFocus ;
flags & = ~ Style_HasFocus ;
if ( sv & & opts . etchEntry & & ( ( TQFrame * ) widget ) - > lineWidth ( ) > 2 )
if ( sv & & opts . etchEntry & & ( ( TQFrame * ) widget ) - > lineWidth ( ) > 2 )
{
{
drawEntryField ( p , r , cg , flags , flags & Style_Enabled
drawEntryField ( p , r , cg , flags , flags & Style_Enabled & & opts . highlightScrollViews
? /*flags&Style_MouseOver
? flags & Style_MouseOver
? ENTRY_MOUSE_OVER
? ENTRY_MOUSE_OVER
: */ flags & Style_HasFocus
: flags & Style_HasFocus
? ENTRY_FOCUS
? ENTRY_FOCUS
: ENTRY_NONE
: ENTRY_NONE
: ENTRY_NONE , square ? ROUNDED_NONE : ROUNDED_ALL , WIDGET_SCROLLVIEW ) ;
: ENTRY_NONE , square ? ROUNDED_NONE : ROUNDED_ALL , WIDGET_SCROLLVIEW ) ;
}
}
else
else
{
const TQColor * use ( sv & & opts . highlightScrollViews
? widget = = itsHoverWidget
? itsMouseOverCols
: flags & Style_HasFocus
? itsFocusCols
: backgroundColors ( cg )
: backgroundColors ( cg ) ) ;
drawBorder ( cg . background ( ) , p , r , cg ,
drawBorder ( cg . background ( ) , p , r , cg ,
( SFlags ) ( flags | Style_Horizontal | Style_Enabled ) ,
( SFlags ) ( flags | Style_Horizontal | Style_Enabled ) ,
square ? ROUNDED_NONE : ROUNDED_ALL , use , sv ? WIDGET_SCROLLVIEW : WIDGET_OTHER , APP_KICKER ! = itsThemedApp ,
square ? ROUNDED_NONE : ROUNDED_ALL , use , sv ? WIDGET_SCROLLVIEW : WIDGET_OTHER , APP_KICKER ! = itsThemedApp ,
itsIsTransKicker ? BORDER_FLAT : ( flags & Style_Sunken ? BORDER_SUNKEN : BORDER_RAISED ) ) ;
itsIsTransKicker ? BORDER_FLAT : ( flags & Style_Sunken ? BORDER_SUNKEN : BORDER_RAISED ) ) ;
}
itsFormMode = false ;
itsFormMode = false ;
}
}
}
}
@ -3996,7 +4038,7 @@ void QtCurveStyle::drawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const TQS
else
else
{
{
if ( GB_3D = = border )
if ( GB_3D = = border )
p - > setPen ( popupMenuCol( cg ) ) ;
p - > setPen ( use[ ORIGINAL_SHADE ] ) ;
p - > drawLine ( r . x ( ) + 1 , r . y ( ) + 1 , r . x ( ) + r . width ( ) - 2 , r . y ( ) + 1 ) ;
p - > drawLine ( r . x ( ) + 1 , r . y ( ) + 1 , r . x ( ) + r . width ( ) - 2 , r . y ( ) + 1 ) ;
p - > drawLine ( r . x ( ) + 1 , r . y ( ) + 1 , r . x ( ) + 1 , r . y ( ) + r . height ( ) - 2 ) ;
p - > drawLine ( r . x ( ) + 1 , r . y ( ) + 1 , r . x ( ) + 1 , r . y ( ) + r . height ( ) - 2 ) ;
p - > setPen ( use [ FRAME_DARK_SHADOW ] ) ;
p - > setPen ( use [ FRAME_DARK_SHADOW ] ) ;
@ -4006,7 +4048,7 @@ void QtCurveStyle::drawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const TQS
}
}
else if ( IS_FLAT_BGND ( opts . menuBgndAppearance ) )
else if ( IS_FLAT_BGND ( opts . menuBgndAppearance ) )
{
{
p - > setPen ( /*USE_LIGHTER_POPUP_MENU ? */ popupMenuCol( cg ) /* : cg.background()*/ ) ;
p - > setPen ( /*USE_LIGHTER_POPUP_MENU ? */ use[ ORIGINAL_SHADE ] /* : cg.background()*/ ) ;
p - > drawRect ( TQRect ( r . x ( ) + 1 , r . y ( ) + 1 , r . width ( ) - 2 , r . height ( ) - 2 ) ) ;
p - > drawRect ( TQRect ( r . x ( ) + 1 , r . y ( ) + 1 , r . width ( ) - 2 , r . height ( ) - 2 ) ) ;
}
}
break ;
break ;
@ -4140,7 +4182,7 @@ void QtCurveStyle::drawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const TQS
p - > setClipRegion ( TQRegion ( s2 ) + TQRegion ( addpage ) ) ;
p - > setClipRegion ( TQRegion ( s2 ) + TQRegion ( addpage ) ) ;
if ( opts . flatSbarButtons & & SCROLLBAR_NONE ! = opts . scrollbarType & & ROUNDED & & ! IS_FLAT ( opts . sbarBgndAppearance ) )
if ( opts . flatSbarButtons & & SCROLLBAR_NONE ! = opts . scrollbarType & & ROUNDED & & ! IS_FLAT ( opts . sbarBgndAppearance ) )
drawBevelGradient ( itsBackgroundCols [ ORIGINAL_SHADE ] , p, r , flags & Style_Horizontal , false ,
drawBevelGradient ( itsBackgroundCols [ ORIGINAL_SHADE ] , itsBackgroundCols[ ORIGINAL_SHADE ] , p, r , flags & Style_Horizontal , false ,
opts . sbarBgndAppearance , WIDGET_SB_BGND ) ;
opts . sbarBgndAppearance , WIDGET_SB_BGND ) ;
else if ( opts . thinSbarGroove & & ( SCROLLBAR_NONE = = opts . scrollbarType | | opts . flatSbarButtons ) & & IS_FLAT ( opts . sbarBgndAppearance ) )
else if ( opts . thinSbarGroove & & ( SCROLLBAR_NONE = = opts . scrollbarType | | opts . flatSbarButtons ) & & IS_FLAT ( opts . sbarBgndAppearance ) )
{
{
@ -4430,8 +4472,8 @@ void QtCurveStyle::drawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const TQS
TQRect r2 ( r ) ;
TQRect r2 ( r ) ;
r2 . addCoords ( 1 , 1 , - 1 , - 1 ) ;
r2 . addCoords ( 1 , 1 , - 1 , - 1 ) ;
// p->fillRect(r2, flags&Style_Enabled ? cg.base() : cg.background());
// p->fillRect(r2, flags&Style_Enabled ? cg.base() : cg.background());
drawEntryField ( p , r , cg , flags , ! isReadOnly & & isEnabled
drawEntryField ( p , r , cg , flags , ! isReadOnly & & isEnabled & & ( ! scrollView | | opts . highlightScrollViews )
? flags & Style_MouseOver & & ! scrollView
? flags & Style_MouseOver
? ENTRY_MOUSE_OVER
? ENTRY_MOUSE_OVER
: flags & Style_HasFocus
: flags & Style_HasFocus
? ENTRY_FOCUS
? ENTRY_FOCUS
@ -4557,7 +4599,7 @@ void QtCurveStyle::drawTDEStylePrimitive(TDEStylePrimitive kpe, TQPainter *p, co
r . rect ( & x , & y , & w , & h ) ;
r . rect ( & x , & y , & w , & h ) ;
if ( ! IS_FLAT ( opts . dwtAppearance ) )
if ( ! IS_FLAT ( opts . dwtAppearance ) )
drawBevelGradient ( cg . background ( ) , p, r , horizontal , false , opts . dwtAppearance , WIDGET_DOCK_WIDGET_TITLE ) ;
drawBevelGradient ( cg . background ( ) , cg. background ( ) , p, r , horizontal , false , opts . dwtAppearance , WIDGET_DOCK_WIDGET_TITLE ) ;
else
else
p - > fillRect ( r , cg . background ( ) ) ; // .dark(DW_BGND));
p - > fillRect ( r , cg . background ( ) ) ; // .dark(DW_BGND));
// p->setPen(itsBackgroundCols[STD_BORDER]);
// p->setPen(itsBackgroundCols[STD_BORDER]);
@ -4784,7 +4826,7 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
if ( invertedSel )
if ( invertedSel )
p - > fillRect ( glowTr , col ) ;
p - > fillRect ( glowTr , col ) ;
else
else
drawBevelGradient ( col , p, glowTr , true ,
drawBevelGradient ( col , cg. background ( ) , p, glowTr , true ,
active , active ? SEL_TAB_APP : NORM_TAB_APP , top ? WIDGET_TAB_TOP : WIDGET_TAB_BOT ) ;
active , active ? SEL_TAB_APP : NORM_TAB_APP , top ? WIDGET_TAB_TOP : WIDGET_TAB_BOT ) ;
drawBorder ( cg . background ( ) , p , glowTr , cg , flags | Style_Horizontal | Style_Enabled ,
drawBorder ( cg . background ( ) , p , glowTr , cg , flags | Style_Horizontal | Style_Enabled ,
@ -4989,7 +5031,7 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
}
}
}
}
drawItem ( p , tr , AlignCenter | ShowPrefix , cg , flags & Style_Enabled , 0 , t - > text ( ) ) ;
drawItem ( p , tr , AlignCenter | ShowPrefix | ( styleHint ( SH_UnderlineAccelerator , ceData , elementFlags , data , 0 , widget ) ? 0 : NoAccel ) , cg , flags & Style_Enabled , 0 , t - > text ( ) ) ;
if ( ( flags & Style_HasFocus ) & & ! t - > text ( ) . isEmpty ( ) )
if ( ( flags & Style_HasFocus ) & & ! t - > text ( ) . isEmpty ( ) )
{
{
@ -5095,7 +5137,8 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
// Make the label indicate if the button is a default button or not
// Make the label indicate if the button is a default button or not
int i ,
int i ,
j ( opts . embolden & & ( elementFlags & CEF_IsDefault ) ? 2 : 1 ) ;
j ( opts . embolden & & button - > isDefault ( ) ? 2 : 1 ) ,
textFlags ( AlignCenter | ShowPrefix | ( styleHint ( SH_UnderlineAccelerator , ceData , elementFlags , data , 0 , widget ) ? 0 : NoAccel ) ) ;
bool sidebar ( ! opts . stdSidebarButtons & &
bool sidebar ( ! opts . stdSidebarButtons & &
( ( ( elementFlags & CEF_IsFlat ) & & button - > inherits ( " KMultiTabBarTab " ) ) | |
( ( ( elementFlags & CEF_IsFlat ) & & button - > inherits ( " KMultiTabBarTab " ) ) | |
( ( elementFlags & CEF_HasParentWidget ) & & button - > inherits ( " Ideal::Button " ) & &
( ( elementFlags & CEF_HasParentWidget ) & & button - > inherits ( " Ideal::Button " ) & &
@ -5105,7 +5148,7 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
: ceData . colorGroup . buttonText ( ) ) ;
: ceData . colorGroup . buttonText ( ) ) ;
for ( i = 0 ; i < j ; i + + )
for ( i = 0 ; i < j ; i + + )
drawItem ( p , TQRect ( x + i , y , w , h ) , AlignCen ter| ShowPrefi x, ceData . colorGroup ,
drawItem ( p , TQRect ( x + i , y , w , h ) , textFlags , ceData . colorGroup ,
( elementFlags & CEF_IsEnabled ) ,
( elementFlags & CEF_IsEnabled ) ,
button - > pixmap ( ) , button - > text ( ) , - 1 , & textCol ) ;
button - > pixmap ( ) , button - > text ( ) , - 1 , & textCol ) ;
@ -5127,6 +5170,7 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
maxpmw ( data . maxIconWidth ( ) ) ,
maxpmw ( data . maxIconWidth ( ) ) ,
x , y , w , h ;
x , y , w , h ;
bool reverse ( TQApplication : : reverseLayout ( ) ) ;
bool reverse ( TQApplication : : reverseLayout ( ) ) ;
const TQColor * use ( popupMenuCols ( cg ) ) ;
maxpmw = TQMAX ( maxpmw , constMenuPixmapWidth ) ;
maxpmw = TQMAX ( maxpmw , constMenuPixmapWidth ) ;
r . rect ( & x , & y , & w , & h ) ;
r . rect ( & x , & y , & w , & h ) ;
@ -5136,17 +5180,17 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
else
else
{
{
if ( IS_FLAT_BGND ( opts . menuBgndAppearance ) )
if ( IS_FLAT_BGND ( opts . menuBgndAppearance ) )
p - > fillRect ( r , popupMenuCol( cg ) ) ;
p - > fillRect ( r , use[ ORIGINAL_SHADE ] ) ;
if ( opts . menuStripe )
if ( opts . menuStripe )
drawBevelGradient ( menuStripeCol ( cg ) , p,
drawBevelGradient ( menuStripeCol ( cg ) , use[ ORIGINAL_SHADE ] , p,
TQRect ( reverse ? r . right ( ) - maxpmw : r . x ( ) ,
TQRect ( reverse ? r . right ( ) - maxpmw : r . x ( ) ,
r . y ( ) , maxpmw , r . height ( ) ) , false ,
r . y ( ) , maxpmw , r . height ( ) ) , false ,
false , opts . menuStripeAppearance , WIDGET_OTHER ) ;
false , opts . menuStripeAppearance , WIDGET_OTHER ) ;
}
}
if ( ( flags & Style_Active ) & & ( flags & Style_Enabled ) )
if ( ( flags & Style_Active ) & & ( flags & Style_Enabled ) )
drawMenuItem ( p , r , flags , cg , false , ROUNDED_ALL , popupMenuCol( cg ) ,
drawMenuItem ( p , r , flags , cg , false , ROUNDED_ALL , use[ ORIGINAL_SHADE ] ,
opts . useHighlightForMenu ? itsHighlightCols : itsBackgroundCols ) ;
opts . useHighlightForMenu ? itsHighlightCols : itsBackgroundCols ) ;
if ( ! mi )
if ( ! mi )
@ -5224,14 +5268,17 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
if ( ! text . isNull ( ) )
if ( ! text . isNull ( ) )
{
{
int t ( text . find ( ' \t ' ) ) ;
int t ( text . find ( ' \t ' ) ) ,
textFlags = AlignVCenter | ShowPrefix | DontClip | SingleLine ;
if ( ! styleHint ( SH_UnderlineAccelerator , ceData , elementFlags , data , 0 , widget ) )
textFlags | = NoAccel ;
// draw accelerator/tab-text
// draw accelerator/tab-text
if ( t > = 0 )
if ( t > = 0 )
p - > drawText ( tr , AlignVCenter | ShowPrefix | DontClip | SingleLine | ( reverse ? AlignLeft : AlignRight ) ,
p - > drawText ( tr , textFlags | ( reverse ? AlignLeft : AlignRight ) , text . mid ( t + 1 ) ) ;
text . mid ( t + 1 ) ) ;
p - > drawText ( ir , AlignVCenter| ShowPrefix | DontClip | SingleLine | ( reverse ? AlignRight : AlignLeft ) , text , t ) ;
p - > drawText ( ir , textFlags | ( reverse ? AlignRight : AlignLeft ) , text , t ) ;
}
}
else if ( mi - > pixmap ( ) )
else if ( mi - > pixmap ( ) )
{
{
@ -5279,8 +5326,7 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
TQMenuItem * mi ( data . menuItem ( ) ) ;
TQMenuItem * mi ( data . menuItem ( ) ) ;
if ( mi - > text ( ) . isEmpty ( ) ) // Draw pixmap...
if ( mi - > text ( ) . isEmpty ( ) ) // Draw pixmap...
drawItem ( p , r , AlignCenter | ShowPrefix | DontClip | SingleLine , cg , flags & Style_Enabled ,
drawItem ( p , r , AlignCenter | ShowPrefix | DontClip | SingleLine , cg , flags & Style_Enabled , mi - > pixmap ( ) , TQString ( ) ) ;
mi - > pixmap ( ) , TQString ( ) ) ;
else
else
{
{
const TQColor * col = ( ( opts . colorMenubarMouseOver & & active ) | | ( ! opts . colorMenubarMouseOver & & down ) )
const TQColor * col = ( ( opts . colorMenubarMouseOver & & active ) | | ( ! opts . colorMenubarMouseOver & & down ) )
@ -5292,7 +5338,7 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
: & cg . foreground ( ) ;
: & cg . foreground ( ) ;
p - > setPen ( * col ) ;
p - > setPen ( * col ) ;
p - > drawText ( r , AlignCenter | ShowPrefix | DontClip | SingleLine , mi - > text ( ) ) ;
p - > drawText ( r , AlignCenter | ShowPrefix | DontClip | SingleLine | ( styleHint ( SH_UnderlineAccelerator , ceData , elementFlags , data , 0 , widget ) ? 0 : NoAccel ) , mi - > text ( ) ) ;
}
}
break ;
break ;
@ -5331,8 +5377,7 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
col = itsBackgroundCols [ 2 ] ;
col = itsBackgroundCols [ 2 ] ;
}
}
drawBevelGradient ( col , p , rx , true ,
drawBevelGradient ( col , cg . background ( ) , p , rx , true , false , opts . progressGrooveAppearance , WIDGET_PBAR_TROUGH ) ;
false , opts . progressGrooveAppearance , WIDGET_PBAR_TROUGH ) ;
const TQColor * use ( backgroundColors ( cg ) ) ;
const TQColor * use ( backgroundColors ( cg ) ) ;
@ -5531,13 +5576,13 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
r - = visualRect ( subRect ( SR_CheckBoxIndicator , ceData , elementFlags , widget ) , ceData , elementFlags ) ;
r - = visualRect ( subRect ( SR_CheckBoxIndicator , ceData , elementFlags , widget ) , ceData , elementFlags ) ;
p - > setClipRegion ( r ) ;
p - > setClipRegion ( r ) ;
drawBevelGradient ( shade ( cg . background ( ) , TO_FACTOR ( opts . crHighlight ) ) , p, checkbox - > rect ( ) , true ,
drawBevelGradient ( shade ( cg . background ( ) , TO_FACTOR ( opts . crHighlight ) ) , cg. background ( ) , p, checkbox - > rect ( ) , true ,
false , opts . selectionAppearance , WIDGET_SELECTION ) ;
false , opts . selectionAppearance , WIDGET_SELECTION ) ;
p - > setClipping ( false ) ;
p - > setClipping ( false ) ;
}
}
int alignment ( TQApplication : : reverseLayout ( ) ? AlignRight : AlignLeft ) ;
int alignment ( TQApplication : : reverseLayout ( ) ? AlignRight : AlignLeft ) ;
drawItem ( p , r , alignment | AlignVCenter | ShowPrefix , cg ,
drawItem ( p , r , alignment | AlignVCenter | ShowPrefix | ( styleHint ( SH_UnderlineAccelerator , ceData , elementFlags , data , 0 , widget ) ? 0 : NoAccel ) , cg ,
flags & Style_Enabled , checkbox - > pixmap ( ) , checkbox - > text ( ) ) ;
flags & Style_Enabled , checkbox - > pixmap ( ) , checkbox - > text ( ) ) ;
if ( checkbox - > hasFocus ( ) & & FOCUS_GLOW ! = opts . focus )
if ( checkbox - > hasFocus ( ) & & FOCUS_GLOW ! = opts . focus )
@ -5569,15 +5614,15 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
rb . height ( ) ) ) ;
rb . height ( ) ) ) ;
r - = visualRect ( subRect ( SR_RadioButtonIndicator , ceData , elementFlags , widget ) , ceData , elementFlags ) ;
r - = visualRect ( subRect ( SR_RadioButtonIndicator , ceData , elementFlags , widget ) , ceData , elementFlags ) ;
p - > setClipRegion ( r ) ;
p - > setClipRegion ( r ) ;
drawBevelGradient ( shade ( cg . background ( ) , TO_FACTOR ( opts . crHighlight ) ) , p, ceData . rect , true ,
drawBevelGradient ( shade ( cg . background ( ) , TO_FACTOR ( opts . crHighlight ) ) , cg. background ( ) , p, ceData . rect , true ,
false , opts . selectionAppearance , WIDGET_SELECTION ) ;
false , opts . selectionAppearance , WIDGET_SELECTION ) ;
p - > setClipping ( false ) ;
p - > setClipping ( false ) ;
}
}
int alignment ( TQApplication : : reverseLayout ( ) ? AlignRight : AlignLeft ) ;
int alignment ( TQApplication : : reverseLayout ( ) ? AlignRight : AlignLeft ) ;
drawItem ( p , r , alignment | AlignVCenter | ShowPrefix , cg , flags & Style_Enabled ,
drawItem ( p , r , alignment | AlignVCenter | ShowPrefix | ( styleHint ( SH_UnderlineAccelerator , ceData , elementFlags , data , 0 , widget ) ? 0 : NoAccel ) ,
radiobutton- > pixmap ( ) , radiobutton - > text ( ) ) ;
cg, flags & Style_Enabled , radiobutton- > pixmap ( ) , radiobutton - > text ( ) ) ;
if ( ( elementFlags & CEF_HasFocus ) & & FOCUS_GLOW ! = opts . focus )
if ( ( elementFlags & CEF_HasFocus ) & & FOCUS_GLOW ! = opts . focus )
drawPrimitive ( PE_FocusRect , p , ceData , elementFlags , visualRect ( subRect ( SR_RadioButtonFocusRect , ceData , elementFlags ,
drawPrimitive ( PE_FocusRect , p , ceData , elementFlags , visualRect ( subRect ( SR_RadioButtonFocusRect , ceData , elementFlags ,
@ -5947,7 +5992,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, cons
getFill ( fillFlags , cols , false , ( SHADE_DARKEN = = opts . comboBtn | |
getFill ( fillFlags , cols , false , ( SHADE_DARKEN = = opts . comboBtn | |
( SHADE_NONE ! = opts . comboBtn & & ! ( flags & Style_Enabled ) ) ) & &
( SHADE_NONE ! = opts . comboBtn & & ! ( flags & Style_Enabled ) ) ) & &
editable ) ,
editable ) ,
cols , true , true , editable ? WIDGET_COMBO_BUTTON : WIDGET_COMBO );
cols , true , true , editable ? WIDGET_COMBO_BUTTON : WIDGET_COMBO , widget );
}
}
}
}
@ -6046,7 +6091,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, cons
drawLightBevel ( p , btn , cg , btnFlags | Style_Horizontal , reverse ? ROUNDED_LEFT : ROUNDED_RIGHT ,
drawLightBevel ( p , btn , cg , btnFlags | Style_Horizontal , reverse ? ROUNDED_LEFT : ROUNDED_RIGHT ,
getFill ( btnFlags , cols , false , SHADE_DARKEN = = opts . comboBtn | |
getFill ( btnFlags , cols , false , SHADE_DARKEN = = opts . comboBtn | |
( SHADE_NONE ! = opts . comboBtn & & ! ( flags & Style_Enabled ) ) ) ,
( SHADE_NONE ! = opts . comboBtn & & ! ( flags & Style_Enabled ) ) ) ,
cols , true , true , WIDGET_COMBO );
cols , true , true , WIDGET_COMBO , widget );
p - > restore ( ) ;
p - > restore ( ) ;
}
}
@ -6136,14 +6181,14 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, cons
btnFlags | = Style_Horizontal ;
btnFlags | = Style_Horizontal ;
drawLightBevel ( p , btns , cg , btnFlags , reverse ? ROUNDED_LEFT : ROUNDED_RIGHT , getFill ( btnFlags , use ) ,
drawLightBevel ( p , btns , cg , btnFlags , reverse ? ROUNDED_LEFT : ROUNDED_RIGHT , getFill ( btnFlags , use ) ,
use , true , true , WIDGET_SPIN );
use , true , true , WIDGET_SPIN , widget );
if ( hw & & ( HOVER_SW_DOWN = = itsHover | | HOVER_SW_UP = = itsHover ) & & flags & Style_Enabled & & ! ( flags & Style_Sunken ) )
if ( hw & & ( HOVER_SW_DOWN = = itsHover | | HOVER_SW_UP = = itsHover ) & & flags & Style_Enabled & & ! ( flags & Style_Sunken ) )
{
{
btnFlags | = Style_MouseOver ;
btnFlags | = Style_MouseOver ;
p - > save ( ) ;
p - > save ( ) ;
p - > setClipRect ( HOVER_SW_UP = = itsHover ? up : down ) ;
p - > setClipRect ( HOVER_SW_UP = = itsHover ? up : down ) ;
drawLightBevel ( p , btns , cg , btnFlags , reverse ? ROUNDED_LEFT : ROUNDED_RIGHT , getFill ( btnFlags , use ) ,
drawLightBevel ( p , btns , cg , btnFlags , reverse ? ROUNDED_LEFT : ROUNDED_RIGHT , getFill ( btnFlags , use ) ,
use , true , true , WIDGET_SPIN );
use , true , true , WIDGET_SPIN , widget );
p - > restore ( ) ;
p - > restore ( ) ;
}
}
p - > setPen ( use [ BORDER_VAL ( style & Style_Enabled ) ] ) ;
p - > setPen ( use [ BORDER_VAL ( style & Style_Enabled ) ] ) ;
@ -6342,7 +6387,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, cons
if ( opts . thinSbarGroove ) {
if ( opts . thinSbarGroove ) {
if ( opts . flatSbarButtons & & SCROLLBAR_NONE ! = opts . scrollbarType & & ROUNDED ) {
if ( opts . flatSbarButtons & & SCROLLBAR_NONE ! = opts . scrollbarType & & ROUNDED ) {
drawBevelGradient ( itsBackgroundCols [ ORIGINAL_SHADE ] , p, slider , flags & Style_Horizontal , false ,
drawBevelGradient ( itsBackgroundCols [ ORIGINAL_SHADE ] , itsBackgroundCols[ ORIGINAL_SHADE ] , p, slider , flags & Style_Horizontal , false ,
opts . sbarBgndAppearance , WIDGET_SB_BGND ) ;
opts . sbarBgndAppearance , WIDGET_SB_BGND ) ;
}
}
else if ( opts . thinSbarGroove & & ( SCROLLBAR_NONE = = opts . scrollbarType | | opts . flatSbarButtons ) & &
else if ( opts . thinSbarGroove & & ( SCROLLBAR_NONE = = opts . scrollbarType | | opts . flatSbarButtons ) & &
@ -6496,7 +6541,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, cons
textRect ( full ? tb - > rect ( ) . x ( ) : ir . x ( ) , ir . y ( ) , full ? tb - > rect ( ) . width ( ) : ir . width ( ) , ir . height ( ) ) ;
textRect ( full ? tb - > rect ( ) . x ( ) : ir . x ( ) , ir . y ( ) , full ? tb - > rect ( ) . width ( ) : ir . width ( ) , ir . height ( ) ) ;
EAppearance app = isActive ? opts . titlebarAppearance : opts . inactiveTitlebarAppearance ;
EAppearance app = isActive ? opts . titlebarAppearance : opts . inactiveTitlebarAppearance ;
drawBevelGradient ( cols [ ORIGINAL_SHADE ] , p, r , true , false , app , WIDGET_MDI_WINDOW ) ;
drawBevelGradient ( cols [ ORIGINAL_SHADE ] , cg. background ( ) , p, r , true , false , app , WIDGET_MDI_WINDOW ) ;
ir . addCoords ( 2 , 0 , - 4 , 0 ) ;
ir . addCoords ( 2 , 0 , - 4 , 0 ) ;
TQFontMetrics fm ( TQFontMetrics ( ceData . font ) ) ;
TQFontMetrics fm ( TQFontMetrics ( ceData . font ) ) ;
@ -7103,6 +7148,8 @@ int QtCurveStyle::styleHint(StyleHint stylehint, const TQStyleControlElementData
{
{
switch ( stylehint )
switch ( stylehint )
{
{
case SH_UnderlineAccelerator :
return widget & & opts . hideShortcutUnderline ? itsShortcutHandler - > showShortcut ( widget ) : true ;
case SH_PopupMenu_SubMenuPopupDelay :
case SH_PopupMenu_SubMenuPopupDelay :
return opts . menuDelay ;
return opts . menuDelay ;
case SH_ScrollView_FrameOnlyAroundContents :
case SH_ScrollView_FrameOnlyAroundContents :
@ -7176,9 +7223,8 @@ void QtCurveStyle::drawItem(TQPainter *p, const TQRect &r, int flags, const TQCo
f . setBold ( true ) ;
f . setBold ( true ) ;
p - > setPen ( box - > colorGroup ( ) . foreground ( ) ) ;
p - > setPen ( box - > colorGroup ( ) . foreground ( ) ) ;
p - > setFont ( f ) ;
p - > setFont ( f ) ;
p - > drawText ( TQRect ( left , top , width , th ) , ( TQApplication : : reverseLayout ( )
p - > drawText ( TQRect ( left , top , width , th ) , ( TQApplication : : reverseLayout ( ) ? AlignRight : AlignLeft ) |
? AlignRight
AlignVCenter | ShowPrefix | SingleLine ,
: AlignLeft ) | AlignVCenter | ShowPrefix | SingleLine ,
text ) ;
text ) ;
return ;
return ;
}
}
@ -7265,8 +7311,7 @@ void QtCurveStyle::drawItem(TQPainter *p, const TQRect &r, int flags, const TQCo
}
}
}
}
void QtCurveStyle : : drawMenuItem ( TQPainter * p , const TQRect & r , int flags , const TQColorGroup & cg ,
void QtCurveStyle : : drawMenuItem ( TQPainter * p , const TQRect & r , int flags , const TQColorGroup & cg , bool mbi , int round , const TQColor & bgnd , const TQColor * cols ) const
bool mbi , int round , const TQColor & bgnd , const TQColor * cols ) const
{
{
int fill = opts . useHighlightForMenu & & ( ! mbi | | itsHighlightCols = = cols ) ? ORIGINAL_SHADE : 4 ,
int fill = opts . useHighlightForMenu & & ( ! mbi | | itsHighlightCols = = cols ) ? ORIGINAL_SHADE : 4 ,
border = opts . borderMenuitems ? 0 : fill ;
border = opts . borderMenuitems ? 0 : fill ;
@ -7277,22 +7322,22 @@ void QtCurveStyle::drawMenuItem(TQPainter *p, const TQRect &r, int flags, const
if ( ! mbi & & APPEARANCE_FADE = = opts . menuitemAppearance )
if ( ! mbi & & APPEARANCE_FADE = = opts . menuitemAppearance )
{
{
bool reverse = TQApplication : : reverseLayout ( ) ;
bool reverse = TQApplication : : reverseLayout ( ) ;
int roundOffet = ROUNDED ? 1 : 0 ;
int roundOffet = ROUNDED ? 1 : 0 ;
TQRect main ( r . x ( ) + ( reverse ? 1 + MENUITEM_FADE_SIZE : roundOffet + 1 ) , r . y ( ) + roundOffet + 1 ,
TQRect main ( r . x ( ) + ( reverse ? 1 + MENUITEM_FADE_SIZE : roundOffet + 1 ) , r . y ( ) + roundOffet + 1 ,
r . width ( ) - ( 1 + MENUITEM_FADE_SIZE ) , r . height ( ) - ( 2 + ( roundOffet * 2 ) ) ) ,
r . width ( ) - ( 1 + MENUITEM_FADE_SIZE ) , r . height ( ) - ( 2 + ( roundOffet * 2 ) ) ) ,
fade ( reverse ? r . x ( ) + 1 : r . width ( ) - MENUITEM_FADE_SIZE , r . y ( ) + 1 , MENUITEM_FADE_SIZE , r . height ( ) - 2 ) ;
fade ( reverse ? r . x ( ) + 1 : r . width ( ) - MENUITEM_FADE_SIZE , r . y ( ) + 1 , MENUITEM_FADE_SIZE , r . height ( ) - 2 ) ;
const TQColor * pc ( popupMenuCols ( cg ) ) ;
p - > fillRect ( main , cols [ fill ] ) ;
p - > fillRect ( main , cols [ fill ] ) ;
if ( ROUNDED )
if ( ROUNDED )
{
{
main . addCoords ( - 1 , - 1 , 1 , 1 ) ;
main . addCoords ( - 1 , - 1 , 1 , 1 ) ;
drawBorder ( p opupMenuCol( cg ) , p , main , cg , Style_Horizontal | Style_Raised , reverse ? ROUNDED_RIGHT : ROUNDED_LEFT ,
drawBorder ( p c[ ORIGINAL_SHADE ] , p , main , cg , Style_Horizontal | Style_Raised , reverse ? ROUNDED_RIGHT : ROUNDED_LEFT ,
cols , WIDGET_MENU_ITEM , false , BORDER_FLAT , false , fill ) ;
p c, WIDGET_MENU_ITEM , false , BORDER_FLAT , false , fill ) ;
}
}
TQColor bgnd ( popupMenuCol ( cg ) ) ;
drawGradient ( reverse ? pc [ ORIGINAL_SHADE ] : cols [ fill ] , reverse ? cols [ fill ] : pc [ ORIGINAL_SHADE ] , p , fade , false ) ;
drawGradient ( reverse ? bgnd : cols [ fill ] , reverse ? cols [ fill ] : bgnd , p , fade , false ) ;
}
}
else if ( mbi | | opts . borderMenuitems )
else if ( mbi | | opts . borderMenuitems )
{
{
@ -7312,13 +7357,13 @@ void QtCurveStyle::drawMenuItem(TQPainter *p, const TQRect &r, int flags, const
fr . addCoords ( 1 , 1 , - 1 , - 1 ) ;
fr . addCoords ( 1 , 1 , - 1 , - 1 ) ;
if ( fr . width ( ) > 0 & & fr . height ( ) > 0 )
if ( fr . width ( ) > 0 & & fr . height ( ) > 0 )
drawBevelGradient ( cols [ fill ] , p, fr , true , false , opts . menuitemAppearance , WIDGET_MENU_ITEM ) ;
drawBevelGradient ( cols [ fill ] , cg. background ( ) , p, fr , true , false , opts . menuitemAppearance , WIDGET_MENU_ITEM ) ;
drawBorder ( bgnd , p , r , cg , flags , round , cols , WIDGET_OTHER , false , BORDER_FLAT , false , border ) ;
drawBorder ( bgnd , p , r , cg , flags , round , cols , WIDGET_OTHER , false , BORDER_FLAT , false , border ) ;
}
}
itsFormMode = false ;
itsFormMode = false ;
}
}
else
else
drawBevelGradient ( cols [ fill ] , p, r , true , false , opts . menuitemAppearance , WIDGET_MENU_ITEM ) ;
drawBevelGradient ( cols [ fill ] , cg. background ( ) , p, r , true , false , opts . menuitemAppearance , WIDGET_MENU_ITEM ) ;
}
}
void QtCurveStyle : : drawProgress ( TQPainter * p , const TQRect & rx , const TQColorGroup & cg , SFlags flags ,
void QtCurveStyle : : drawProgress ( TQPainter * p , const TQRect & rx , const TQColorGroup & cg , SFlags flags ,
@ -7414,7 +7459,7 @@ void QtCurveStyle::drawProgress(TQPainter *p, const TQRect &rx, const TQColorGro
}
}
}
}
void QtCurveStyle : : drawBevelGradient ( const TQColor & base , TQPainter * p , const TQRect & origRect , bool horiz , bool sel , EAppearance bevApp , EWidget w ) const
void QtCurveStyle : : drawBevelGradient ( const TQColor & base , const TQColor & bgnd , TQPainter * p , const TQRect & origRect , bool horiz , bool sel , EAppearance bevApp , EWidget w ) const
{
{
if ( IS_FLAT ( bevApp ) & & opts . colorSelTab & & sel )
if ( IS_FLAT ( bevApp ) & & opts . colorSelTab & & sel )
bevApp = APPEARANCE_GRADIENT ;
bevApp = APPEARANCE_GRADIENT ;
@ -7435,7 +7480,7 @@ void QtCurveStyle::drawBevelGradient(const TQColor &base, TQPainter *p, const TQ
: APPEARANCE_GRADIENT ) ;
: APPEARANCE_GRADIENT ) ;
TQRect r ( 0 , 0 , horiz ? PIXMAP_DIMENSION : origRect . width ( ) ,
TQRect r ( 0 , 0 , horiz ? PIXMAP_DIMENSION : origRect . width ( ) ,
horiz ? origRect . height ( ) : PIXMAP_DIMENSION ) ;
horiz ? origRect . height ( ) : PIXMAP_DIMENSION ) ;
TQString key ( createKey ( horiz ? r . height ( ) : r . width ( ) , base . rgb ( ) , horiz, app ,
TQString key ( createKey ( horiz ? r . height ( ) : r . width ( ) , base . rgb ( ) , bgnd. rgb ( ) , horiz, app ,
tab & & sel & & opts . colorSelTab ? CACHE_COL_SEL_TAB : CACHE_STD ) ) ;
tab & & sel & & opts . colorSelTab ? CACHE_COL_SEL_TAB : CACHE_STD ) ) ;
TQPixmap * pix ( itsPixmapCache . find ( key ) ) ;
TQPixmap * pix ( itsPixmapCache . find ( key ) ) ;
bool inCache ( true ) ;
bool inCache ( true ) ;
@ -7444,9 +7489,9 @@ void QtCurveStyle::drawBevelGradient(const TQColor &base, TQPainter *p, const TQ
{
{
pix = new TQPixmap ( r . width ( ) , r . height ( ) ) ;
pix = new TQPixmap ( r . width ( ) , r . height ( ) ) ;
TQPainter pixPainter ( pix ) ;
TQPainter pixPainter ( pix ) ;
drawBevelGradientReal ( base , & pixPainter , r , horiz , sel , app , w ) ;
drawBevelGradientReal ( base , bgnd , & pixPainter , r , horiz , sel , app , w ) ;
pixPainter . end ( ) ;
pixPainter . end ( ) ;
int cost ( pix - > width ( ) * pix - > height ( ) * ( pix - > depth ( ) / 8 ) ) ;
int cost ( pix - > width ( ) * pix - > height ( ) * ( pix - > depth ( ) / 8 ) ) ;
@ -7462,7 +7507,7 @@ void QtCurveStyle::drawBevelGradient(const TQColor &base, TQPainter *p, const TQ
}
}
}
}
void QtCurveStyle : : drawBevelGradientReal ( const TQColor & base , TQPainter * p , const TQRect & r , bool horiz , bool sel , EAppearance app , EWidget w ) const
void QtCurveStyle : : drawBevelGradientReal ( const TQColor & base , const TQColor & bgnd , TQPainter * p , const TQRect & r , bool horiz , bool sel , EAppearance app , EWidget w ) const
{
{
const Gradient * grad = getGradient ( app , & opts ) ;
const Gradient * grad = getGradient ( app , & opts ) ;
@ -7490,7 +7535,8 @@ void QtCurveStyle::drawBevelGradientReal(const TQColor &base, TQPainter *p, cons
if ( /*sel && */ opts . colorSelTab & & i > 0 )
if ( /*sel && */ opts . colorSelTab & & i > 0 )
col = tint ( col , itsHighlightCols [ 0 ] , ( 1.0 - ( * it ) . pos ) * ( 0.2 + TO_ALPHA ( opts . colorSelTab ) ) ) ;
col = tint ( col , itsHighlightCols [ 0 ] , ( 1.0 - ( * it ) . pos ) * ( 0.2 + TO_ALPHA ( opts . colorSelTab ) ) ) ;
if ( ( * it ) . alpha < 0.9999 )
col = tint ( bgnd , col , ( * it ) . alpha ) ;
if ( i )
if ( i )
drawGradient ( prev , col , p ,
drawGradient ( prev , col , p ,
horiz
horiz
@ -7518,7 +7564,8 @@ void QtCurveStyle::drawBevelGradientReal(const TQColor &base, TQPainter *p, cons
if ( sel & & opts . colorSelTab & & topTab & & i < numStops - 1 )
if ( sel & & opts . colorSelTab & & topTab & & i < numStops - 1 )
col = tint ( col , itsHighlightCols [ 0 ] , ( 1.0 - ( * it ) . pos ) * ( 0.2 + TO_ALPHA ( opts . colorSelTab ) ) ) ;
col = tint ( col , itsHighlightCols [ 0 ] , ( 1.0 - ( * it ) . pos ) * ( 0.2 + TO_ALPHA ( opts . colorSelTab ) ) ) ;
if ( ( * it ) . alpha < 0.9999 )
col = tint ( bgnd , col , ( * it ) . alpha ) ;
if ( i )
if ( i )
drawGradient ( prev , col , p ,
drawGradient ( prev , col , p ,
horiz
horiz
@ -7531,8 +7578,7 @@ void QtCurveStyle::drawBevelGradientReal(const TQColor &base, TQPainter *p, cons
}
}
}
}
void QtCurveStyle : : drawGradient ( const TQColor & top , const TQColor & bot ,
void QtCurveStyle : : drawGradient ( const TQColor & top , const TQColor & bot , TQPainter * p , TQRect const & r , bool horiz ) const
TQPainter * p , TQRect const & r , bool horiz ) const
{
{
if ( r . width ( ) > 0 & & r . height ( ) > 0 )
if ( r . width ( ) > 0 & & r . height ( ) > 0 )
{
{
@ -7733,7 +7779,7 @@ void QtCurveStyle::drawSliderHandle(TQPainter *p, const TQRect &r, const TQColor
}
}
else
else
{
{
drawBevelGradient ( fill , p, TQRect ( x , y , horiz ? r . width ( ) - 1 : size , horiz ? size : r . height ( ) - 1 ) ,
drawBevelGradient ( fill , cg. background ( ) , p, TQRect ( x , y , horiz ? r . width ( ) - 1 : size , horiz ? size : r . height ( ) - 1 ) ,
horiz , false , opts . sliderAppearance ) ;
horiz , false , opts . sliderAppearance ) ;
if ( MO_PLASTIK = = opts . coloredMouseOver & & flags & Style_MouseOver & & ! opts . colorSliderMouseOver )
if ( MO_PLASTIK = = opts . coloredMouseOver & & flags & Style_MouseOver & & ! opts . colorSliderMouseOver )
@ -7743,18 +7789,18 @@ void QtCurveStyle::drawSliderHandle(TQPainter *p, const TQRect &r, const TQColor
if ( horiz )
if ( horiz )
{
{
drawBevelGradient ( itsMouseOverCols [ col ] , p, TQRect ( x + 1 , y + 1 , len , size - 2 ) ,
drawBevelGradient ( itsMouseOverCols [ col ] , cg. background ( ) , p, TQRect ( x + 1 , y + 1 , len , size - 2 ) ,
horiz , false , opts . sliderAppearance ) ;
horiz , false , opts . sliderAppearance ) ;
drawBevelGradient ( itsMouseOverCols [ col ] , p,
drawBevelGradient ( itsMouseOverCols [ col ] , cg. background ( ) , p,
TQRect ( x + r . width ( ) - ( ( SLIDER_ROUND_ROTATED = = opts . sliderStyle ? 3 : 1 ) + len ) ,
TQRect ( x + r . width ( ) - ( ( SLIDER_ROUND_ROTATED = = opts . sliderStyle ? 3 : 1 ) + len ) ,
y + 1 , len , size - 2 ) ,
y + 1 , len , size - 2 ) ,
horiz , false , opts . sliderAppearance ) ;
horiz , false , opts . sliderAppearance ) ;
}
}
else
else
{
{
drawBevelGradient ( itsMouseOverCols [ col ] , p, TQRect ( x + 1 , y + 1 , size - 2 , len ) ,
drawBevelGradient ( itsMouseOverCols [ col ] , cg. background ( ) , p, TQRect ( x + 1 , y + 1 , size - 2 , len ) ,
horiz , false , opts . sliderAppearance ) ;
horiz , false , opts . sliderAppearance ) ;
drawBevelGradient ( itsMouseOverCols [ col ] , p,
drawBevelGradient ( itsMouseOverCols [ col ] , cg. background ( ) , p,
TQRect ( x + 1 , y + r . height ( ) - ( ( SLIDER_ROUND_ROTATED = = opts . sliderStyle ? 3 : 1 ) + len ) ,
TQRect ( x + 1 , y + r . height ( ) - ( ( SLIDER_ROUND_ROTATED = = opts . sliderStyle ? 3 : 1 ) + len ) ,
size - 2 , len ) ,
size - 2 , len ) ,
horiz , false , opts . sliderAppearance ) ;
horiz , false , opts . sliderAppearance ) ;
@ -7901,7 +7947,7 @@ void QtCurveStyle::drawMenuOrToolBarBackground(TQPainter *p, const TQRect &r, co
if ( menu & & BLEND_TITLEBAR )
if ( menu & & BLEND_TITLEBAR )
rx . addCoords ( 0 , - qtcGetWindowBorderSize ( ) . titleHeight , 0 , 0 ) ;
rx . addCoords ( 0 , - qtcGetWindowBorderSize ( ) . titleHeight , 0 , 0 ) ;
drawBevelGradient ( color , p, rx , horiz , false , app ) ;
drawBevelGradient ( color , cg. background ( ) , p, rx , horiz , false , app ) ;
}
}
void QtCurveStyle : : drawHandleMarkers ( TQPainter * p , const TQRect & r , SFlags flags , bool tb ,
void QtCurveStyle : : drawHandleMarkers ( TQPainter * p , const TQRect & r , SFlags flags , bool tb ,
@ -8000,15 +8046,6 @@ const TQColor * QtCurveStyle::popupMenuCols(const TQColorGroup &cg) const
return opts . shadePopupMenu ? menuColors ( cg , true ) : backgroundColors ( cg ) ;
return opts . shadePopupMenu ? menuColors ( cg , true ) : backgroundColors ( cg ) ;
}
}
const TQColor & QtCurveStyle : : popupMenuCol ( const TQColorGroup & cg , int shade ) const
{
return opts . shadePopupMenu
? menuColors ( cg , true ) [ ORIGINAL_SHADE ]
: USE_LIGHTER_POPUP_MENU
? itsLighterPopupMenuBgndCol
: itsBackgroundCols [ shade ] ;
}
const TQColor * QtCurveStyle : : checkRadioColors ( const TQColorGroup & cg , SFlags flags ) const
const TQColor * QtCurveStyle : : checkRadioColors ( const TQColorGroup & cg , SFlags flags ) const
{
{
return opts . crColor & & flags & Style_Enabled & & ( flags & Style_On | | ! ( flags & Style_Off ) )
return opts . crColor & & flags & Style_Enabled & & ( flags & Style_On | | ! ( flags & Style_Off ) )
@ -8086,6 +8123,21 @@ void QtCurveStyle::setMenuColors(const TQColorGroup &cg)
case SHADE_WINDOW_BORDER :
case SHADE_WINDOW_BORDER :
break ;
break ;
}
}
TQColor * base = opts . shadePopupMenu
? SHADE_WINDOW_BORDER = = opts . shadeMenubars
? ( TQColor * ) getMdiColors ( cg , true )
: itsMenubarCols
: itsBackgroundCols ;
if ( USE_LIGHTER_POPUP_MENU )
{
if ( ! itsPopupMenuCols )
itsPopupMenuCols = new TQColor [ TOTAL_SHADES + 1 ] ;
shadeColors ( shade ( base [ ORIGINAL_SHADE ] , TO_FACTOR ( opts . lighterPopupMenuBgnd ) ) , itsPopupMenuCols ) ;
}
else
itsPopupMenuCols = base ;
}
}
void QtCurveStyle : : setMenuTextColors ( TQWidget * widget , bool isMenuBar ) const
void QtCurveStyle : : setMenuTextColors ( TQWidget * widget , bool isMenuBar ) const
@ -8106,7 +8158,8 @@ void QtCurveStyle::setMenuTextColors(TQWidget *widget, bool isMenuBar) const
}
}
else if ( opts . shadePopupMenu )
else if ( opts . shadePopupMenu )
{
{
pal . setBrush ( TQPalette : : Disabled , TQColorGroup : : Foreground , midColor ( itsActiveMdiTextColor , popupMenuCol ( pal . active ( ) ) ) ) ;
pal . setBrush ( TQPalette : : Disabled , TQColorGroup : : Foreground , midColor ( itsActiveMdiTextColor ,
popupMenuCols ( pal . active ( ) ) [ ORIGINAL_SHADE ] ) ) ;
pal . setBrush ( TQPalette : : Disabled , TQColorGroup : : Text , pal . brush ( TQPalette : : Disabled , TQColorGroup : : Foreground ) ) ;
pal . setBrush ( TQPalette : : Disabled , TQColorGroup : : Text , pal . brush ( TQPalette : : Disabled , TQColorGroup : : Foreground ) ) ;
}
}
@ -8132,8 +8185,9 @@ void QtCurveStyle::setMenuTextColors(TQWidget *widget, bool isMenuBar) const
}
}
else if ( ! isMenuBar & & opts . shadePopupMenu )
else if ( ! isMenuBar & & opts . shadePopupMenu )
{
{
const TQColor * pc ( popupMenuCols ( pal . active ( ) ) ) ;
pal . setBrush ( TQPalette : : Disabled , TQColorGroup : : Foreground ,
pal . setBrush ( TQPalette : : Disabled , TQColorGroup : : Foreground ,
midColor ( pal . brush ( TQPalette : : Active , TQColorGroup : : Foreground ) . color ( ) , p opupMenuCol( pal . active ( ) ) ) ) ;
midColor ( pal . brush ( TQPalette : : Active , TQColorGroup : : Foreground ) . color ( ) , p c[ ORIGINAL_SHADE ] ) ) ;
pal . setBrush ( TQPalette : : Disabled , TQColorGroup : : Text , pal . brush ( TQPalette : : Disabled , TQColorGroup : : Foreground ) ) ;
pal . setBrush ( TQPalette : : Disabled , TQColorGroup : : Text , pal . brush ( TQPalette : : Disabled , TQColorGroup : : Foreground ) ) ;
}
}
widget - > setPalette ( pal ) ;
widget - > setPalette ( pal ) ;
@ -8601,6 +8655,7 @@ const TQColor & QtCurveStyle::getTabFill(bool current, bool highlight, const TQC
const TQColor & QtCurveStyle : : menuStripeCol ( const TQColorGroup & cg ) const
const TQColor & QtCurveStyle : : menuStripeCol ( const TQColorGroup & cg ) const
{
{
const TQColor * pc ( popupMenuCols ( cg ) ) ;
switch ( opts . menuStripe )
switch ( opts . menuStripe )
{
{
default :
default :
@ -8611,12 +8666,12 @@ const TQColor & QtCurveStyle::menuStripeCol(const TQColorGroup &cg) const
case SHADE_BLEND_SELECTED :
case SHADE_BLEND_SELECTED :
// Hack! Use opts.customMenuStripeColor to store this setting!
// Hack! Use opts.customMenuStripeColor to store this setting!
if ( IS_BLACK ( opts . customMenuStripeColor ) )
if ( IS_BLACK ( opts . customMenuStripeColor ) )
opts . customMenuStripeColor = midColor ( itsHighlightCols [ ORIGINAL_SHADE ] , p opupMenuCol( cg ) ) ;
opts . customMenuStripeColor = midColor ( itsHighlightCols [ ORIGINAL_SHADE ] , p c[ ORIGINAL_SHADE ] ) ;
return opts . customMenuStripeColor ;
return opts . customMenuStripeColor ;
case SHADE_SELECTED :
case SHADE_SELECTED :
return itsHighlightCols [ MENU_STRIPE_SHADE ] ;
return itsHighlightCols [ MENU_STRIPE_SHADE ] ;
case SHADE_DARKEN :
case SHADE_DARKEN :
return popupMenuCol ( cg ) ;
return pc [ MENU_STRIPE_SHADE ] ;
}
}
}
}