Popups done, Readout Screen prepared, Small fixes

This commit is contained in:
2025-04-09 17:13:24 +02:00
parent 36a3079040
commit e0a54ac2bd
12 changed files with 248 additions and 46 deletions

View File

@@ -37,10 +37,10 @@
font_size: 13
pos_hint: {"y": -0.45, "x":0.05}
Button:
text: "Settings"
text: "About"
font_size: 13
size_hint: 0.07, 0.06
pos_hint: {"x":0.01, "y":0.01}
background_color: (50, 0, 0, 0.2)
on_release:
root.to_settings()
root.to_about()

View File

@@ -1,16 +1,29 @@
from kivy.uix.screenmanager import Screen
from kivy.lang import Builder
from gui.popups.popups import QuitPopup, SingleRowPopup, TwoActionPopup
from lib.com import Com
class HomeScreen(Screen):
def __init__(self, com: Com, **kw):
self._com = com;
super().__init__(**kw)
def start(self):
pass
if self._com.connect(19200):
self.manager.current = 'main'
self.manager.transition.direction = 'right'
else:
TwoActionPopup().open('Failed to connect', 'Details', self.open_details_popup)
print('ERROR connecting')
def open_details_popup(self):
print( 'Details' )
def quit(self):
pass
QuitPopup(self._com).open()
def to_settings(self):
self.manager.current = 'settings'
def to_about(self):
self.manager.current = 'about'
self.manager.transition.direction = 'down'