From f9c12f65c7e21d0df2fd68c4b35ba915dbf40128 Mon Sep 17 00:00:00 2001 From: ATATC Date: Sun, 24 Dec 2023 14:30:12 -0500 Subject: [PATCH] Routine updates. --- leads_dashboard/prototype.py | 4 +++- leads_vec/cli.py | 35 ++++++++++++++++++++++------------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/leads_dashboard/prototype.py b/leads_dashboard/prototype.py index b5242858..e855b9d7 100644 --- a/leads_dashboard/prototype.py +++ b/leads_dashboard/prototype.py @@ -2,7 +2,7 @@ from time import sleep as _sleep from typing import Callable as _Callable, Self as _Self, TypeVar as _TypeVar, Generic as _Generic -from PySimpleGUI import Window as _Window, Element as _Element, WINDOW_CLOSED as _WINDOW_CLOSED +from PySimpleGUI import Window as _Window, Element as _Element, WINDOW_CLOSED as _WINDOW_CLOSED, theme as _theme from leads_dashboard.runtime import RuntimeData @@ -31,8 +31,10 @@ def __init__(self, title: str = "LEADS", fullscreen: bool = True, no_title_bar: bool = True) -> None: + _theme("Default1") self._root: _Window = _Window(title, size=(None if width < 0 else width, None if height < 0 else height), + text_justification="center", no_titlebar=no_title_bar, disable_minimize=True) self._width: int = width diff --git a/leads_vec/cli.py b/leads_vec/cli.py index d8c2498d..15325944 100644 --- a/leads_vec/cli.py +++ b/leads_vec/cli.py @@ -26,14 +26,19 @@ def switch_m1_mode(): def switch_m3_mode(): manager.rd().m3_mode = (manager.rd().m3_mode + 1) % 3 - manager["m1"] = Button(font=BODY, key=switch_m1_mode, size=(96, 12)) - manager["m2"] = Button(font=H1, size=(32, 4)) - manager["m3"] = Button(font=H1, key=switch_m3_mode, size=(32, 4)) - manager["dtcs_status"] = Text(text="DTCS READY", text_color="green") - manager["abs_status"] = Text(text="ABS READY", text_color="green") - manager["ebi_status"] = Text(text="EBI READY", text_color="green") - manager["atbs_status"] = Text(text="ATBS READY", text_color="green") - manager["comm_status"] = Text(text="COMM ONLINE", text_color="white") + manager["m1"] = Button(font=BODY, key=switch_m1_mode, size=(round(manager.window().width() / 19.393939), 12)) + manager["m2"] = Button(font=H1, size=(round(manager.window().width() / 60), 4)) + manager["m3"] = Button(font=H1, key=switch_m3_mode, size=(round(manager.window().width() / 64), 4)) + manager["dtcs_status"] = Text(text="DTCS READY", text_color="green", font=BODY, + size=(round(manager.window().width() / 32.323232), None)) + manager["abs_status"] = Text(text="ABS READY", text_color="green", font=BODY, + size=(round(manager.window().width() / 32.323232), None)) + manager["ebi_status"] = Text(text="EBI READY", text_color="green", font=BODY, + size=(round(manager.window().width() / 32.323232), None)) + manager["atbs_status"] = Text(text="ATBS READY", text_color="green", font=BODY, + size=(round(manager.window().width() / 32.323232), None)) + manager["comm_status"] = Text(text="COMM ONLINE", text_color="white", font=BODY, + size=(round(manager.window().width() / 32.323232), None)) def switch_dtcs(): context.set_dtcs(not (dtcs_enabled := context.is_dtcs_enabled())) @@ -59,12 +64,16 @@ def switch_atbs(): add_hotkey("4", switch_atbs) - manager["dtcs"] = Button(button_text="DTCS ON", key=switch_dtcs) - manager["abs"] = Button(button_text="ABS ON", key=switch_abs) - manager["ebi"] = Button(button_text="EBI ON", key=switch_ebi) - manager["atbs"] = Button(button_text="ATBS ON", key=switch_atbs) + manager["dtcs"] = Button(button_text="DTCS ON", key=switch_dtcs, font=BODY, + size=(round(manager.window().width() / 25.858585), None)) + manager["abs"] = Button(button_text="ABS ON", key=switch_abs, font=BODY, + size=(round(manager.window().width() / 25.858585), None)) + manager["ebi"] = Button(button_text="EBI ON", key=switch_ebi, font=BODY, + size=(round(manager.window().width() / 25.858585), None)) + manager["atbs"] = Button(button_text="ATBS ON", key=switch_atbs, font=BODY, + size=(round(manager.window().width() / 25.858585), None)) - uim = initialize(Window(1920, 1080, + uim = initialize(Window(1080, 720, config.refresh_rate, CustomRuntimeData(), fullscreen=False,