mirror of
https://github.com/janishutz/midi-micro-bit_sound-converter.git
synced 2025-11-25 13:54:26 +00:00
I have spent some time (like two hours) fixing up the app, getting it up to a somewhat better level. Code is still bad, but that's that. If anybody is interested to make the code neater, feel free to open a PR!
33 lines
725 B
Python
33 lines
725 B
Python
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/loading_screen.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()
|