@ -184,7 +184,6 @@ TQStyle::ControlElementFlags getControlElementFlagsForObject(const TQObject* obj
if ( button ) {
if ( button - > isDown ( ) ) cef = cef | TQStyle : : CEF_IsDown ;
if ( button - > isOn ( ) ) cef = cef | TQStyle : : CEF_IsOn ;
if ( button - > isEnabled ( ) ) cef = cef | TQStyle : : CEF_IsEnabled ;
if ( button - > isToggleButton ( ) ) cef = cef | TQStyle : : CEF_BiState ;
}
}
@ -223,6 +222,7 @@ TQStyle::ControlElementFlags getControlElementFlagsForObject(const TQObject* obj
// Generic flags
const TQWidget * widget = dynamic_cast < const TQWidget * > ( object ) ;
if ( widget ) {
if ( widget - > isEnabled ( ) ) cef = cef | TQStyle : : CEF_IsEnabled ;
if ( widget - > parentWidget ( ) ) cef = cef | TQStyle : : CEF_HasParentWidget ;
if ( widget - > focusProxy ( ) ) cef = cef | TQStyle : : CEF_HasFocusProxy ;
if ( widget - > hasFocus ( ) ) cef = cef | TQStyle : : CEF_HasFocus ;
@ -254,6 +254,9 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
ceData . bgBrush = widget - > backgroundBrush ( ) ;
}
ceData . wflags = widget - > getWFlags ( ) ;
if ( populateReliantFields ) {
ceData . windowState = ( TQt : : WindowState ) ( widget - > windowState ( ) ) ;
}
ceData . bgColor = widget - > eraseColor ( ) ;
ceData . bgOffset = widget - > backgroundOffset ( ) ;
ceData . backgroundMode = widget - > backgroundMode ( ) ;
@ -419,10 +422,10 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
const TQTitleBar * tb = dynamic_cast < const TQTitleBar * > ( widget ) ;
if ( tb ) {
ceData . titleBarData . hasWindow = ! ! ( tb - > window ( ) ) ;
if ( populateReliantFields ) {
if ( ceData . titleBarData . hasWindow ) {
ceData . titleBarData . windowState = tb - > window ( ) - > windowState ( ) ;
ceData . titleBarData . windowState = ( TQt : : WindowState ) ( tb - > window ( ) - > windowState ( ) ) ;
}
if ( populateReliantFields ) {
ceData . titleBarData . usesActiveColor = tb - > usesActiveColor ( ) ;
}
ceData . titleBarData . visibleText = tb - > visibleText ( ) ;
@ -455,6 +458,9 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
ceData . viewportData . bgBrush = viewport - > backgroundBrush ( ) ;
}
ceData . viewportData . wflags = viewport - > getWFlags ( ) ;
if ( populateReliantFields ) {
ceData . viewportData . windowState = ( TQt : : WindowState ) ( widget - > windowState ( ) ) ;
}
ceData . viewportData . bgColor = viewport - > eraseColor ( ) ;
ceData . viewportData . bgOffset = viewport - > backgroundOffset ( ) ;
ceData . viewportData . backgroundMode = viewport - > backgroundMode ( ) ;
@ -502,6 +508,9 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
ceData . parentWidgetData . bgBrush = parentWidget - > backgroundBrush ( ) ;
}
ceData . parentWidgetData . wflags = parentWidget - > getWFlags ( ) ;
if ( populateReliantFields ) {
ceData . parentWidgetData . windowState = ( TQt : : WindowState ) ( widget - > windowState ( ) ) ;
}
ceData . parentWidgetData . bgColor = parentWidget - > eraseColor ( ) ;
ceData . parentWidgetData . bgOffset = parentWidget - > backgroundOffset ( ) ;
ceData . parentWidgetData . backgroundMode = parentWidget - > backgroundMode ( ) ;
@ -531,33 +540,20 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
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 ( ) ;
if ( item ) {
TQListView * lv = item - > listView ( ) ;
widget = dynamic_cast < TQWidget * > ( lv ) ;
ceData . checkListItemData . dataValid = true ;
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 ( ) ) ;
drawPrimitive ( pe , p , ceData , getControlElementFlagsForObject ( widget , ceData . widgetObjectTypes , TQStyleOption ( ) ) , r , cg , flags , opt ) ;
return ceData ;
}
/*! \reimp */
@ -578,8 +574,7 @@ void TQCommonStyle::drawPrimitive( PrimitiveElement pe,
p - > drawPixmap ( r , TQPixmap ( ( const char * * ) check_list_controller_xpm ) ) ;
break ; }
case PE_CheckListExclusiveIndicator : {
TQCheckListItem * item = opt . checkListItem ( ) ;
if ( ! item )
if ( ! ceData . checkListItemData . dataValid )
return ;
int x = r . x ( ) , y = r . y ( ) ;
# define TQCOORDARRLEN(x) sizeof(x) / (sizeof(TQCOORD)*2)
@ -630,8 +625,7 @@ void TQCommonStyle::drawPrimitive( PrimitiveElement pe,
}
break ; }
case PE_CheckListIndicator : {
TQCheckListItem * item = opt . checkListItem ( ) ;
if ( ! item )
if ( ! ceData . checkListItemData . dataValid )
return ;
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
p - > setPen ( TQPen ( ceData . palette . color ( TQPalette : : Disabled , TQColorGroup : : Text ) ,
2 ) ) ;
bool parentControl = FALSE ;
if ( item - > parent ( ) & & item - > parent ( ) - > rtti ( ) = = 1 & &
( ( 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 ( ) ,
if ( flags & Style_Selected & & ! ceData . listViewData . rootDecorated & & ! ceData . checkListItemData . hasParent ) {
p - > fillRect ( 0 , 0 , x + marg + w + 4 , ceData . checkListItemData . height ,
cg . brush ( TQColorGroup : : Highlight ) ) ;
if ( item- > isEnabled ( ) )
if ( ceData . checkListItemData . enabled )
p - > setPen ( TQPen ( cg . highlightedText ( ) , 2 ) ) ;
}
@ -1044,26 +1034,6 @@ void qt_style_erase_region(TQPainter* p, const TQRegion& region, TQStyleControlE
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 */
void TQCommonStyle : : drawControl ( ControlElement element ,
TQPainter * p ,
@ -1544,16 +1514,6 @@ void TQCommonStyle::drawControl( ControlElement element,
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 */
void TQCommonStyle : : drawControlMask ( ControlElement control ,
TQPainter * p ,
@ -1592,20 +1552,6 @@ void TQCommonStyle::drawControlMask( ControlElement control,
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 */
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
/*! \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 */
void TQCommonStyle : : drawComplexControl ( ComplexControl control ,
TQPainter * p ,
@ -2357,17 +2281,6 @@ void TQCommonStyle::drawComplexControl( ComplexControl control,
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 */
void TQCommonStyle : : drawComplexControlMask ( ComplexControl control ,
TQPainter * p ,
@ -2386,23 +2299,6 @@ void TQCommonStyle::drawComplexControlMask( ComplexControl control,
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 */
TQRect TQCommonStyle : : querySubControlMetrics ( ComplexControl control ,
TQStyleControlElementData ceData ,
@ -2637,17 +2533,6 @@ TQRect TQCommonStyle::querySubControlMetrics( ComplexControl control,
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 */
TQStyle : : SubControl TQCommonStyle : : querySubControl ( ComplexControl control ,
TQStyleControlElementData ceData ,
@ -2724,14 +2609,6 @@ TQStyle::SubControl TQCommonStyle::querySubControl(ComplexControl control,
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 */
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 ;
}
/*! \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 */
TQSize TQCommonStyle : : sizeFromContents ( ContentsType contents ,
TQStyleControlElementData ceData ,
@ -3142,13 +3000,6 @@ TQSize TQCommonStyle::sizeFromContents(ContentsType contents,
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 */
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 ;
}
/*! \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 */
TQPixmap TQCommonStyle : : stylePixmap ( StylePixmap , TQStyleControlElementData , ControlElementFlags , const TQStyleOption & , const TQWidget * ) const
{