-
Notifications
You must be signed in to change notification settings - Fork 0
/
proxytheme.cpp
114 lines (95 loc) · 3.54 KB
/
proxytheme.cpp
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#include <QIcon>
#include <QKeySequence>
#include <QList>
#include <QPixmap>
#include <QVariant>
#include "proxytheme.h"
ProxyTheme::ProxyTheme(std::unique_ptr<QPlatformTheme> baseTheme) : baseTheme_(std::move(baseTheme))
{
}
ProxyTheme::~ProxyTheme() = default;
QPlatformMenuItem *ProxyTheme::createPlatformMenuItem() const
{
return baseTheme_ ? baseTheme_->createPlatformMenuItem()
: QPlatformTheme::createPlatformMenuItem();
}
QPlatformMenu *ProxyTheme::createPlatformMenu() const
{
return baseTheme_ ? baseTheme_->createPlatformMenu() : QPlatformTheme::createPlatformMenu();
}
QPlatformMenuBar *ProxyTheme::createPlatformMenuBar() const
{
return baseTheme_ ? baseTheme_->createPlatformMenuBar()
: QPlatformTheme::createPlatformMenuBar();
}
void ProxyTheme::showPlatformMenuBar()
{
baseTheme_ ? baseTheme_->createPlatformMenuItem() : QPlatformTheme::createPlatformMenuItem();
}
bool ProxyTheme::usePlatformNativeDialog(DialogType type) const
{
return baseTheme_ ? baseTheme_->usePlatformNativeDialog(type)
: QPlatformTheme::usePlatformNativeDialog(type);
}
QPlatformDialogHelper *ProxyTheme::createPlatformDialogHelper(DialogType type) const
{
return baseTheme_ ? baseTheme_->createPlatformDialogHelper(type)
: QPlatformTheme::createPlatformDialogHelper(type);
}
QPlatformSystemTrayIcon *ProxyTheme::createPlatformSystemTrayIcon() const
{
return baseTheme_ ? baseTheme_->createPlatformSystemTrayIcon()
: QPlatformTheme::createPlatformSystemTrayIcon();
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
Qt::ColorScheme ProxyTheme::colorScheme() const
{
return baseTheme_ ? baseTheme_->colorScheme() : QPlatformTheme::colorScheme();
}
#elif QT_VERSION >= QT_VERSION_CHECK(6, 2, 1)
auto ProxyTheme::appearance() const -> Appearance
{
return baseTheme_ ? baseTheme_->appearance() : QPlatformTheme::appearance();
}
#endif
const QPalette *ProxyTheme::palette(Palette type) const
{
return baseTheme_ ? baseTheme_->palette(type) : QPlatformTheme::palette(type);
}
const QFont *ProxyTheme::font(Font type) const
{
return baseTheme_ ? baseTheme_->font(type) : QPlatformTheme::font(type);
}
QVariant ProxyTheme::themeHint(ThemeHint hint) const
{
return baseTheme_ ? baseTheme_->themeHint(hint) : QPlatformTheme::themeHint(hint);
}
QPixmap ProxyTheme::standardPixmap(StandardPixmap sp, const QSizeF &size) const
{
return baseTheme_ ? baseTheme_->standardPixmap(sp, size)
: QPlatformTheme::standardPixmap(sp, size);
}
QIcon ProxyTheme::fileIcon(const QFileInfo &fileInfo, IconOptions iconOptions) const
{
return baseTheme_ ? baseTheme_->fileIcon(fileInfo, iconOptions)
: QPlatformTheme::fileIcon(fileInfo, iconOptions);
}
QIconEngine *ProxyTheme::createIconEngine(const QString &iconName) const
{
return baseTheme_ ? baseTheme_->createIconEngine(iconName)
: QPlatformTheme::createIconEngine(iconName);
}
QList<QKeySequence> ProxyTheme::keyBindings(QKeySequence::StandardKey key) const
{
return baseTheme_ ? baseTheme_->keyBindings(key) : QPlatformTheme::keyBindings(key);
}
QString ProxyTheme::standardButtonText(int button) const
{
return baseTheme_ ? baseTheme_->standardButtonText(button)
: QPlatformTheme::standardButtonText(button);
}
QKeySequence ProxyTheme::standardButtonShortcut(int button) const
{
return baseTheme_ ? baseTheme_->standardButtonShortcut(button)
: QPlatformTheme::standardButtonShortcut(button);
}