Changeset View
Changeset View
Standalone View
Standalone View
kded/kwin_bridge/standarddecorationpainter.h
- This file was copied from kded/configvalueprovider.h.
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * Copyright (C) 2019 Mikhail Zolotukhin <zomial@protonmail.com> | 2 | * Copyright 2020 Mikhail Zolotukhin <zomial@protonmail.com> | ||
3 | * | 3 | * | ||
4 | * This program is free software; you can redistribute it and/or | 4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License as | 5 | * modify it under the terms of the GNU General Public License as | ||
6 | * published by the Free Software Foundation; either version 2 of | 6 | * published by the Free Software Foundation; either version 2 of | ||
7 | * the License or (at your option) version 3 or any later version | 7 | * the License or (at your option) version 3 or any later version | ||
8 | * accepted by the membership of KDE e.V. (or its successor approved | 8 | * accepted by the membership of KDE e.V. (or its successor approved | ||
9 | * by the membership of KDE e.V.), which shall act as a proxy | 9 | * by the membership of KDE e.V.), which shall act as a proxy | ||
10 | * defined in Section 14 of version 3 of the license. | 10 | * defined in Section 14 of version 3 of the license. | ||
11 | * | 11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | 12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. | ||
16 | * | 16 | * | ||
17 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #pragma once | 21 | #pragma once | ||
22 | 22 | | |||
23 | #include <KSharedConfig> | 23 | #include "decorationpainter.h" | ||
24 | #include "dummydecorationbridge.h" | ||||
24 | 25 | | |||
25 | class QString; | 26 | class StandardDecorationPainter : public DecorationPainter | ||
26 | class QFont; | | |||
27 | | ||||
28 | class ConfigValueProvider | | |||
29 | { | 27 | { | ||
30 | public: | 28 | public: | ||
31 | ConfigValueProvider(); | 29 | StandardDecorationPainter(const QString &themeName); | ||
30 | ~StandardDecorationPainter() = default; | ||||
32 | 31 | | |||
33 | QString fontName() const; | 32 | void paintButton(QPainter& painter, const QString& buttonType, const QString& buttonState) const override; | ||
34 | QString iconThemeName() const; | | |||
35 | QString cursorThemeName() const; | | |||
36 | bool iconsOnButtons() const; | | |||
37 | bool iconsInMenus() const; | | |||
38 | int toolbarStyle() const; | | |||
39 | bool scrollbarBehavior() const; | | |||
40 | bool preferDarkTheme() const; | | |||
41 | QString windowDecorationsButtonsOrder() const; | | |||
42 | bool enableAnimations() const; | | |||
43 | QMap<QString, QColor> colors() const; | | |||
44 | 33 | | |||
45 | private: | 34 | private: | ||
46 | QString fontStyleHelper(const QFont &font) const; | 35 | std::unique_ptr<KDecoration2::DummyDecorationBridge> m_bridge; | ||
47 | QString windowDecorationButtonsOrderInGtkNotation(const QString &kdeConfigValue) const; | | |||
48 | | ||||
49 | KSharedConfigPtr kdeglobalsConfig; | | |||
50 | KSharedConfigPtr inputConfig; | | |||
51 | KSharedConfigPtr kwinConfig; | | |||
52 | }; | 36 | }; |