Support custom themes (#288)

* Remove relief
The relief gets stuck on touchscreens

* Support custom themes
This commit is contained in:
Alfredo Monclus
2021-10-04 21:14:40 -03:00
committed by GitHub
parent 423d344197
commit c618044898
2 changed files with 10 additions and 2 deletions

View File

@@ -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: