[gnome-tweak-tool] Fix window theme tweak



commit 6bc4ca921b38dfe41dd92751489f223a8a76b062
Author: John Stowers <john stowers gmail com>
Date:   Wed Apr 27 09:46:38 2011 +1200

    Fix window theme tweak

 NEWS                           |    3 ++-
 gtweak/tweaks/tweak_windows.py |   14 +++++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index 96e152b..9b14438 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
 3.0.2
-   *
+   * Really tweak window theme - both the fallback and the
+     shell metacity/mutter theme
 
 3.0.1
    * Fix localization
diff --git a/gtweak/tweaks/tweak_windows.py b/gtweak/tweaks/tweak_windows.py
index 13cfe3d..e71b22d 100644
--- a/gtweak/tweaks/tweak_windows.py
+++ b/gtweak/tweaks/tweak_windows.py
@@ -20,6 +20,7 @@ import os.path
 import gtweak
 from gtweak.tweakmodel import TweakGroup
 from gtweak.widgets import GConfComboTweak, build_horizontal_sizegroup
+from gtweak.gconf import GConfSetting
 
 class ActionClickTitlebarTweak(GConfComboTweak):
     def __init__(self, key_name, **options):
@@ -37,11 +38,13 @@ class ActionClickTitlebarTweak(GConfComboTweak):
 class WindowThemeSwitcher(GConfComboTweak):
     def __init__(self, **options):
         GConfComboTweak.__init__(self,
-            "/apps/metacity/general/theme",
+            "/desktop/gnome/shell/windows/theme",
             str,
             [(t, t) for t in self._get_valid_themes()],
             **options)
 
+        #also need to change the fallback (metacity) window theme
+        self.gconf_metacity = GConfSetting("/apps/metacity/general/theme", str)
     def _get_valid_themes(self):
         valid = []
         dirs = ( os.path.join(gtweak.DATA_DIR, "themes"),
@@ -52,6 +55,15 @@ class WindowThemeSwitcher(GConfComboTweak):
                      valid.append(t)
         return valid
 
+    def _on_combo_changed(self, combo):
+        #its probbably not too nice to dupe this function here, but i'm lazy
+        #and the real cause is the hidious gconf/shell/metacity override business
+        _iter = combo.get_active_iter()
+        if _iter:
+            value = combo.get_model().get_value(_iter, 0)
+            self.gconf.set_value(value)
+            self.gconf_metacity.set_value(value)
+
 sg = build_horizontal_sizegroup()
 
 TWEAK_GROUPS = (



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]