Changeset View
Changeset View
Standalone View
Standalone View
kstyle/breezehelper.h
Show All 32 Lines | |||||
33 | #endif | 33 | #endif | ||
34 | 34 | | |||
35 | #include <QPainterPath> | 35 | #include <QPainterPath> | ||
36 | #include <QWidget> | 36 | #include <QWidget> | ||
37 | 37 | | |||
38 | #if BREEZE_HAVE_X11 | 38 | #if BREEZE_HAVE_X11 | ||
39 | #include <QX11Info> | 39 | #include <QX11Info> | ||
40 | #include <xcb/xcb.h> | 40 | #include <xcb/xcb.h> | ||
41 | #include <KColorUtils> | ||||
41 | #endif | 42 | #endif | ||
42 | 43 | | |||
43 | namespace Breeze | 44 | namespace Breeze | ||
44 | { | 45 | { | ||
45 | 46 | | |||
46 | //* breeze style helper class. | 47 | //* breeze style helper class. | ||
47 | /** contains utility functions used at multiple places in both breeze style and breeze window decoration */ | 48 | /** contains utility functions used at multiple places in both breeze style and breeze window decoration */ | ||
48 | class Helper | 49 | class Helper | ||
Show All 24 Lines | 50 | { | |||
73 | //* add alpha channel multiplier to color | 74 | //* add alpha channel multiplier to color | ||
74 | QColor alphaColor( QColor color, qreal alpha ) const; | 75 | QColor alphaColor( QColor color, qreal alpha ) const; | ||
75 | 76 | | |||
76 | //* mouse over color | 77 | //* mouse over color | ||
77 | QColor hoverColor( const QPalette& palette ) const | 78 | QColor hoverColor( const QPalette& palette ) const | ||
78 | { return _viewHoverBrush.brush( palette ).color(); } | 79 | { return _viewHoverBrush.brush( palette ).color(); } | ||
79 | 80 | | |||
80 | //* focus color | 81 | //* focus color | ||
81 | QColor focusColor( const QPalette& palette ) const | 82 | QColor focusColor( const QPalette& palette, const QColor base = "black", const qreal amount = 1.0 ) const | ||
82 | { return _viewFocusBrush.brush( palette ).color(); } | 83 | { return amount < 1 ? KColorUtils::tint(base, _viewFocusBrush.brush( palette ).color(), amount) : _viewFocusBrush.brush( palette ).color(); } | ||
83 | 84 | | |||
84 | //* negative text color (used for close button) | 85 | //* negative text color (used for close button) | ||
85 | QColor negativeText( const QPalette& palette ) const | 86 | QColor negativeText( const QPalette& palette ) const | ||
86 | { return _viewNegativeTextBrush.brush( palette ).color(); } | 87 | { return _viewNegativeTextBrush.brush( palette ).color(); } | ||
87 | 88 | | |||
88 | //* shadow | 89 | //* shadow | ||
89 | QColor shadowColor( const QPalette& palette ) const | 90 | QColor shadowColor( const QPalette& palette ) const | ||
90 | { return alphaColor( palette.color( QPalette::Shadow ), 0.15 ); } | 91 | { return alphaColor( palette.color( QPalette::Shadow ), 0.15 ); } | ||
Show All 37 Lines | |||||
128 | //* arrow outline color | 129 | //* arrow outline color | ||
129 | QColor arrowColor( const QPalette& palette, QPalette::ColorRole role ) const | 130 | QColor arrowColor( const QPalette& palette, QPalette::ColorRole role ) const | ||
130 | { return arrowColor( palette, palette.currentColorGroup(), role ); } | 131 | { return arrowColor( palette, palette.currentColorGroup(), role ); } | ||
131 | 132 | | |||
132 | //* arrow outline color, using animations | 133 | //* arrow outline color, using animations | ||
133 | QColor arrowColor( const QPalette&, bool mouseOver, bool hasFocus, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; | 134 | QColor arrowColor( const QPalette&, bool mouseOver, bool hasFocus, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; | ||
134 | 135 | | |||
135 | //* button outline color, using animations | 136 | //* button outline color, using animations | ||
136 | QColor buttonOutlineColor( const QPalette&, bool mouseOver, bool hasFocus, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; | 137 | QColor buttonOutlineColor( const QPalette&, bool mouseOver, bool hasFocus, bool sunken = false, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; | ||
137 | 138 | | |||
138 | //* button panel color, using animations | 139 | //* button panel color, using animations | ||
139 | QColor buttonBackgroundColor( const QPalette&, bool mouseOver, bool hasFocus, bool sunken, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; | 140 | QColor buttonBackgroundColor( const QPalette&, bool mouseOver, bool hasFocus, bool sunken, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; | ||
140 | 141 | | |||
141 | //* tool button color | 142 | //* tool button color | ||
142 | QColor toolButtonColor( const QPalette&, bool mouseOver, bool hasFocus, bool sunken, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; | 143 | QColor toolButtonColor( const QPalette&, bool mouseOver, bool hasFocus, bool sunken, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; | ||
143 | 144 | | |||
144 | //* slider outline color, using animations | 145 | //* slider outline color, using animations | ||
Show All 30 Lines | |||||
175 | 176 | | |||
176 | //* side panel frame | 177 | //* side panel frame | ||
177 | void renderSidePanelFrame( QPainter*, const QRect&, const QColor& outline, Side ) const; | 178 | void renderSidePanelFrame( QPainter*, const QRect&, const QColor& outline, Side ) const; | ||
178 | 179 | | |||
179 | //* menu frame | 180 | //* menu frame | ||
180 | void renderMenuFrame( QPainter*, const QRect&, const QColor& color, const QColor& outline, bool roundCorners = true ) const; | 181 | void renderMenuFrame( QPainter*, const QRect&, const QColor& color, const QColor& outline, bool roundCorners = true ) const; | ||
181 | 182 | | |||
182 | //* button frame | 183 | //* button frame | ||
183 | void renderButtonFrame( QPainter*, const QRect&, const QColor& color, const QColor& outline, const QColor& shadow, bool focus, bool sunken ) const; | 184 | void renderButton( QPainter*, const QRect&, const QColor& color, const QColor& outline, const QColor& shadow, bool focus, bool sunken ) const; | ||
184 | 185 | | |||
185 | //* toolbutton frame | 186 | //* toolbutton frame | ||
186 | void renderToolButtonFrame( QPainter*, const QRect&, const QColor& color, bool sunken ) const; | 187 | void renderToolButtonFrame( QPainter*, const QRect&, const QColor& color, bool sunken ) const; | ||
187 | 188 | | |||
188 | //* toolbutton frame | 189 | //* toolbutton frame | ||
189 | void renderToolBoxFrame( QPainter*, const QRect&, int tabWidth, const QColor& color ) const; | 190 | void renderToolBoxFrame( QPainter*, const QRect&, int tabWidth, const QColor& color ) const; | ||
190 | 191 | | |||
191 | //* tab widget frame | 192 | //* tab widget frame | ||
▲ Show 20 Lines • Show All 167 Lines • Show Last 20 Lines |