4 #include "ProxyStyle.hpp"
5 #include "routines.hpp"
7 #include <QStyleOptionComplex>
11 namespace QtCollider
{
21 class StyleImpl
: public ProxyStyle
27 StyleImpl( QStyle
*s
= 0 ) : ProxyStyle( s
) {}
29 virtual void polish ( QPalette
& );
31 QColor
color( ColorRole role
) {
32 Q_ASSERT(role
< ColorRoleCount
);
37 QColor _colors
[ColorRoleCount
];
41 Client( QWidget
*w
) : _widget(w
) {}
43 QColor
focusColor() const { return color(Focus
); }
44 void setFocusColor( const QColor
& c
) { setColor(Focus
, c
); }
46 QColor
grooveColor() const { return color(Groove
); }
47 void setGrooveColor( const QColor
& c
) { setColor(Groove
, c
); }
49 QColor
color ( ColorRole role
) const {
50 Q_ASSERT(role
< ColorRoleCount
);
51 QColor
c( _colors
[role
] );
55 StyleImpl
*style
= qobject_cast
<StyleImpl
*>(_widget
->style());
56 return style
? style
->color(role
) : QColor();
60 void setColor( ColorRole role
, const QColor
& color
) {
61 Q_ASSERT( role
< ColorRoleCount
);
62 _colors
[role
] = color
;
67 QColor _colors
[ColorRoleCount
];
71 } // namespace QtCollider