From c6180448982e95be65ca5215336f87b51d04d1dc Mon Sep 17 00:00:00 2001 From: Alfredo Monclus <alfredomonclus@gmail.com> Date: Mon, 4 Oct 2021 21:14:40 -0300 Subject: [PATCH] Support custom themes (#288) * Remove relief The relief gets stuck on touchscreens * Support custom themes --- ks_includes/config.py | 11 +++++++++-- styles/base.css | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ks_includes/config.py b/ks_includes/config.py index 724c047e..b6a52dff 100644 --- a/ks_includes/config.py +++ b/ks_includes/config.py @@ -130,8 +130,7 @@ class KlipperScreenConfig: {"theme": { "section": "main", "name": _("Icon Theme"), "type": "dropdown", "value": "z-bolt", "callback": screen.restart_warning, "options": [ - {"name": _("Z-bolt (default)"), "value": "z-bolt"}, - {"name": _("Colorized"), "value": "colorized"}]}}, + {"name": "Z-bolt" + " " + _("(default)"), "value": "z-bolt"}]}}, {"24htime": {"section": "main", "name": _("24 Hour Time"), "type": "binary", "value": "True"}}, {"side_macro_shortcut": { "section": "main", "name": _("Macro shortcut on sidebar"), "type": "binary", @@ -153,6 +152,14 @@ class KlipperScreenConfig: for lang in langs: lang_opt.append({"name": lang, "value": lang}) + t_path = os.path.join(os.getcwd(), 'styles') + themes = [d for d in os.listdir(t_path) if (not os.path.isfile(os.path.join(t_path, d)) and d != "z-bolt")] + themes.sort() + theme_opt = self.configurable_options[8]['theme']['options'] + + for theme in themes: + theme_opt.append({"name": theme, "value": theme}) + index = self.configurable_options.index( [i for i in self.configurable_options if list(i)[0] == "screen_blanking"][0]) for num in SCREEN_BLANKING_OPTIONS: diff --git a/styles/base.css b/styles/base.css index fa756b9a..dedc2325 100644 --- a/styles/base.css +++ b/styles/base.css @@ -3,6 +3,7 @@ font-size: KS_FONT_SIZEpx; -GtkComboBox-appears-as-list: 0; text-shadow: none; + box-shadow: none; } window {