Changeset View
Changeset View
Standalone View
Standalone View
kstyle/breezehelper.h
Show All 17 Lines | |||||
18 | * along with this program; if not, write to the * | 18 | * along with this program; if not, write to the * | ||
19 | * Free Software Foundation, Inc., * | 19 | * Free Software Foundation, Inc., * | ||
20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * | 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * | ||
21 | *************************************************************************/ | 21 | *************************************************************************/ | ||
22 | 22 | | |||
23 | 23 | | |||
24 | #include "breeze.h" | 24 | #include "breeze.h" | ||
25 | #include "breezeanimationdata.h" | 25 | #include "breezeanimationdata.h" | ||
26 | #include "breezesettings.h" | ||||
26 | #include "config-breeze.h" | 27 | #include "config-breeze.h" | ||
27 | 28 | | |||
28 | #include <KColorScheme> | 29 | #include <KColorScheme> | ||
29 | #include <KSharedConfig> | 30 | #include <KSharedConfig> | ||
30 | 31 | | |||
32 | #include <QToolBar> | ||||
hpereiradacosta: Not needed as far as I can tell (none of your changes in this file require QToolbar) | |||||
cblack: This is necessary to compile. | |||||
31 | #include <QPainterPath> | 33 | #include <QPainterPath> | ||
32 | #include <QWidget> | 34 | #include <QWidget> | ||
33 | 35 | | |||
34 | namespace Breeze | 36 | namespace Breeze | ||
35 | { | 37 | { | ||
36 | 38 | | |||
37 | //* breeze style helper class. | 39 | //* breeze style helper class. | ||
38 | /** contains utility functions used at multiple places in both breeze style and breeze window decoration */ | 40 | /** contains utility functions used at multiple places in both breeze style and breeze window decoration */ | ||
Show All 9 Lines | 42 | { | |||
48 | {} | 50 | {} | ||
49 | 51 | | |||
50 | //* load configuration | 52 | //* load configuration | ||
51 | virtual void loadConfig(); | 53 | virtual void loadConfig(); | ||
52 | 54 | | |||
53 | //* pointer to shared config | 55 | //* pointer to shared config | ||
54 | KSharedConfig::Ptr config() const; | 56 | KSharedConfig::Ptr config() const; | ||
55 | 57 | | |||
58 | //* pointer to kdecoration config | ||||
59 | QSharedPointer<InternalSettings> decorationConfig() const; | ||||
60 | | ||||
56 | //*@name color utilities | 61 | //*@name color utilities | ||
57 | //@{ | 62 | //@{ | ||
58 | 63 | | |||
59 | //* add alpha channel multiplier to color | 64 | //* add alpha channel multiplier to color | ||
60 | QColor alphaColor( QColor color, qreal alpha ) const; | 65 | QColor alphaColor( QColor color, qreal alpha ) const; | ||
61 | 66 | | |||
62 | //* mouse over color | 67 | //* mouse over color | ||
63 | QColor hoverColor( const QPalette& palette ) const | 68 | QColor hoverColor( const QPalette& palette ) const | ||
▲ Show 20 Lines • Show All 177 Lines • ▼ Show 20 Line(s) | |||||
241 | void renderDecorationButton( QPainter*, const QRect&, const QColor&, ButtonType, bool inverted ) const; | 246 | void renderDecorationButton( QPainter*, const QRect&, const QColor&, ButtonType, bool inverted ) const; | ||
242 | 247 | | |||
243 | //* generic shadow for rounded rectangles | 248 | //* generic shadow for rounded rectangles | ||
244 | void renderRoundedRectShadow ( QPainter*, const QRectF&, const QColor&, qreal radius = Metrics::Frame_FrameRadius - 0.5 ) const; | 249 | void renderRoundedRectShadow ( QPainter*, const QRectF&, const QColor&, qreal radius = Metrics::Frame_FrameRadius - 0.5 ) const; | ||
245 | 250 | | |||
246 | //* generic shadow for ellipses | 251 | //* generic shadow for ellipses | ||
247 | void renderEllipseShadow( QPainter*, const QRectF&, const QColor& ) const; | 252 | void renderEllipseShadow( QPainter*, const QRectF&, const QColor& ) const; | ||
248 | 253 | | |||
254 | //* draw the tools area border | ||||
255 | void renderToolsAreaBorder ( QPainter*, const QWidget*, bool menubar = false ) const; | ||||
256 | | ||||
249 | //@} | 257 | //@} | ||
250 | 258 | | |||
251 | //*@name compositing utilities | 259 | //*@name compositing utilities | ||
252 | //@{ | 260 | //@{ | ||
253 | 261 | | |||
254 | //* true if style was compiled for and is running on X11 | 262 | //* true if style was compiled for and is running on X11 | ||
255 | static bool isX11(); | 263 | static bool isX11(); | ||
256 | 264 | | |||
257 | //* true if running on platform Wayland | 265 | //* true if running on platform Wayland | ||
258 | static bool isWayland(); | 266 | static bool isWayland(); | ||
259 | 267 | | |||
260 | //* returns true if compositing is active | 268 | //* returns true if compositing is active | ||
261 | bool compositingActive() const; | 269 | bool compositingActive() const; | ||
262 | 270 | | |||
263 | //* returns true if a given widget supports alpha channel | 271 | //* returns true if a given widget supports alpha channel | ||
264 | bool hasAlphaChannel( const QWidget* ) const; | 272 | bool hasAlphaChannel( const QWidget* ) const; | ||
265 | 273 | | |||
274 | //* returns true if widget is in the tools area | ||||
275 | bool isInToolsArea( const QWidget* ) const; | ||||
276 | | ||||
277 | //* returns false if tools area is empty | ||||
278 | bool toolsAreaHasContents ( const QWidget* ) const; | ||||
279 | | ||||
280 | //* returns true if tools area has a toolbar | ||||
281 | bool toolsAreaHasToolBar ( const QWidget* ) const; | ||||
282 | | ||||
283 | //* returns true if the tools area should be drawn | ||||
284 | bool shouldDrawToolsArea ( const QWidget* ) const; | ||||
285 | | ||||
286 | //* returns the tools area border color | ||||
287 | QColor toolsAreaBorderColor ( const QWidget* ) const; | ||||
288 | | ||||
289 | //* returns the united rectangle of all toolbars in the tools area | ||||
290 | QRect toolsAreaToolbarsRect (const QWidget* widget) const; | ||||
291 | | ||||
292 | QToolBar* grabToolBarForToolsArea ( const QWidget* ) const; | ||||
293 | | ||||
266 | //@} | 294 | //@} | ||
267 | 295 | | |||
268 | //@name high dpi utility functions | 296 | //@name high dpi utility functions | ||
269 | //@{ | 297 | //@{ | ||
270 | 298 | | |||
271 | //* return dpi-aware pixmap of given size | 299 | //* return dpi-aware pixmap of given size | ||
272 | virtual QPixmap highDpiPixmap( const QSize& size ) const | 300 | virtual QPixmap highDpiPixmap( const QSize& size ) const | ||
273 | { return highDpiPixmap( size.width(), size.height() ); } | 301 | { return highDpiPixmap( size.width(), size.height() ); } | ||
Show All 29 Lines | |||||
303 | //* return rounded path in a given rect, with only selected corners rounded, and for a given radius | 331 | //* return rounded path in a given rect, with only selected corners rounded, and for a given radius | ||
304 | QPainterPath roundedPath( const QRectF&, Corners, qreal ) const; | 332 | QPainterPath roundedPath( const QRectF&, Corners, qreal ) const; | ||
305 | 333 | | |||
306 | private: | 334 | private: | ||
307 | 335 | | |||
308 | //* configuration | 336 | //* configuration | ||
309 | KSharedConfig::Ptr _config; | 337 | KSharedConfig::Ptr _config; | ||
310 | 338 | | |||
339 | //* decoration configuration | ||||
340 | QSharedPointer<InternalSettings> _decorationConfig; | ||||
341 | | ||||
311 | //*@name brushes | 342 | //*@name brushes | ||
312 | //@{ | 343 | //@{ | ||
313 | KStatefulBrush _viewFocusBrush; | 344 | KStatefulBrush _viewFocusBrush; | ||
314 | KStatefulBrush _viewHoverBrush; | 345 | KStatefulBrush _viewHoverBrush; | ||
315 | KStatefulBrush _viewNegativeTextBrush; | 346 | KStatefulBrush _viewNegativeTextBrush; | ||
316 | //@} | 347 | //@} | ||
317 | 348 | | |||
318 | //*@name windeco colors | 349 | //*@name windeco colors | ||
Show All 12 Lines |
Not needed as far as I can tell (none of your changes in this file require QToolbar)