7#include <private/qguiapplication_p.h>
8#include <qpa/qplatformtheme_p.h>
9#include <qpa/qplatformthemefactory_p.h>
10#include <qpa/qplatformintegration.h>
12#include <QDBusConnection>
13#include <QDBusMessage>
14#include <QDBusPendingCall>
15#include <QDBusPendingCallWatcher>
16#include <QDBusPendingReply>
59 switch (colorschemePref) {
70 if (
group ==
"org.freedesktop.appearance"_L1 &&
key ==
"color-scheme"_L1) {
113 "/org/freedesktop/portal/desktop"_L1,
114 "org.freedesktop.DBus.Properties"_L1,
116 message <<
"org.freedesktop.portal.FileChooser"_L1 <<
"version"_L1;
121 if (
reply.isValid()) {
122 d->fileChooserPortalVersion = reply.value().toUInt();
129 "/org/freedesktop/portal/desktop"_L1,
130 "org.freedesktop.portal.Settings"_L1,
132 message <<
"org.freedesktop.appearance"_L1 <<
"color-scheme"_L1;
136 if (
reply.isValid()) {
143 "org.freedesktop.portal.Desktop"_L1,
"/org/freedesktop/portal/desktop"_L1,
144 "org.freedesktop.portal.Settings"_L1,
"SettingChanged"_L1, d_ptr.
get(),
151 return d->baseTheme->createPlatformMenuItem();
157 return d->baseTheme->createPlatformMenu();
163 return d->baseTheme->createPlatformMenuBar();
169 return d->baseTheme->showPlatformMenuBar();
179 return d->baseTheme->usePlatformNativeDialog(
type);
189 if (
d->baseTheme->usePlatformNativeDialog(
type))
191 d->fileChooserPortalVersion);
196 return d->baseTheme->createPlatformDialogHelper(
type);
199#ifndef QT_NO_SYSTEMTRAYICON
203 return d->baseTheme->createPlatformSystemTrayIcon();
210 return d->baseTheme->palette(
type);
216 return d->baseTheme->font(
type);
222 return d->baseTheme->themeHint(
hint);
229 return d->baseTheme->colorScheme();
230 return d->colorScheme;
236 return d->baseTheme->standardPixmap(
sp,
size);
240 QPlatformTheme::IconOptions iconOptions)
const
243 return d->baseTheme->fileIcon(fileInfo, iconOptions);
249 return d->baseTheme->createIconEngine(iconName);
252#if QT_CONFIG(shortcut)
256 return d->baseTheme->keyBindings(
key);
263 return d->baseTheme->standardButtonText(
button);
268#include "qxdgdesktopportaltheme.moc"
static QDBusConnection sessionBus()
Returns a QDBusConnection object opened with the session bus.
static QDBusMessage createMethodCall(const QString &destination, const QString &path, const QString &interface, const QString &method)
Constructs a new DBus message representing a method call.
void finished(QDBusPendingCallWatcher *self=nullptr)
This signal is emitted when the pending call has finished and its reply is available.
static QPlatformIntegration * platform_integration
The QIconEngine class provides an abstract base class for QIcon renderers.
The QIcon class provides scalable icons in different modes and states.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
The QPalette class contains color groups for each widget state.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
\macro QT_RESTRICTED_CAST_FROM_ASCII
static void handleThemeChange(QWindow *window=nullptr)
Qt::ColorScheme colorScheme
static Qt::ColorScheme colorSchemeFromXdgPref(const XdgColorschemePref colorschemePref)
QXdgDesktopPortalThemePrivate()
QPlatformTheme * baseTheme
uint fileChooserPortalVersion
void settingChanged(const QString &group, const QString &key, const QDBusVariant &value)
~QXdgDesktopPortalThemePrivate()
Qt::ColorScheme colorScheme() const override
QPlatformMenuItem * createPlatformMenuItem() const override
QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const override
QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions={ }) const override
Return an icon for fileInfo, observing iconOptions.
QString standardButtonText(int button) const override
Returns the text of a standard button.
bool usePlatformNativeDialog(DialogType type) const override
QPlatformSystemTrayIcon * createPlatformSystemTrayIcon() const override
Factory function for QSystemTrayIcon.
QIconEngine * createIconEngine(const QString &iconName) const override
Factory function for the QIconEngine used by QIcon::fromTheme().
QPlatformDialogHelper * createPlatformDialogHelper(DialogType type) const override
const QPalette * palette(Palette type=SystemPalette) const override
const QFont * font(Font type=SystemFont) const override
void showPlatformMenuBar() override
QPlatformMenuBar * createPlatformMenuBar() const override
QPlatformMenu * createPlatformMenu() const override
QVariant themeHint(ThemeHint hint) const override
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static QString themeName()
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLsizei const GLchar * message
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
QT_BEGIN_NAMESPACE constexpr const wchar_t * themeNames[]
QFutureWatcher< int > watcher