[gnome-shell/wip/carlosg/cleanup-gtk-usage: 76/77] main: Use GSettings instead of GtkSettings
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/carlosg/cleanup-gtk-usage: 76/77] main: Use GSettings instead of GtkSettings
- Date: Sat, 26 Jan 2019 14:35:05 +0000 (UTC)
commit 3eb93a84d300442266f2e1fc20e71a6f9b093594
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Nov 27 14:59:09 2018 +0100
main: Use GSettings instead of GtkSettings
Cut a middle man by listening to dconf settings directly, and stop relying
on XSettings for it.
js/ui/main.js | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/main.js b/js/ui/main.js
index 6e2122273..84aefe7d5 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -88,6 +88,7 @@ let _cssStylesheet = null;
let _a11ySettings = null;
let _themeResource = null;
let _oskResource = null;
+let _interfaceSettings = null;
function _sessionUpdated() {
if (sessionMode.isPrimary)
@@ -127,8 +128,9 @@ function start() {
sessionMode = new SessionMode.SessionMode();
sessionMode.connect('updated', _sessionUpdated);
- Gtk.Settings.get_default().connect('notify::gtk-theme-name',
- _loadDefaultStylesheet);
+
+ _interfaceSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.interface' });
+ _interfaceSettings.connect('changed::gtk-theme', _loadDefaultStylesheet);
Gtk.IconTheme.get_default().add_resource_path('/org/gnome/shell/theme/icons');
_initializeUI();
@@ -279,7 +281,7 @@ function _getDefaultStylesheet() {
// Look for a high-contrast variant first when using GTK+'s HighContrast
// theme
- if (Gtk.Settings.get_default().gtk_theme_name == 'HighContrast')
+ if (_interfaceSettings.get_string('gtk-theme') == 'HighContrast')
stylesheet = _getStylesheet(name.replace('.css', '-high-contrast.css'));
if (stylesheet == null)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]