Skip to content

Commit 4c54812

Browse files
committed
cs_themes: Don't require themes to support Gtk 2 any longer
Fixes: linuxmint/cinnamon-desktop#223.
1 parent 75a53a8 commit 4c54812

File tree

1 file changed

+6
-7
lines changed
  • files/usr/share/cinnamon/cinnamon-settings/modules

1 file changed

+6
-7
lines changed

Diff for: files/usr/share/cinnamon/cinnamon-settings/modules/cs_themes.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from ExtensionCore import DownloadSpicesPage
1212
from Spices import Spice_Harvester
1313

14-
import glob
14+
from pathlib import Path
1515

1616
ICON_SIZE = 48
1717

@@ -402,13 +402,12 @@ def _load_gtk_themes(self):
402402
return res
403403

404404
def filter_func_gtk_dir(self, directory):
405-
# returns whether a directory is a valid GTK theme
406-
if os.path.exists(os.path.join(directory, "gtk-2.0")):
407-
if os.path.exists(os.path.join(directory, "gtk-3.0")):
405+
theme_dir = Path(directory)
406+
407+
for gtk3_dir in theme_dir.glob("gtk-3.*"):
408+
# Skip gtk key themes
409+
if os.path.exists(os.path.join(gtk3_dir, "gtk.css")):
408410
return True
409-
else:
410-
for subdir in glob.glob("%s/gtk-3.*" % directory):
411-
return True
412411
return False
413412

414413
def _load_icon_themes(self):

0 commit comments

Comments
 (0)