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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -130,8 +130,7 @@ class KlipperScreenConfig:
{"theme": { {"theme": {
"section": "main", "name": _("Icon Theme"), "type": "dropdown", "section": "main", "name": _("Icon Theme"), "type": "dropdown",
"value": "z-bolt", "callback": screen.restart_warning, "options": [ "value": "z-bolt", "callback": screen.restart_warning, "options": [
{"name": _("Z-bolt (default)"), "value": "z-bolt"}, {"name": "Z-bolt" + " " + _("(default)"), "value": "z-bolt"}]}},
{"name": _("Colorized"), "value": "colorized"}]}},
{"24htime": {"section": "main", "name": _("24 Hour Time"), "type": "binary", "value": "True"}}, {"24htime": {"section": "main", "name": _("24 Hour Time"), "type": "binary", "value": "True"}},
{"side_macro_shortcut": { {"side_macro_shortcut": {
"section": "main", "name": _("Macro shortcut on sidebar"), "type": "binary", "section": "main", "name": _("Macro shortcut on sidebar"), "type": "binary",
@ -153,6 +152,14 @@ class KlipperScreenConfig:
for lang in langs: for lang in langs:
lang_opt.append({"name": lang, "value": lang}) 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( index = self.configurable_options.index(
[i for i in self.configurable_options if list(i)[0] == "screen_blanking"][0]) [i for i in self.configurable_options if list(i)[0] == "screen_blanking"][0])
for num in SCREEN_BLANKING_OPTIONS: for num in SCREEN_BLANKING_OPTIONS:

View File

@ -3,6 +3,7 @@
font-size: KS_FONT_SIZEpx; font-size: KS_FONT_SIZEpx;
-GtkComboBox-appears-as-list: 0; -GtkComboBox-appears-as-list: 0;
text-shadow: none; text-shadow: none;
box-shadow: none;
} }
window { window {