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 31 Lines | 50 | { | |||
80 | //* focus color | 81 | //* focus color | ||
81 | QColor focusColor( const QPalette& palette ) const | 82 | QColor focusColor( const QPalette& palette ) const | ||
82 | { return _viewFocusBrush.brush( palette ).color(); } | 83 | { return _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 | | |||
89 | //* button alternate background color | ||||
90 | QColor buttonAltBackgroundColor( const QPalette& palette ) const | ||||
91 | { return _buttonAltBackgroundBrush.brush( palette ).color(); } | ||||
92 | | ||||
88 | //* shadow | 93 | //* shadow | ||
89 | QColor shadowColor( const QPalette& palette ) const | 94 | QColor shadowColor( const QPalette& palette ) const | ||
90 | { return alphaColor( palette.color( QPalette::Shadow ), 0.15 ); } | 95 | { return alphaColor( palette.color( QPalette::Shadow ), 0.15 ); } | ||
91 | 96 | | |||
92 | //* titlebar color | 97 | //* titlebar color | ||
93 | const QColor& titleBarColor( bool active ) const | 98 | const QColor& titleBarColor( bool active ) const | ||
94 | { return active ? _activeTitleBarColor:_inactiveTitleBarColor; } | 99 | { return active ? _activeTitleBarColor:_inactiveTitleBarColor; } | ||
95 | 100 | | |||
Show All 32 Lines | |||||
128 | //* arrow outline color | 133 | //* arrow outline color | ||
129 | QColor arrowColor( const QPalette& palette, QPalette::ColorRole role ) const | 134 | QColor arrowColor( const QPalette& palette, QPalette::ColorRole role ) const | ||
130 | { return arrowColor( palette, palette.currentColorGroup(), role ); } | 135 | { return arrowColor( palette, palette.currentColorGroup(), role ); } | ||
131 | 136 | | |||
132 | //* arrow outline color, using animations | 137 | //* arrow outline color, using animations | ||
133 | QColor arrowColor( const QPalette&, bool mouseOver, bool hasFocus, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; | 138 | QColor arrowColor( const QPalette&, bool mouseOver, bool hasFocus, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; | ||
134 | 139 | | |||
135 | //* button outline color, using animations | 140 | //* button outline color, using animations | ||
136 | QColor buttonOutlineColor( const QPalette&, bool mouseOver, bool hasFocus, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; | 141 | QColor buttonOutlineColor( const QPalette&, bool mouseOver, bool hasFocus, bool sunken, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; | ||
137 | 142 | | |||
138 | //* button panel color, using animations | 143 | //* button panel color, using animations | ||
139 | QColor buttonBackgroundColor( const QPalette&, bool mouseOver, bool hasFocus, bool sunken, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; | 144 | QColor buttonBackgroundColor( const QPalette&, bool mouseOver, bool hasFocus, bool sunken, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; | ||
140 | 145 | | |||
141 | //* tool button color | 146 | //* tool button color | ||
142 | QColor toolButtonColor( const QPalette&, bool mouseOver, bool hasFocus, bool sunken, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; | 147 | QColor toolButtonColor( const QPalette&, bool mouseOver, bool hasFocus, bool sunken, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; | ||
143 | 148 | | |||
144 | //* slider outline color, using animations | 149 | //* slider outline color, using animations | ||
Show All 30 Lines | |||||
175 | 180 | | |||
176 | //* side panel frame | 181 | //* side panel frame | ||
177 | void renderSidePanelFrame( QPainter*, const QRect&, const QColor& outline, Side ) const; | 182 | void renderSidePanelFrame( QPainter*, const QRect&, const QColor& outline, Side ) const; | ||
178 | 183 | | |||
179 | //* menu frame | 184 | //* menu frame | ||
180 | void renderMenuFrame( QPainter*, const QRect&, const QColor& color, const QColor& outline, bool roundCorners = true ) const; | 185 | void renderMenuFrame( QPainter*, const QRect&, const QColor& color, const QColor& outline, bool roundCorners = true ) const; | ||
181 | 186 | | |||
182 | //* button frame | 187 | //* button frame | ||
183 | void renderButtonFrame( QPainter*, const QRect&, const QColor& color, const QColor& outline, const QColor& shadow, bool focus, bool sunken ) const; | 188 | void renderButton( QPainter*, const QRect&, const QColor& color, const QColor& outline, const QColor& shadow, bool focus, bool sunken ) const; | ||
184 | 189 | | |||
185 | //* toolbutton frame | 190 | //* toolbutton frame | ||
186 | void renderToolButtonFrame( QPainter*, const QRect&, const QColor& color, bool sunken ) const; | 191 | void renderToolButtonFrame( QPainter*, const QRect&, const QColor& color, bool sunken ) const; | ||
187 | 192 | | |||
188 | //* toolbutton frame | 193 | //* toolbutton frame | ||
189 | void renderToolBoxFrame( QPainter*, const QRect&, int tabWidth, const QColor& color ) const; | 194 | void renderToolBoxFrame( QPainter*, const QRect&, int tabWidth, const QColor& color ) const; | ||
190 | 195 | | |||
191 | //* tab widget frame | 196 | //* tab widget frame | ||
▲ Show 20 Lines • Show All 153 Lines • ▼ Show 20 Line(s) | |||||
345 | //* configuration | 350 | //* configuration | ||
346 | KSharedConfig::Ptr _config; | 351 | KSharedConfig::Ptr _config; | ||
347 | 352 | | |||
348 | //*@name brushes | 353 | //*@name brushes | ||
349 | //@{ | 354 | //@{ | ||
350 | KStatefulBrush _viewFocusBrush; | 355 | KStatefulBrush _viewFocusBrush; | ||
351 | KStatefulBrush _viewHoverBrush; | 356 | KStatefulBrush _viewHoverBrush; | ||
352 | KStatefulBrush _viewNegativeTextBrush; | 357 | KStatefulBrush _viewNegativeTextBrush; | ||
358 | | ||||
359 | KStatefulBrush _buttonAltBackgroundBrush; | ||||
353 | //@} | 360 | //@} | ||
354 | 361 | | |||
355 | //*@name windeco colors | 362 | //*@name windeco colors | ||
356 | //@{ | 363 | //@{ | ||
357 | QColor _activeTitleBarColor; | 364 | QColor _activeTitleBarColor; | ||
358 | QColor _activeTitleBarTextColor; | 365 | QColor _activeTitleBarTextColor; | ||
359 | QColor _inactiveTitleBarColor; | 366 | QColor _inactiveTitleBarColor; | ||
360 | QColor _inactiveTitleBarTextColor; | 367 | QColor _inactiveTitleBarTextColor; | ||
Show All 14 Lines |