Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Backports:SLE-15-SP4:FactoryCandidates
libqt5-qtstyleplugins
qtstyleplugins-gtksettings.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File qtstyleplugins-gtksettings.patch of Package libqt5-qtstyleplugins
--- a/src/plugins/platformthemes/gtk2/qgtk2theme.cpp +++ b/src/plugins/platformthemes/gtk2/qgtk2theme.cpp @@ -44,14 +44,28 @@ QT_BEGIN_NAMESPACE const char *QGtk2Theme::name = "gtk2"; -static QString gtkSetting(const gchar *propertyName) +static QVariant gtkSetting(const gchar *propertyName) { GtkSettings *settings = gtk_settings_get_default(); - gchararray value; - g_object_get(settings, propertyName, &value, NULL); - QString str = QString::fromUtf8(value); - g_free(value); - return str; + GValue value = G_VALUE_INIT; + QVariant ret; + + g_object_get_property(G_OBJECT(settings), propertyName, &value); + if (G_VALUE_HOLDS_INT(&value)) { + ret = QVariant(g_value_get_int(&value)); + } else if (G_VALUE_HOLDS_UINT(&value)) { + ret = QVariant(g_value_get_uint(&value)); + } else if (G_VALUE_HOLDS_FLOAT(&value)) { + ret = QVariant(g_value_get_float(&value)); + } else if (G_VALUE_HOLDS_STRING(&value)) { + ret = QVariant(QString::fromUtf8(g_value_get_string(&value))); + } else if (G_VALUE_HOLDS_BOOLEAN(&value)) { + ret = QVariant(g_value_get_boolean(&value)); + } else { + ret = QVariant(); + } + g_value_unset(&value); + return ret; } QGtk2Theme::QGtk2Theme() @@ -68,12 +82,27 @@ QGtk2Theme::QGtk2Theme() QVariant QGtk2Theme::themeHint(QPlatformTheme::ThemeHint hint) const { switch (hint) { + case QPlatformTheme::CursorFlashTime: + // As close to GTK as possible. + if (gtkSetting("gtk-cursor-blink").toBool() && gtkSetting("gtk-cursor-blink-timeout").toInt() != 0) { + return gtkSetting("gtk-cursor-blink-time"); + } else { + return QVariant((int) 0); + } + case QPlatformTheme::PasswordMaskDelay: + return gtkSetting("gtk-entry-password-hint-timeout"); + case QPlatformTheme::DialogButtonBoxButtonsHaveIcons: + return gtkSetting("gtk-button-images"); +#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) + case QPlatformTheme::ShowShortcutsInContextMenus: + return gtkSetting("gtk-enable-accels"); +#endif case QPlatformTheme::SystemIconThemeName: - return QVariant(gtkSetting("gtk-icon-theme-name")); + return gtkSetting("gtk-icon-theme-name"); case QPlatformTheme::SystemIconFallbackThemeName: - return QVariant(gtkSetting("gtk-fallback-icon-theme")); + return gtkSetting("gtk-fallback-icon-theme"); case QPlatformTheme::StyleNames: - return QVariant(QStringList(QStringLiteral("gtk2"))); + return QStringList(QStringLiteral("gtk2")); default: return QGnomeTheme::themeHint(hint); } @@ -81,7 +110,7 @@ QVariant QGtk2Theme::themeHint(QPlatform QString QGtk2Theme::gtkFontName() const { - QString cfgFontName = gtkSetting("gtk-font-name"); + QString cfgFontName = gtkSetting("gtk-font-name").toString(); if (!cfgFontName.isEmpty()) return cfgFontName; return QGnomeTheme::gtkFontName();
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor