[gnome-tweak-tool] Support versioned Gtk3 themes
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-tweak-tool] Support versioned Gtk3 themes
- Date: Thu, 24 Mar 2016 20:03:37 +0000 (UTC)
commit f47ba28fbb2c895a88d4e5ca8b89bc18475a86e9
Author: Patrick Griffis <tingping tingping se>
Date: Wed Mar 23 20:39:20 2016 -0400
Support versioned Gtk3 themes
gtweak/tweaks/tweak_group_interface.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtweak/tweaks/tweak_group_interface.py b/gtweak/tweaks/tweak_group_interface.py
index ed2ad5f..97751ed 100644
--- a/gtweak/tweaks/tweak_group_interface.py
+++ b/gtweak/tweaks/tweak_group_interface.py
@@ -46,12 +46,17 @@ class GtkThemeSwitcher(GSettingsComboTweak):
def _get_valid_themes(self):
""" Only shows themes that have variations for gtk+-3 and gtk+-2 """
+ gtk_ver = Gtk.MINOR_VERSION
+ if gtk_ver % 2: # Want even number
+ gtk_ver += 1
+
dirs = ( os.path.join(gtweak.DATA_DIR, "themes"),
os.path.join(GLib.get_user_data_dir(), "themes"),
os.path.join(os.path.expanduser("~"), ".themes"))
valid = walk_directories(dirs, lambda d:
os.path.exists(os.path.join(d, "gtk-2.0")) and \
- os.path.exists(os.path.join(d, "gtk-3.0")))
+ (os.path.exists(os.path.join(d, "gtk-3.0")) or \
+ os.path.exists(os.path.join(d, "gtk-3.{}".format(gtk_ver)))))
return valid
class IconThemeSwitcher(GSettingsComboTweak):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]