-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
kdeplatformtheme.h
62 lines (44 loc) · 1.97 KB
/
kdeplatformtheme.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* This file is part of the KDE libraries
SPDX-FileCopyrightText: 2013 Kevin Ottens <ervin+bluesystems@kde.org>
SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#ifndef KDEPLATFORMTHEME_H
#define KDEPLATFORMTHEME_H
#include <QHash>
#include <QKeySequence>
#include <private/qgenericunixthemes_p.h>
class KHintsSettings;
class KFontSettingsData;
class KWaylandIntegration;
class X11Integration;
class QIconEngine;
class QWindow;
class KdePlatformTheme : public QGenericUnixTheme
{
public:
KdePlatformTheme();
~KdePlatformTheme() override;
QVariant themeHint(ThemeHint hint) const override;
QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions) const override;
const QPalette *palette(Palette type = SystemPalette) const override;
const QFont *font(Font type) const override;
QIconEngine *createIconEngine(const QString &iconName) const override;
QList<QKeySequence> keyBindings(QKeySequence::StandardKey key) const override;
QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const override;
bool usePlatformNativeDialog(DialogType type) const override;
QString standardButtonText(int button) const override;
QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const override;
QPlatformMenuBar *createPlatformMenuBar() const override;
private:
void setMenuBarForWindow(QWindow *window, const QString &serviceName, const QString &objectPath) const;
void loadSettings();
void setQtQuickControlsTheme();
static void setWindowProperty(QWindow *window, const QByteArray &name, const QByteArray &value);
static bool useXdgDesktopPortal();
static bool checkIfThemeExists(const QString &themePath);
KHintsSettings *m_hints = nullptr;
KFontSettingsData *m_fontsData = nullptr;
QScopedPointer<KWaylandIntegration> m_kwaylandIntegration;
QScopedPointer<X11Integration> m_x11Integration;
};
#endif // KDEPLATFORMTHEME_H