Merge lp:~marmuta/unity-greeter/onboard-notify-theme-change into lp:unity-greeter

Proposed by marmuta
Status: Needs review
Proposed branch: lp:~marmuta/unity-greeter/onboard-notify-theme-change
Merge into: lp:unity-greeter
Diff against target: 90 lines (+32/-9)
4 files modified
src/menubar.vala (+4/-3)
src/settings-daemon.vala (+3/-3)
src/settings.vala (+19/-0)
src/unity-greeter.vala (+6/-3)
To merge this branch: bzr merge lp:~marmuta/unity-greeter/onboard-notify-theme-change
Reviewer Review Type Date Requested Status
Robert Ancell Needs Fixing
Review via email: mp+101017@code.launchpad.net

Description of the change

This change writes the gtk-theme to gsettings and then notifies Onboard with the xsettings plugin of gnome-settings-daemon. Onboard has high contrast themes built-in, so it just switches to one of those when it gets the message.

I'm not quite sure if enabling xsettings is acceptble, though. You probably had your reasons to disable it before, however in my testing I didn't see any negative effects.

Have a look, please.

To post a comment you must log in.
Revision history for this message
Robert Ancell (robert-ancell) wrote :

I just tried this and can confirm it changes the them of onboard and the shutdown dialog but it doesn't seem to change the theme of the widgets in the login screen and the indicators.

review: Needs Fixing
382. By marmuta

Don't set the GtkSettings theme anymore. Fixes widgets not being updated when the GSettings theme changes.

Revision history for this message
marmuta (marmuta) wrote :

How's this?

Unmerged revisions

382. By marmuta

Don't set the GtkSettings theme anymore. Fixes widgets not being updated when the GSettings theme changes.

381. By marmuta

Let Onboard know that the contrast setting has changed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/menubar.vala'
2--- src/menubar.vala 2012-03-21 20:00:39 +0000
3+++ src/menubar.vala 2012-04-19 15:06:24 +0000
4@@ -430,11 +430,12 @@
5
6 private void high_contrast_toggled_cb (Gtk.CheckMenuItem item)
7 {
8- var settings = Gtk.Settings.get_default ();
9+ var gsettings = new GDIGSettings();
10 if (item.active)
11- settings.set ("gtk-theme-name", "HighContrastInverse");
12+ gsettings.set_string(GDIGSettings.KEY_THEME_NAME, "HighContrastInverse");
13 else
14- settings.set ("gtk-theme-name", default_theme_name);
15+ gsettings.set_string(GDIGSettings.KEY_THEME_NAME, default_theme_name);
16+
17 high_contrast = item.active;
18 UGSettings.set_boolean (UGSettings.KEY_HIGH_CONTRAST, high_contrast);
19 }
20
21=== modified file 'src/settings-daemon.vala'
22--- src/settings-daemon.vala 2012-02-14 23:43:43 +0000
23+++ src/settings-daemon.vala 2012-04-19 15:06:24 +0000
24@@ -40,15 +40,15 @@
25 "org.gnome.settings-daemon.plugins.print-notifications",
26 "org.gnome.settings-daemon.plugins.smartcard",
27 "org.gnome.settings-daemon.plugins.sound",
28- "org.gnome.settings-daemon.plugins.wacom",
29- "org.gnome.settings-daemon.plugins.xsettings"};
30+ "org.gnome.settings-daemon.plugins.wacom"};
31
32 string[] enabled = {"org.gnome.settings-daemon.plugins.a11y-keyboard",
33 "org.gnome.settings-daemon.plugins.a11y-settings",
34 "org.gnome.settings-daemon.plugins.color",
35 "org.gnome.settings-daemon.plugins.cursor",
36 "org.gnome.settings-daemon.plugins.power",
37- "org.gnome.settings-daemon.plugins.xrandr"};
38+ "org.gnome.settings-daemon.plugins.xrandr",
39+ "org.gnome.settings-daemon.plugins.xsettings"};
40
41 foreach (var schema in disabled)
42 set_plugin_enabled (schema, false);
43
44=== modified file 'src/settings.vala'
45--- src/settings.vala 2012-04-17 07:16:20 +0000
46+++ src/settings.vala 2012-04-19 15:06:24 +0000
47@@ -64,3 +64,22 @@
48
49 private static const string SCHEMA = "com.canonical.unity-greeter";
50 }
51+
52+
53+public class GDIGSettings
54+{
55+ public static const string KEY_THEME_NAME = "gtk-theme";
56+
57+ public GDIGSettings ()
58+ {
59+ settings = new Settings(SCHEMA);
60+ }
61+ public bool set_string (string key, string value)
62+ {
63+ return settings.set_string (key, value);
64+ }
65+
66+ private static const string SCHEMA = "org.gnome.desktop.interface";
67+ private Settings settings;
68+}
69+
70
71=== modified file 'src/unity-greeter.vala'
72--- src/unity-greeter.vala 2012-04-17 07:11:32 +0000
73+++ src/unity-greeter.vala 2012-04-19 15:06:24 +0000
74@@ -852,10 +852,13 @@
75
76 /* Set GTK+ settings */
77 debug ("Setting GTK+ settings");
78+
79+ var gsettings = new GDIGSettings();
80+ var value = UGSettings.get_string (UGSettings.KEY_THEME_NAME);
81+ if (value != "")
82+ gsettings.set_string (GDIGSettings.KEY_THEME_NAME, value);
83+
84 var settings = Gtk.Settings.get_default ();
85- var value = UGSettings.get_string (UGSettings.KEY_THEME_NAME);
86- if (value != "")
87- settings.set ("gtk-theme-name", value, null);
88 value = UGSettings.get_string (UGSettings.KEY_ICON_THEME_NAME);
89 if (value != "")
90 settings.set ("gtk-icon-theme-name", value, null);

Subscribers

People subscribed via source and target branches