KWin
Loading...
Searching...
No Matches
plastikbutton.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2012 Martin Gräßlin <mgraesslin@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6#pragma once
7
8#include <QQuickImageProvider>
9
10namespace KWin
11{
12
13class PlastikButtonProvider : public QQuickImageProvider
14{
15public:
16 explicit PlastikButtonProvider();
17 QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) override;
18
19private:
20 enum ButtonIcon {
21 CloseIcon = 0,
22 MaxIcon,
23 MaxRestoreIcon,
24 MinIcon,
25 HelpIcon,
26 OnAllDesktopsIcon,
27 NotOnAllDesktopsIcon,
28 KeepAboveIcon,
29 NoKeepAboveIcon,
30 KeepBelowIcon,
31 NoKeepBelowIcon,
32 ShadeIcon,
33 UnShadeIcon,
34 AppMenuIcon,
35 NumButtonIcons
36 };
37 enum Object {
38 HorizontalLine,
39 VerticalLine,
40 DiagonalLine,
41 CrossDiagonalLine
42 };
43 enum DecorationButton {
48 DecorationButtonNone,
49 DecorationButtonMenu,
50 DecorationButtonApplicationMenu,
51 DecorationButtonOnAllDesktops,
52 DecorationButtonQuickHelp,
53 DecorationButtonMinimize,
54 DecorationButtonMaximizeRestore,
55 DecorationButtonClose,
56 DecorationButtonKeepAbove,
57 DecorationButtonKeepBelow,
58 DecorationButtonShade,
59 DecorationButtonResize,
64 DecorationButtonExplicitSpacer
65 };
66 QPixmap icon(ButtonIcon icon, int size, bool active, bool shadow);
67 void drawObject(QPainter &p, Object object, int x, int y, int length, int lineWidth);
68};
69
70} // namespace
QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) override