Skip to content

Commit

Permalink
Revert "Font sizes are now writable."
Browse files Browse the repository at this point in the history
This reverts commit 2642e4c
  • Loading branch information
ATATC committed Mar 26, 2024
1 parent 5dbc948 commit 5d4597e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
8 changes: 4 additions & 4 deletions leads_gui/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ def __init__(self, base: dict[str, _Any]) -> None:
self.no_title_bar: bool = False
self.manual_mode: bool = False
self.refresh_rate: int = 30
self.w_font_size_small: int = 14
self.w_font_size_medium: int = 24
self.w_font_size_large: int = 40
self.w_font_size_x_large: int = 56
self.font_size_small: int = 14
self.font_size_medium: int = 24
self.font_size_large: int = 40
self.font_size_x_large: int = 56
self.comm_addr: str = "127.0.0.1"
self.comm_port: int = 16900
self.data_dir: str = "data"
Expand Down
2 changes: 1 addition & 1 deletion leads_gui/icons.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def load_source(self, color: Color) -> _Image:

def __call__(self, size: int | None = None, color: Color | None = None) -> _CTkImage:
if size is None:
size = _require_config().w_font_size_medium
size = _require_config().font_size_medium
return _CTkImage(self.load_source(color if color else Color.BLACK),
None if color else self.load_source(Color.WHITE),
size=(size, size))
Expand Down
17 changes: 8 additions & 9 deletions leads_vec/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,27 @@ def switch_m3_mode():
manager.rd().m3_mode = (manager.rd().m3_mode + 1) % 3

manager["m1"] = CTkButton(manager.root(), textvariable=m1, command=switch_m1_mode,
font=("Arial", cfg.w_font_size_small))
font=("Arial", cfg.font_size_small))
manager["m2"] = CTkButton(manager.root(), textvariable=m2, state="disabled",
font=("Arial", cfg.w_font_size_x_large))
font=("Arial", cfg.font_size_x_large))
manager["m3"] = CTkButton(manager.root(), textvariable=m3, command=switch_m3_mode,
font=("Arial", cfg.w_font_size_medium))
font=("Arial", cfg.font_size_medium))

manager["comm_status"] = CTkLabel(manager.root(), text="COMM OFFLINE", text_color="gray",
font=("Arial", cfg.w_font_size_small))
font=("Arial", cfg.font_size_small))

i = 0
for system in SystemLiteral:
i += 1
system_lower = system.lower()
manager[system_lower + "_status"] = CTkLabel(manager.root(), text=system + " READY", text_color="green",
font=("Arial", cfg.w_font_size_small))
font=("Arial", cfg.font_size_small))
add_hotkey(str(i), switch := make_system_switch(ctx, SystemLiteral(system), manager.rd()))
manager[system_lower] = CTkButton(manager.root(), text=system + " ON", command=switch,
font=("Arial", cfg.w_font_size_small))
font=("Arial", cfg.font_size_small))

manager["time_lap"] = CTkButton(manager.root(), text="Time Lap", command=ctx.time_lap,
font=("Arial", cfg.w_font_size_small))
font=("Arial", cfg.font_size_small))

def hazard():
ctx.hazard(not ctx.hazard())
Expand All @@ -88,8 +88,7 @@ def switch_ecs_mode(mode):
manager.rd().control_system_switch_changed = True

manager["ecs"] = CTkSegmentedButton(manager.root(), values=["STANDARD", "AGGRESSIVE", "SPORT", "OFF"],
variable=ecs, command=switch_ecs_mode,
font=("Arial", cfg.w_font_size_small))
variable=ecs, command=switch_ecs_mode, font=("Arial", cfg.font_size_small))

uim = initialize(window, render, ctx, get_controller(MAIN_CONTROLLER))

Expand Down

0 comments on commit 5d4597e

Please sign in to comment.