Index: mstyle/mstyle.h =================================================================== --- mstyle/mstyle.h (Revision 3813) +++ mstyle/mstyle.h (Arbeitskopie) @@ -21,6 +21,8 @@ #ifndef __MSTYLE_H__ #define __MSTYLE_H__ +#include + #include "tileset.h" #include "stylehelper.h" @@ -35,7 +37,7 @@ // MStyle //--------------------------------------------------------- -class MStyle : public QCommonStyle { +class MStyle : public QGtkStyle { Q_OBJECT //! arrow orientation @@ -587,7 +589,7 @@ // tabbar tab text QRect tabBarTabTextRect( const QStyleOption* option, const QWidget* widget ) const { - return QCommonStyle::subElementRect( SE_TabBarTabText, option, widget ).adjusted( 6, 0, -6, 0 ); + return QGtkStyle::subElementRect( SE_TabBarTabText, option, widget ).adjusted( 6, 0, -6, 0 ); } // tab widgets Index: mstyle/mstyle.cpp =================================================================== --- mstyle/mstyle.cpp (Revision 3813) +++ mstyle/mstyle.cpp (Arbeitskopie) @@ -44,7 +44,7 @@ //--------------------------------------------------------- MStyle::MStyle() - : QCommonStyle() + : QGtkStyle() { _addLineButtons = DoubleButton; _subLineButtons = SingleButton; @@ -143,7 +143,7 @@ int MStyle::pixelMetric(PixelMetric metric, const QStyleOption* option, const QWidget* widget ) const { switch (metric) { - // rely on QCommonStyle here + // rely on QGtkStyle here case PM_SmallIconSize: case PM_ButtonIconSize: return 16; @@ -297,7 +297,7 @@ default: break; } - return QCommonStyle::pixelMetric(metric, option, widget); + return QGtkStyle::pixelMetric(metric, option, widget); } //--------------------------------------------------------- @@ -331,7 +331,7 @@ case CT_TabWidget: return expandSize(size, TabWidget_ContentsMargin); case CT_ToolButton: return toolButtonSizeFromContents(option, size, widget); - default: return QCommonStyle::sizeFromContents(element, option, size, widget); + default: return QGtkStyle::sizeFromContents(element, option, size, widget); } } @@ -806,7 +806,7 @@ } // base class polishing - QCommonStyle::polish(widget); + QGtkStyle::polish(widget); } //--------------------------------------------------------- @@ -903,7 +903,7 @@ } else if( widget->inherits("QComboBoxPrivateContainer") ) widget->removeEventFilter(this); - QCommonStyle::unpolish(widget); + QGtkStyle::unpolish(widget); } //--------------------------------------------------------- @@ -985,7 +985,7 @@ // try find primitive in map, and run. // exit if result is true, otherwise fallback to generic case if (!(fcn && (this->*fcn)(option, painter, widget))) - QCommonStyle::drawPrimitive( element, option, painter, widget ); + QGtkStyle::drawPrimitive( element, option, painter, widget ); painter->restore(); } @@ -3550,7 +3550,7 @@ } } if (!(fcn && (this->*fcn)(option, painter, widget))) { - QCommonStyle::drawControl(element, option, painter, widget); + QGtkStyle::drawControl(element, option, painter, widget); } painter->restore(); } @@ -3576,7 +3576,7 @@ } if (!(fcn && (this->*fcn)(option, painter, widget))) - QCommonStyle::drawComplexControl( element, option, painter, widget); + QGtkStyle::drawComplexControl( element, option, painter, widget); painter->restore(); } @@ -3601,10 +3601,10 @@ const QWidget* widget( static_cast( painter->device() ) ); if (animations().widgetEnabilityEngine().isAnimated( widget, AnimationEnable)) { const QPalette pal = _helper.mergePalettes(palette, animations().widgetEnabilityEngine().opacity(widget, AnimationEnable)); - return QCommonStyle::drawItemText(painter, r, flags, pal, enabled, text, textRole); + return QGtkStyle::drawItemText(painter, r, flags, pal, enabled, text, textRole); } } - return QCommonStyle::drawItemText(painter, r, flags, palette, enabled, text, textRole); + return QGtkStyle::drawItemText(painter, r, flags, palette, enabled, text, textRole); } //--------------------------------------------------------- @@ -3630,7 +3630,7 @@ if (widget->inherits("QComboBoxPrivateContainer")) return eventFilterComboBoxContainer(widget, event); - return QCommonStyle::eventFilter(object, event); + return QGtkStyle::eventFilter(object, event); } bool MStyle::drawComboBoxComplexControl( const QStyleOptionComplex* option, QPainter* painter, const QWidget* widget ) const @@ -3892,7 +3892,7 @@ QFont font = oldFont; font.setBold(true); painter->setFont(font); - QCommonStyle::drawComplexControl(CC_GroupBox, option, painter, widget); + QGtkStyle::drawComplexControl(CC_GroupBox, option, painter, widget); painter->setFont(oldFont); return true; } @@ -4034,7 +4034,7 @@ { palette = _helper.mergePalettes( palette, animations().widgetEnabilityEngine().opacity( widget, AnimationEnable ) ); } palette.setCurrentColorGroup( active ? QPalette::Active: QPalette::Disabled ); - QCommonStyle::drawItemText( painter, textRect, Qt::AlignCenter, palette, active, tb->text, QPalette::WindowText); + QGtkStyle::drawItemText( painter, textRect, Qt::AlignCenter, palette, active, tb->text, QPalette::WindowText); } @@ -5003,7 +5003,7 @@ if( const QStyleOptionProgressBar *pb = qstyleoption_cast(option)) { - // same as QCommonStyle::drawControl, except that it handles animations + // same as QGtkStyle::drawControl, except that it handles animations QStyleOptionProgressBarV2 subopt = *pb; subopt.rect = subElementRect(SE_ProgressBarGroove, pb, widget); drawProgressBarGrooveControl(&subopt, painter, widget); @@ -5628,8 +5628,8 @@ } - // use QCommonStyle painting on tranlated rect - QCommonStyle::drawControl( CE_TabBarTabLabel, &tabOptV3, painter, widget ); + // use QGtkStyle painting on tranlated rect + QGtkStyle::drawControl( CE_TabBarTabLabel, &tabOptV3, painter, widget ); return true; } @@ -7132,7 +7132,7 @@ QStyleOptionToolButton localOption(*toolButtonOpt); localOption.palette.setColor(QPalette::ButtonText, option->palette.color(QPalette::WindowText)); - QCommonStyle::drawControl(CE_ToolButtonLabel, &localOption, painter, widget); + QGtkStyle::drawControl(CE_ToolButtonLabel, &localOption, painter, widget); return true; } @@ -7220,14 +7220,14 @@ } - return QCommonStyle::subControlRect( CC_GroupBox, option, subControl, widget ); + return QGtkStyle::subControlRect( CC_GroupBox, option, subControl, widget ); } QRect MStyle::comboBoxSubControlRect( const QStyleOptionComplex* option, SubControl subControl, const QWidget* widget ) const { const QRect& r( option->rect ); const QStyleOptionComboBox *cb = qstyleoption_cast(option); - if( !cb ) return QCommonStyle::subControlRect( CC_ComboBox, option, subControl, widget ); + if( !cb ) return QGtkStyle::subControlRect( CC_ComboBox, option, subControl, widget ); switch( subControl ) { @@ -7289,7 +7289,7 @@ } - return QCommonStyle::subControlRect( CC_ComboBox, option, subControl, widget ); + return QGtkStyle::subControlRect( CC_ComboBox, option, subControl, widget ); } @@ -7330,7 +7330,7 @@ case SC_SliderHandle: { - QRect handle( QCommonStyle::subControlRect( CC_Slider, option, subControl, widget ) ); + QRect handle( QGtkStyle::subControlRect( CC_Slider, option, subControl, widget ) ); if( const QStyleOptionSlider *slider = qstyleoption_cast( option ) ) { const bool horizontal( slider->orientation == Qt::Horizontal ); @@ -7343,7 +7343,7 @@ case SC_SliderGroove: { - QRect groove( QCommonStyle::subControlRect( CC_Slider, option, subControl, widget ) ); + QRect groove( QGtkStyle::subControlRect( CC_Slider, option, subControl, widget ) ); if( const QStyleOptionSlider *slider = qstyleoption_cast( option ) ) { const bool horizontal( slider->orientation == Qt::Horizontal ); @@ -7367,7 +7367,7 @@ } default: - return QCommonStyle::subControlRect( CC_Slider, option, subControl, widget ); + return QGtkStyle::subControlRect( CC_Slider, option, subControl, widget ); } @@ -7526,7 +7526,7 @@ } - return QCommonStyle::subControlRect( CC_SpinBox, option, subControl, widget); + return QGtkStyle::subControlRect( CC_SpinBox, option, subControl, widget); } @@ -7996,7 +7996,7 @@ case SH_MessageBox_TextInteractionFlags: return true; case SH_WindowFrame_Mask: return false; - default: return QCommonStyle::styleHint(hint, option, widget, returnData); + default: return QGtkStyle::styleHint(hint, option, widget, returnData); } } @@ -8037,7 +8037,7 @@ // toolboxes case SE_ToolBoxTabContents: return toolBoxTabContentsRect( option, widget ); - default: return QCommonStyle::subElementRect( element, option, widget ); + default: return QGtkStyle::subElementRect( element, option, widget ); } @@ -8055,7 +8055,7 @@ case CC_Slider: return sliderSubControlRect( option, subControl, widget ); case CC_ScrollBar: return scrollBarSubControlRect( option, subControl, widget ); case CC_SpinBox: return spinBoxSubControlRect( option, subControl, widget ); - default: return QCommonStyle::subControlRect( element, option, subControl, widget ); + default: return QGtkStyle::subControlRect( element, option, subControl, widget ); } } @@ -8287,7 +8287,7 @@ } else return SC_ScrollBarAddLine; } - default: return QCommonStyle::hitTestComplexControl( control, option, point, widget ); + default: return QGtkStyle::hitTestComplexControl( control, option, point, widget ); } } @@ -8298,7 +8298,7 @@ const QStyleOptionTab* tabOpt( qstyleoption_cast(option) ); if (!tabOpt) return QRect(); - QRect r( QCommonStyle::subElementRect( element, option, widget ) ); + QRect r( QGtkStyle::subElementRect( element, option, widget ) ); const bool selected( option->state&State_Selected ); switch( tabOpt->shape ) @@ -8701,7 +8701,7 @@ } default: - return QCommonStyle::standardIconImplementation( standardIcon, option, widget ); + return QGtkStyle::standardIconImplementation( standardIcon, option, widget ); } }