Initial GUI-Development progress - 2022-02-26-16:42

This commit is contained in:
janis
2022-02-26 16:44:03 +01:00
parent f3b47e0f5b
commit 1a60b68461
10 changed files with 161 additions and 114 deletions

32
dev_tools/hotreloader.py Normal file
View File

@@ -0,0 +1,32 @@
from kivy.lang import Builder
from kivymd.app import MDApp
KV = '''
#:import KivyLexer kivy.extras.highlight.KivyLexer
#:import HotReloadViewer kivymd.utils.hot_reload_viewer.HotReloadViewer
BoxLayout:
HotReloadViewer:
size_hint_x: .3
path: app.path_to_kv_file
errors: True
errors_text_color: 1, 1, 0, 1
errors_background_color: app.theme_cls.bg_dark
'''
class Example(MDApp):
path_to_kv_file = "../gui_main/configurator.kv"
def build(self):
self.theme_cls.theme_style = "Dark"
return Builder.load_string(KV)
def update_kv_file(self, text):
with open(self.path_to_kv_file, "w") as kv_file:
kv_file.write(text)
Example().run()