@ -184,7 +184,6 @@ TQStyle::ControlElementFlags getControlElementFlagsForObject(const TQObject* obj
if ( button ) {
if ( button ) {
if ( button - > isDown ( ) ) cef = cef | TQStyle : : CEF_IsDown ;
if ( button - > isDown ( ) ) cef = cef | TQStyle : : CEF_IsDown ;
if ( button - > isOn ( ) ) cef = cef | TQStyle : : CEF_IsOn ;
if ( button - > isOn ( ) ) cef = cef | TQStyle : : CEF_IsOn ;
if ( button - > isEnabled ( ) ) cef = cef | TQStyle : : CEF_IsEnabled ;
if ( button - > isToggleButton ( ) ) cef = cef | TQStyle : : CEF_BiState ;
if ( button - > isToggleButton ( ) ) cef = cef | TQStyle : : CEF_BiState ;
}
}
}
}
@ -223,6 +222,7 @@ TQStyle::ControlElementFlags getControlElementFlagsForObject(const TQObject* obj
// Generic flags
// Generic flags
const TQWidget * widget = dynamic_cast < const TQWidget * > ( object ) ;
const TQWidget * widget = dynamic_cast < const TQWidget * > ( object ) ;
if ( widget ) {
if ( widget ) {
if ( widget - > isEnabled ( ) ) cef = cef | TQStyle : : CEF_IsEnabled ;
if ( widget - > parentWidget ( ) ) cef = cef | TQStyle : : CEF_HasParentWidget ;
if ( widget - > parentWidget ( ) ) cef = cef | TQStyle : : CEF_HasParentWidget ;
if ( widget - > focusProxy ( ) ) cef = cef | TQStyle : : CEF_HasFocusProxy ;
if ( widget - > focusProxy ( ) ) cef = cef | TQStyle : : CEF_HasFocusProxy ;
if ( widget - > hasFocus ( ) ) cef = cef | TQStyle : : CEF_HasFocus ;
if ( widget - > hasFocus ( ) ) cef = cef | TQStyle : : CEF_HasFocus ;
@ -254,6 +254,9 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
ceData . bgBrush = widget - > backgroundBrush ( ) ;
ceData . bgBrush = widget - > backgroundBrush ( ) ;
}
}
ceData . wflags = widget - > getWFlags ( ) ;
ceData . wflags = widget - > getWFlags ( ) ;
if ( populateReliantFields ) {
ceData . windowState = ( TQt : : WindowState ) ( widget - > windowState ( ) ) ;
}
ceData . bgColor = widget - > eraseColor ( ) ;
ceData . bgColor = widget - > eraseColor ( ) ;
ceData . bgOffset = widget - > backgroundOffset ( ) ;
ceData . bgOffset = widget - > backgroundOffset ( ) ;
ceData . backgroundMode = widget - > backgroundMode ( ) ;
ceData . backgroundMode = widget - > backgroundMode ( ) ;
@ -419,10 +422,10 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
const TQTitleBar * tb = dynamic_cast < const TQTitleBar * > ( widget ) ;
const TQTitleBar * tb = dynamic_cast < const TQTitleBar * > ( widget ) ;
if ( tb ) {
if ( tb ) {
ceData . titleBarData . hasWindow = ! ! ( tb - > window ( ) ) ;
ceData . titleBarData . hasWindow = ! ! ( tb - > window ( ) ) ;
if ( ceData . titleBarData . hasWindow ) {
ceData . titleBarData . windowState = tb - > window ( ) - > windowState ( ) ;
}
if ( populateReliantFields ) {
if ( populateReliantFields ) {
if ( ceData . titleBarData . hasWindow ) {
ceData . titleBarData . windowState = ( TQt : : WindowState ) ( tb - > window ( ) - > windowState ( ) ) ;
}
ceData . titleBarData . usesActiveColor = tb - > usesActiveColor ( ) ;
ceData . titleBarData . usesActiveColor = tb - > usesActiveColor ( ) ;
}
}
ceData . titleBarData . visibleText = tb - > visibleText ( ) ;
ceData . titleBarData . visibleText = tb - > visibleText ( ) ;
@ -455,6 +458,9 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
ceData . viewportData . bgBrush = viewport - > backgroundBrush ( ) ;
ceData . viewportData . bgBrush = viewport - > backgroundBrush ( ) ;
}
}
ceData . viewportData . wflags = viewport - > getWFlags ( ) ;
ceData . viewportData . wflags = viewport - > getWFlags ( ) ;
if ( populateReliantFields ) {
ceData . viewportData . windowState = ( TQt : : WindowState ) ( widget - > windowState ( ) ) ;
}
ceData . viewportData . bgColor = viewport - > eraseColor ( ) ;
ceData . viewportData . bgColor = viewport - > eraseColor ( ) ;
ceData . viewportData . bgOffset = viewport - > backgroundOffset ( ) ;
ceData . viewportData . bgOffset = viewport - > backgroundOffset ( ) ;
ceData . viewportData . backgroundMode = viewport - > backgroundMode ( ) ;
ceData . viewportData . backgroundMode = viewport - > backgroundMode ( ) ;
@ -502,6 +508,9 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
ceData . parentWidgetData . bgBrush = parentWidget - > backgroundBrush ( ) ;
ceData . parentWidgetData . bgBrush = parentWidget - > backgroundBrush ( ) ;
}
}
ceData . parentWidgetData . wflags = parentWidget - > getWFlags ( ) ;
ceData . parentWidgetData . wflags = parentWidget - > getWFlags ( ) ;
if ( populateReliantFields ) {
ceData . parentWidgetData . windowState = ( TQt : : WindowState ) ( widget - > windowState ( ) ) ;
}
ceData . parentWidgetData . bgColor = parentWidget - > eraseColor ( ) ;
ceData . parentWidgetData . bgColor = parentWidget - > eraseColor ( ) ;
ceData . parentWidgetData . bgOffset = parentWidget - > backgroundOffset ( ) ;
ceData . parentWidgetData . bgOffset = parentWidget - > backgroundOffset ( ) ;
ceData . parentWidgetData . backgroundMode = parentWidget - > backgroundMode ( ) ;
ceData . parentWidgetData . backgroundMode = parentWidget - > backgroundMode ( ) ;
@ -531,33 +540,20 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
ceData . dwData . closeEnabled = dw - > isCloseEnabled ( ) ;
ceData . dwData . closeEnabled = dw - > isCloseEnabled ( ) ;
}
}
}
}
}
return ceData ;
}
/*! \reimp */
void TQCommonStyle : : drawPrimitive ( PrimitiveElement pe ,
TQPainter * p ,
const TQRect & r ,
const TQColorGroup & cg ,
SFlags flags ,
const TQStyleOption & opt ) const
{
const TQWidget * widget = 0 ;
// Determine if the request needs widget information and set widget appropriately
// FIXME
if ( ( pe = = PE_CheckListController ) | | ( pe = = PE_CheckListExclusiveIndicator ) | | ( pe = = PE_CheckListIndicator ) ) {
TQCheckListItem * item = opt . checkListItem ( ) ;
TQCheckListItem * item = opt . checkListItem ( ) ;
if ( item ) {
if ( item ) {
TQListView * lv = item - > listView ( ) ;
ceData . checkListItemData . dataValid = true ;
widget = dynamic_cast < TQWidget * > ( lv ) ;
ceData . checkListItemData . enabled = item - > isEnabled ( ) ;
ceData . checkListItemData . hasParent = ( item - > parent ( ) & & ( item - > parent ( ) - > rtti ( ) = = 1 ) & & ( ( ( TQCheckListItem * ) item - > parent ( ) ) - > type ( ) = = TQCheckListItem : : Controller ) ) ;
ceData . checkListItemData . height = item - > height ( ) ;
}
else {
ceData . checkListItemData . dataValid = false ;
}
}
}
}
TQStyleControlElementData ceData = populateControlElementDataFromWidget ( widget , TQStyleOption ( ) ) ;
return ceData ;
drawPrimitive ( pe , p , ceData , getControlElementFlagsForObject ( widget , ceData . widgetObjectTypes , TQStyleOption ( ) ) , r , cg , flags , opt ) ;
}
}
/*! \reimp */
/*! \reimp */
@ -578,8 +574,7 @@ void TQCommonStyle::drawPrimitive( PrimitiveElement pe,
p - > drawPixmap ( r , TQPixmap ( ( const char * * ) check_list_controller_xpm ) ) ;
p - > drawPixmap ( r , TQPixmap ( ( const char * * ) check_list_controller_xpm ) ) ;
break ; }
break ; }
case PE_CheckListExclusiveIndicator : {
case PE_CheckListExclusiveIndicator : {
TQCheckListItem * item = opt . checkListItem ( ) ;
if ( ! ceData . checkListItemData . dataValid )
if ( ! item )
return ;
return ;
int x = r . x ( ) , y = r . y ( ) ;
int x = r . x ( ) , y = r . y ( ) ;
# define TQCOORDARRLEN(x) sizeof(x) / (sizeof(TQCOORD)*2)
# define TQCOORDARRLEN(x) sizeof(x) / (sizeof(TQCOORD)*2)
@ -630,8 +625,7 @@ void TQCommonStyle::drawPrimitive( PrimitiveElement pe,
}
}
break ; }
break ; }
case PE_CheckListIndicator : {
case PE_CheckListIndicator : {
TQCheckListItem * item = opt . checkListItem ( ) ;
if ( ! ceData . checkListItemData . dataValid )
if ( ! item )
return ;
return ;
int x = r . x ( ) , y = r . y ( ) , w = r . width ( ) , h = r . width ( ) , marg = ceData . listViewData . itemMargin ;
int x = r . x ( ) , y = r . y ( ) , w = r . width ( ) , h = r . width ( ) , marg = ceData . listViewData . itemMargin ;
@ -640,14 +634,10 @@ void TQCommonStyle::drawPrimitive( PrimitiveElement pe,
else
else
p - > setPen ( TQPen ( ceData . palette . color ( TQPalette : : Disabled , TQColorGroup : : Text ) ,
p - > setPen ( TQPen ( ceData . palette . color ( TQPalette : : Disabled , TQColorGroup : : Text ) ,
2 ) ) ;
2 ) ) ;
bool parentControl = FALSE ;
if ( flags & Style_Selected & & ! ceData . listViewData . rootDecorated & & ! ceData . checkListItemData . hasParent ) {
if ( item - > parent ( ) & & item - > parent ( ) - > rtti ( ) = = 1 & &
p - > fillRect ( 0 , 0 , x + marg + w + 4 , ceData . checkListItemData . height ,
( ( TQCheckListItem * ) item - > parent ( ) ) - > type ( ) = = TQCheckListItem : : Controller )
parentControl = TRUE ;
if ( flags & Style_Selected & & ! ceData . listViewData . rootDecorated & & ! parentControl ) {
p - > fillRect ( 0 , 0 , x + marg + w + 4 , item - > height ( ) ,
cg . brush ( TQColorGroup : : Highlight ) ) ;
cg . brush ( TQColorGroup : : Highlight ) ) ;
if ( item- > isEnabled ( ) )
if ( ceData . checkListItemData . enabled )
p - > setPen ( TQPen ( cg . highlightedText ( ) , 2 ) ) ;
p - > setPen ( TQPen ( cg . highlightedText ( ) , 2 ) ) ;
}
}
@ -1044,26 +1034,6 @@ void qt_style_erase_region(TQPainter* p, const TQRegion& region, TQStyleControlE
return ;
return ;
}
}
/*! \reimp */
void TQCommonStyle : : drawControl ( ControlElement element ,
TQPainter * p ,
const TQWidget * widget ,
const TQRect & r ,
const TQColorGroup & cg ,
SFlags flags ,
const TQStyleOption & opt ) const
{
# if defined(QT_CHECK_STATE)
if ( ! widget ) {
tqWarning ( " TQCommonStyle::drawControl: widget parameter cannot be zero! " ) ;
return ;
}
# endif
TQStyleControlElementData ceData = populateControlElementDataFromWidget ( widget , opt ) ;
drawControl ( element , p , ceData , getControlElementFlagsForObject ( widget , ceData . widgetObjectTypes , opt ) , r , cg , flags , opt , widget ) ;
}
/*! \reimp */
/*! \reimp */
void TQCommonStyle : : drawControl ( ControlElement element ,
void TQCommonStyle : : drawControl ( ControlElement element ,
TQPainter * p ,
TQPainter * p ,
@ -1544,16 +1514,6 @@ void TQCommonStyle::drawControl( ControlElement element,
activePainter = 0 ;
activePainter = 0 ;
}
}
void TQCommonStyle : : drawControlMask ( ControlElement control ,
TQPainter * p ,
const TQWidget * widget ,
const TQRect & r ,
const TQStyleOption & opt ) const
{
TQStyleControlElementData ceData = populateControlElementDataFromWidget ( widget , opt ) ;
drawControlMask ( control , p , ceData , getControlElementFlagsForObject ( widget , ceData . widgetObjectTypes , opt ) , r , opt , widget ) ;
}
/*! \reimp */
/*! \reimp */
void TQCommonStyle : : drawControlMask ( ControlElement control ,
void TQCommonStyle : : drawControlMask ( ControlElement control ,
TQPainter * p ,
TQPainter * p ,
@ -1592,20 +1552,6 @@ void TQCommonStyle::drawControlMask( ControlElement control,
activePainter = 0 ;
activePainter = 0 ;
}
}
/*! \reimp */
TQRect TQCommonStyle : : subRect ( SubRect r , const TQWidget * widget ) const
{
# if defined(QT_CHECK_STATE)
if ( ! widget ) {
tqWarning ( " TQCommonStyle::subRect: widget parameter cannot be zero! " ) ;
return TQRect ( ) ;
}
# endif
TQStyleControlElementData ceData = populateControlElementDataFromWidget ( widget , TQStyleOption ( ) ) ;
return subRect ( r , ceData , getControlElementFlagsForObject ( widget , ceData . widgetObjectTypes , TQStyleOption ( ) ) , widget ) ;
}
/*! \reimp */
/*! \reimp */
TQRect TQCommonStyle : : subRect ( SubRect r , const TQStyleControlElementData ceData , const ControlElementFlags elementFlags , const TQWidget * widget ) const
TQRect TQCommonStyle : : subRect ( SubRect r , const TQStyleControlElementData ceData , const ControlElementFlags elementFlags , const TQWidget * widget ) const
{
{
@ -1933,28 +1879,6 @@ static int qPositionFromValue( TQStyleControlElementData ceData, int logical_val
}
}
# endif // QT_NO_RANGECONTROL
# endif // QT_NO_RANGECONTROL
/*! \reimp */
void TQCommonStyle : : drawComplexControl ( ComplexControl control ,
TQPainter * p ,
const TQWidget * widget ,
const TQRect & r ,
const TQColorGroup & cg ,
SFlags flags ,
SCFlags controls ,
SCFlags active ,
const TQStyleOption & opt ) const
{
# if defined(QT_CHECK_STATE)
if ( ! widget ) {
tqWarning ( " TQCommonStyle::drawComplexControl: widget parameter cannot be zero! " ) ;
return ;
}
# endif
TQStyleControlElementData ceData = populateControlElementDataFromWidget ( widget , TQStyleOption ( ) ) ;
drawComplexControl ( control , p , ceData , getControlElementFlagsForObject ( widget , ceData . widgetObjectTypes , TQStyleOption ( ) ) , r , cg , flags , controls , active , opt , widget ) ;
}
/*! \reimp */
/*! \reimp */
void TQCommonStyle : : drawComplexControl ( ComplexControl control ,
void TQCommonStyle : : drawComplexControl ( ComplexControl control ,
TQPainter * p ,
TQPainter * p ,
@ -2357,17 +2281,6 @@ void TQCommonStyle::drawComplexControl( ComplexControl control,
activePainter = 0 ;
activePainter = 0 ;
}
}
/*! \reimp */
void TQCommonStyle : : drawComplexControlMask ( ComplexControl control ,
TQPainter * p ,
const TQWidget * widget ,
const TQRect & r ,
const TQStyleOption & opt ) const
{
TQStyleControlElementData ceData = populateControlElementDataFromWidget ( widget , TQStyleOption ( ) ) ;
drawComplexControlMask ( control , p , ceData , getControlElementFlagsForObject ( widget , ceData . widgetObjectTypes , TQStyleOption ( ) ) , r , opt , widget ) ;
}
/*! \reimp */
/*! \reimp */
void TQCommonStyle : : drawComplexControlMask ( ComplexControl control ,
void TQCommonStyle : : drawComplexControlMask ( ComplexControl control ,
TQPainter * p ,
TQPainter * p ,
@ -2386,23 +2299,6 @@ void TQCommonStyle::drawComplexControlMask( ComplexControl control,
p - > fillRect ( r , color1 ) ;
p - > fillRect ( r , color1 ) ;
}
}
/*! \reimp */
TQRect TQCommonStyle : : querySubControlMetrics ( ComplexControl control ,
const TQWidget * widget ,
SubControl sc ,
const TQStyleOption & opt ) const
{
# if defined(QT_CHECK_STATE)
if ( ! widget ) {
tqWarning ( " TQCommonStyle::querySubControlMetrics: widget parameter cannot be zero! " ) ;
return TQRect ( ) ;
}
# endif
TQStyleControlElementData ceData = populateControlElementDataFromWidget ( widget , TQStyleOption ( ) , false ) ;
return querySubControlMetrics ( control , ceData , getControlElementFlagsForObject ( widget , ceData . widgetObjectTypes , TQStyleOption ( ) ) , sc , opt , widget ) ;
}
/*! \reimp */
/*! \reimp */
TQRect TQCommonStyle : : querySubControlMetrics ( ComplexControl control ,
TQRect TQCommonStyle : : querySubControlMetrics ( ComplexControl control ,
TQStyleControlElementData ceData ,
TQStyleControlElementData ceData ,
@ -2637,17 +2533,6 @@ TQRect TQCommonStyle::querySubControlMetrics( ComplexControl control,
return TQRect ( ) ;
return TQRect ( ) ;
}
}
/*! \reimp */
TQStyle : : SubControl TQCommonStyle : : querySubControl ( ComplexControl control ,
const TQWidget * widget ,
const TQPoint & pos ,
const TQStyleOption & opt ) const
{
TQStyleControlElementData ceData = populateControlElementDataFromWidget ( widget , opt ) ;
return querySubControl ( control , ceData , getControlElementFlagsForObject ( widget , ceData . widgetObjectTypes , opt ) , pos , opt , widget ) ;
}
/*! \reimp */
/*! \reimp */
TQStyle : : SubControl TQCommonStyle : : querySubControl ( ComplexControl control ,
TQStyle : : SubControl TQCommonStyle : : querySubControl ( ComplexControl control ,
TQStyleControlElementData ceData ,
TQStyleControlElementData ceData ,
@ -2724,14 +2609,6 @@ TQStyle::SubControl TQCommonStyle::querySubControl(ComplexControl control,
return ret ;
return ret ;
}
}
/*! \reimp */
int TQCommonStyle : : pixelMetric ( PixelMetric m , const TQWidget * widget ) const
{
TQStyleControlElementData ceData = populateControlElementDataFromWidget ( widget , TQStyleOption ( ) ) ;
return pixelMetric ( m , ceData , getControlElementFlagsForObject ( widget , ceData . widgetObjectTypes , TQStyleOption ( ) ) , widget ) ;
}
/*! \reimp */
/*! \reimp */
int TQCommonStyle : : pixelMetric ( PixelMetric m , TQStyleControlElementData ceData , ControlElementFlags elementFlags , const TQWidget * widget ) const
int TQCommonStyle : : pixelMetric ( PixelMetric m , TQStyleControlElementData ceData , ControlElementFlags elementFlags , const TQWidget * widget ) const
{
{
@ -2952,25 +2829,6 @@ int TQCommonStyle::pixelMetric(PixelMetric m, TQStyleControlElementData ceData,
return ret ;
return ret ;
}
}
/*! \reimp */
TQSize TQCommonStyle : : sizeFromContents ( ContentsType contents ,
const TQWidget * widget ,
const TQSize & contentsSize ,
const TQStyleOption & opt ) const
{
TQSize sz ( contentsSize ) ;
# if defined(QT_CHECK_STATE)
if ( ! widget ) {
tqWarning ( " TQCommonStyle::sizeFromContents: widget parameter cannot be zero! " ) ;
return sz ;
}
# endif
TQStyleControlElementData ceData = populateControlElementDataFromWidget ( widget , TQStyleOption ( ) ) ;
return sizeFromContents ( contents , ceData , getControlElementFlagsForObject ( widget , ceData . widgetObjectTypes , TQStyleOption ( ) ) , contentsSize , opt , widget ) ;
}
/*! \reimp */
/*! \reimp */
TQSize TQCommonStyle : : sizeFromContents ( ContentsType contents ,
TQSize TQCommonStyle : : sizeFromContents ( ContentsType contents ,
TQStyleControlElementData ceData ,
TQStyleControlElementData ceData ,
@ -3142,13 +3000,6 @@ TQSize TQCommonStyle::sizeFromContents(ContentsType contents,
return sz ;
return sz ;
}
}
/*! \reimp */
int TQCommonStyle : : styleHint ( StyleHint sh , const TQWidget * w , const TQStyleOption & so , TQStyleHintReturn * shr ) const
{
TQStyleControlElementData ceData = populateControlElementDataFromWidget ( w , TQStyleOption ( ) , false ) ;
return styleHint ( sh , ceData , getControlElementFlagsForObject ( w , ceData . widgetObjectTypes , TQStyleOption ( ) , false ) , so , shr , w ) ;
}
/*! \reimp */
/*! \reimp */
int TQCommonStyle : : styleHint ( StyleHint sh , TQStyleControlElementData ceData , ControlElementFlags elementFlags , const TQStyleOption & , TQStyleHintReturn * , const TQWidget * w ) const
int TQCommonStyle : : styleHint ( StyleHint sh , TQStyleControlElementData ceData , ControlElementFlags elementFlags , const TQStyleOption & , TQStyleHintReturn * , const TQWidget * w ) const
{
{
@ -3232,13 +3083,6 @@ int TQCommonStyle::styleHint(StyleHint sh, TQStyleControlElementData ceData, Con
return ret ;
return ret ;
}
}
/*! \reimp */
TQPixmap TQCommonStyle : : stylePixmap ( StylePixmap sp , const TQWidget * w , const TQStyleOption & so ) const
{
TQStyleControlElementData ceData = populateControlElementDataFromWidget ( w , TQStyleOption ( ) ) ;
return stylePixmap ( sp , ceData , getControlElementFlagsForObject ( w , ceData . widgetObjectTypes , TQStyleOption ( ) ) , so , w ) ;
}
/*! \reimp */
/*! \reimp */
TQPixmap TQCommonStyle : : stylePixmap ( StylePixmap , TQStyleControlElementData , ControlElementFlags , const TQStyleOption & , const TQWidget * ) const
TQPixmap TQCommonStyle : : stylePixmap ( StylePixmap , TQStyleControlElementData , ControlElementFlags , const TQStyleOption & , const TQWidget * ) const
{
{