summaryrefslogtreecommitdiffstats
path: root/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-02-09 14:16:05 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-02-13 17:19:23 +0100
commit32749c913b32e89e2027227233794f2296166cc6 (patch)
tree0daec9a562b3a1f5bc59a0a9cc556b193a0f8593 /src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.cpp
parent0c6aa4c8c2f05e9172a0f1f5852277a01e54c7c2 (diff)
Rename Qt::Appearance to Qt::ColorScheme
Based on discussions in the 6.5 API review, where we concluded that 'appearance' is too general. Instead, we follow the CSS standard and use the term 'color scheme'. Pick-to: 6.5 Change-Id: I8ceaf4138ecadff5ccd962480e8e5beb39b556ec Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Jonas Kvinge <jonas@jkvinge.net> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.cpp')
-rw-r--r--src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.cpp b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.cpp
index c7b7ec550f..2f46b53297 100644
--- a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.cpp
+++ b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.cpp
@@ -40,7 +40,7 @@ public:
/*! \internal
- Converts the given Freedesktop color scheme setting \a colorschemePref to a Qt::Appearance value.
+ Converts the given Freedesktop color scheme setting \a colorschemePref to a Qt::ColorScheme value.
Specification: https://github.com/flatpak/xdg-desktop-portal/blob/d7a304a00697d7d608821253cd013f3b97ac0fb6/data/org.freedesktop.impl.portal.Settings.xml#L33-L45
Unfortunately the enum numerical values are not defined identically, so we have to convert them.
@@ -53,18 +53,18 @@ public:
1: Prefer dark appearance | 2: Dark
2: Prefer light appearance | 1: Light
*/
- static Qt::Appearance appearanceFromXdgPref(const XdgColorschemePref colorschemePref)
+ static Qt::ColorScheme colorSchemeFromXdgPref(const XdgColorschemePref colorschemePref)
{
switch (colorschemePref) {
- case PreferDark: return Qt::Appearance::Dark;
- case PreferLight: return Qt::Appearance::Light;
- default: return Qt::Appearance::Unknown;
+ case PreferDark: return Qt::ColorScheme::Dark;
+ case PreferLight: return Qt::ColorScheme::Light;
+ default: return Qt::ColorScheme::Unknown;
}
}
QPlatformTheme *baseTheme = nullptr;
uint fileChooserPortalVersion = 0;
- Qt::Appearance appearance = Qt::Appearance::Unknown;
+ Qt::ColorScheme colorScheme = Qt::ColorScheme::Unknown;
};
QXdgDesktopPortalTheme::QXdgDesktopPortalTheme()
@@ -124,7 +124,7 @@ QXdgDesktopPortalTheme::QXdgDesktopPortalTheme()
if (reply.isValid()) {
const QDBusVariant dbusVariant = qvariant_cast<QDBusVariant>(reply.value());
const QXdgDesktopPortalThemePrivate::XdgColorschemePref xdgPref = static_cast<QXdgDesktopPortalThemePrivate::XdgColorschemePref>(dbusVariant.variant().toUInt());
- d->appearance = QXdgDesktopPortalThemePrivate::appearanceFromXdgPref(xdgPref);
+ d->colorScheme = QXdgDesktopPortalThemePrivate::colorSchemeFromXdgPref(xdgPref);
}
}
@@ -205,10 +205,10 @@ QVariant QXdgDesktopPortalTheme::themeHint(ThemeHint hint) const
return d->baseTheme->themeHint(hint);
}
-Qt::Appearance QXdgDesktopPortalTheme::appearance() const
+Qt::ColorScheme QXdgDesktopPortalTheme::colorScheme() const
{
Q_D(const QXdgDesktopPortalTheme);
- return d->appearance;
+ return d->colorScheme;
}
QPixmap QXdgDesktopPortalTheme::standardPixmap(StandardPixmap sp, const QSizeF &size) const