Compare commits
No commits in common. "0c6f6957a8d46d8744b04357fa081aad909839aa" and "541db3701d21850ed9912a79cdf31a607385d569" have entirely different histories.
0c6f6957a8
...
541db3701d
@ -98,7 +98,7 @@ repos:
|
|||||||
- --jobs=4
|
- --jobs=4
|
||||||
additional_dependencies:
|
additional_dependencies:
|
||||||
- pytest
|
- pytest
|
||||||
- gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.1.1#subdirectory=gatelock
|
- gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.1.0#subdirectory=gatelock
|
||||||
- crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.1.0#subdirectory=crdt-sync
|
- crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.1.0#subdirectory=crdt-sync
|
||||||
- mcp
|
- mcp
|
||||||
- pydantic
|
- pydantic
|
||||||
|
|||||||
@ -7,7 +7,7 @@ requires-python = ">=3.10"
|
|||||||
# crdt-sync: shared CRDT merge scheme + GitHub-Contents-API sync transport,
|
# crdt-sync: shared CRDT merge scheme + GitHub-Contents-API sync transport,
|
||||||
# also used by diet_guard; here for phone-workout GitHub sync (Workstream C)
|
# also used by diet_guard; here for phone-workout GitHub sync (Workstream C)
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.1.1#subdirectory=gatelock",
|
"gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.1.0#subdirectory=gatelock",
|
||||||
"crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.1.0#subdirectory=crdt-sync",
|
"crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.1.0#subdirectory=crdt-sync",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ bandit>=1.7.0
|
|||||||
codespell>=2.2.0
|
codespell>=2.2.0
|
||||||
coverage>=7.4.0
|
coverage>=7.4.0
|
||||||
crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.1.0#subdirectory=crdt-sync
|
crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.1.0#subdirectory=crdt-sync
|
||||||
gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.1.1#subdirectory=gatelock
|
gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.1.0#subdirectory=gatelock
|
||||||
mcp>=1.9
|
mcp>=1.9
|
||||||
mypy>=1.8.0
|
mypy>=1.8.0
|
||||||
pre-commit>=3.6.0
|
pre-commit>=3.6.0
|
||||||
|
|||||||
@ -5,17 +5,15 @@ from __future__ import annotations
|
|||||||
import logging
|
import logging
|
||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
|
|
||||||
from gatelock import LockConfig
|
|
||||||
|
|
||||||
from screen_locker._constants import HEAT_SKIP_CITY, HEAT_SKIP_TEMP_THRESHOLD
|
from screen_locker._constants import HEAT_SKIP_CITY, HEAT_SKIP_TEMP_THRESHOLD
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
# Sourced from the shared gatelock LockConfig (unified-design-system) instead
|
_BG = "#1a1a1a"
|
||||||
# of a locally-invented token block -- this was the one file in the package
|
_FG_MAIN = "#ff9900"
|
||||||
# that already knew centralizing tokens was worth doing; now it points at
|
_FG_SUB = "#cccccc"
|
||||||
# the actual shared source instead of its own unshared copy.
|
_BTN_SKIP = "#cc4400"
|
||||||
_COLORS = LockConfig()
|
_BTN_NO = "#333333"
|
||||||
_FONT = "monospace"
|
_FONT = "monospace"
|
||||||
|
|
||||||
|
|
||||||
@ -35,22 +33,22 @@ class HeatSkipMixin:
|
|||||||
# This window is destroyed before the main GateRoot is created.
|
# This window is destroyed before the main GateRoot is created.
|
||||||
root = tk.Tk()
|
root = tk.Tk()
|
||||||
root.title("Extreme Heat")
|
root.title("Extreme Heat")
|
||||||
root.configure(bg=_COLORS.bg)
|
root.configure(bg=_BG)
|
||||||
root.attributes("-fullscreen", True)
|
root.attributes("-fullscreen", True)
|
||||||
root.attributes("-topmost", True)
|
root.attributes("-topmost", True)
|
||||||
root.grab_set()
|
root.grab_set()
|
||||||
root.focus_force()
|
root.focus_force()
|
||||||
|
|
||||||
# Content centred on the fullscreen canvas
|
# Content centred on the fullscreen canvas
|
||||||
outer = tk.Frame(root, bg=_COLORS.bg)
|
outer = tk.Frame(root, bg=_BG)
|
||||||
outer.place(relx=0.5, rely=0.5, anchor="center")
|
outer.place(relx=0.5, rely=0.5, anchor="center")
|
||||||
|
|
||||||
tk.Label(
|
tk.Label(
|
||||||
outer,
|
outer,
|
||||||
text="☀ Too hot to workout?",
|
text="☀ Too hot to workout?",
|
||||||
font=(_FONT, 18, "bold"),
|
font=(_FONT, 18, "bold"),
|
||||||
bg=_COLORS.bg,
|
bg=_BG,
|
||||||
fg=_COLORS.warning,
|
fg=_FG_MAIN,
|
||||||
).pack(pady=(0, 10))
|
).pack(pady=(0, 10))
|
||||||
|
|
||||||
tk.Label(
|
tk.Label(
|
||||||
@ -59,20 +57,20 @@ class HeatSkipMixin:
|
|||||||
f"{HEAT_SKIP_CITY}: {temp:.0f}°C"
|
f"{HEAT_SKIP_CITY}: {temp:.0f}°C"
|
||||||
f" (threshold: {HEAT_SKIP_TEMP_THRESHOLD}°C)"
|
f" (threshold: {HEAT_SKIP_TEMP_THRESHOLD}°C)"
|
||||||
),
|
),
|
||||||
font=(_FONT, 16),
|
font=(_FONT, 13),
|
||||||
bg=_COLORS.bg,
|
bg=_BG,
|
||||||
fg=_COLORS.muted,
|
fg=_FG_SUB,
|
||||||
).pack(pady=6)
|
).pack(pady=6)
|
||||||
|
|
||||||
tk.Label(
|
tk.Label(
|
||||||
outer,
|
outer,
|
||||||
text="Skip today's workout due to extreme heat?",
|
text="Skip today's workout due to extreme heat?",
|
||||||
font=(_FONT, 16),
|
font=(_FONT, 12),
|
||||||
bg=_COLORS.bg,
|
bg=_BG,
|
||||||
fg=_COLORS.muted,
|
fg=_FG_SUB,
|
||||||
).pack(pady=(6, 0))
|
).pack(pady=(6, 0))
|
||||||
|
|
||||||
btn_frame = tk.Frame(outer, bg=_COLORS.bg)
|
btn_frame = tk.Frame(outer, bg=_BG)
|
||||||
btn_frame.pack(pady=28)
|
btn_frame.pack(pady=28)
|
||||||
|
|
||||||
def _on_skip() -> None:
|
def _on_skip() -> None:
|
||||||
@ -87,12 +85,12 @@ class HeatSkipMixin:
|
|||||||
btn_frame,
|
btn_frame,
|
||||||
text="Skip workout",
|
text="Skip workout",
|
||||||
command=_on_skip,
|
command=_on_skip,
|
||||||
bg=_COLORS.warning,
|
bg=_BTN_SKIP,
|
||||||
fg=_COLORS.on_fill,
|
fg="white",
|
||||||
activebackground=_COLORS.warning,
|
activebackground="#aa3300",
|
||||||
font=(_FONT, 14),
|
font=(_FONT, 11),
|
||||||
padx=16,
|
padx=14,
|
||||||
pady=8,
|
pady=5,
|
||||||
relief="flat",
|
relief="flat",
|
||||||
).pack(side="left", padx=12)
|
).pack(side="left", padx=12)
|
||||||
|
|
||||||
@ -100,12 +98,12 @@ class HeatSkipMixin:
|
|||||||
btn_frame,
|
btn_frame,
|
||||||
text="No, I'll workout",
|
text="No, I'll workout",
|
||||||
command=_on_no,
|
command=_on_no,
|
||||||
bg=_COLORS.field_bg,
|
bg=_BTN_NO,
|
||||||
fg=_COLORS.fg,
|
fg="white",
|
||||||
activebackground=_COLORS.field_bg,
|
activebackground="#444444",
|
||||||
font=(_FONT, 14),
|
font=(_FONT, 11),
|
||||||
padx=16,
|
padx=14,
|
||||||
pady=8,
|
pady=5,
|
||||||
relief="flat",
|
relief="flat",
|
||||||
).pack(side="left", padx=12)
|
).pack(side="left", padx=12)
|
||||||
|
|
||||||
|
|||||||
@ -39,28 +39,23 @@ class ManualWorkoutDialogMixin(ManualWorkoutFormWidgetsMixin):
|
|||||||
def _show_manual_workout_form(self) -> None:
|
def _show_manual_workout_form(self) -> None:
|
||||||
"""Render the manual-workout evidence form, or a budget-exhausted note."""
|
"""Render the manual-workout evidence form, or a budget-exhausted note."""
|
||||||
self.clear_container()
|
self.clear_container()
|
||||||
self._label("Log Manual Workout", color=self._colors.accent, pady=10)
|
self._label("Log Manual Workout", color="#0088cc", pady=10)
|
||||||
if _manual_workout.is_budget_exhausted(self.log_file):
|
if _manual_workout.is_budget_exhausted(self.log_file):
|
||||||
self._text(
|
self._text(
|
||||||
"Manual-workout budget exhausted for this window.",
|
"Manual-workout budget exhausted for this window.",
|
||||||
color=self._colors.danger,
|
color="#ff4444",
|
||||||
)
|
|
||||||
self._text(
|
|
||||||
_manual_workout.budget_summary(self.log_file),
|
|
||||||
color=self._colors.muted,
|
|
||||||
)
|
)
|
||||||
|
self._text(_manual_workout.budget_summary(self.log_file), color="#888888")
|
||||||
row = self._button_row()
|
row = self._button_row()
|
||||||
self._button(
|
self._button(
|
||||||
row,
|
row,
|
||||||
"BACK",
|
"BACK",
|
||||||
bg=self._colors.field_bg,
|
bg="#aa0000",
|
||||||
command=self._on_manual_workout_cancelled,
|
command=self._on_manual_workout_cancelled,
|
||||||
width=12,
|
width=12,
|
||||||
).pack(side="left", padx=10)
|
).pack(side="left", padx=10)
|
||||||
return
|
return
|
||||||
self._text(
|
self._text(_manual_workout.budget_summary(self.log_file), color="#88ccff")
|
||||||
_manual_workout.budget_summary(self.log_file), color=self._colors.accent
|
|
||||||
)
|
|
||||||
self._build_manual_workout_form()
|
self._build_manual_workout_form()
|
||||||
|
|
||||||
def _mw_scrollable_form(self) -> tk.Frame:
|
def _mw_scrollable_form(self) -> tk.Frame:
|
||||||
@ -72,11 +67,11 @@ class ManualWorkoutDialogMixin(ManualWorkoutFormWidgetsMixin):
|
|||||||
the inner form to the viewport so its two columns split the full width.
|
the inner form to the viewport so its two columns split the full width.
|
||||||
Harmless on StatusWindow, whose container already fills its window.
|
Harmless on StatusWindow, whose container already fills its window.
|
||||||
"""
|
"""
|
||||||
outer = tk.Frame(self.container, bg=self._colors.bg)
|
outer = tk.Frame(self.container, bg="#1a1a1a")
|
||||||
outer.pack(fill="both", expand=True, pady=10)
|
outer.pack(fill="both", expand=True, pady=10)
|
||||||
canvas = tk.Canvas(outer, bg=self._colors.bg, highlightthickness=0)
|
canvas = tk.Canvas(outer, bg="#1a1a1a", highlightthickness=0)
|
||||||
scrollbar = tk.Scrollbar(outer, orient="vertical", command=canvas.yview)
|
scrollbar = tk.Scrollbar(outer, orient="vertical", command=canvas.yview)
|
||||||
form = tk.Frame(canvas, bg=self._colors.bg)
|
form = tk.Frame(canvas, bg="#1a1a1a")
|
||||||
form.grid_columnconfigure(0, weight=1, uniform="mw")
|
form.grid_columnconfigure(0, weight=1, uniform="mw")
|
||||||
form.grid_columnconfigure(1, weight=1, uniform="mw")
|
form.grid_columnconfigure(1, weight=1, uniform="mw")
|
||||||
form.bind(
|
form.bind(
|
||||||
@ -134,8 +129,8 @@ class ManualWorkoutDialogMixin(ManualWorkoutFormWidgetsMixin):
|
|||||||
# Both sport sub-frames occupy the same full-width grid slot; only the
|
# Both sport sub-frames occupy the same full-width grid slot; only the
|
||||||
# selected one is shown (see _on_mw_sport_changed).
|
# selected one is shown (see _on_mw_sport_changed).
|
||||||
act_row = self._mw_next_full_row(form)
|
act_row = self._mw_next_full_row(form)
|
||||||
self._mw_tt_frame = tk.Frame(form, bg=self._colors.bg)
|
self._mw_tt_frame = tk.Frame(form, bg="#1a1a1a")
|
||||||
self._mw_other_frame = tk.Frame(form, bg=self._colors.bg)
|
self._mw_other_frame = tk.Frame(form, bg="#1a1a1a")
|
||||||
for sport_frame in (self._mw_tt_frame, self._mw_other_frame):
|
for sport_frame in (self._mw_tt_frame, self._mw_other_frame):
|
||||||
sport_frame.grid_columnconfigure(0, weight=1, uniform="mwact")
|
sport_frame.grid_columnconfigure(0, weight=1, uniform="mwact")
|
||||||
sport_frame.grid_columnconfigure(1, weight=1, uniform="mwact")
|
sport_frame.grid_columnconfigure(1, weight=1, uniform="mwact")
|
||||||
@ -173,19 +168,19 @@ class ManualWorkoutDialogMixin(ManualWorkoutFormWidgetsMixin):
|
|||||||
f"(min {MANUAL_WORKOUT_REFLECTION_MIN_CHARS} chars):",
|
f"(min {MANUAL_WORKOUT_REFLECTION_MIN_CHARS} chars):",
|
||||||
)
|
)
|
||||||
|
|
||||||
self._mw_error_label = self._text("", color=self._colors.danger, pady=8)
|
self._mw_error_label = self._text("", color="#ff4444", pady=5)
|
||||||
button_row = self._button_row()
|
button_row = self._button_row()
|
||||||
self._button(
|
self._button(
|
||||||
button_row,
|
button_row,
|
||||||
"SUBMIT",
|
"SUBMIT",
|
||||||
bg=self._colors.accent,
|
bg="#0066cc",
|
||||||
command=self._submit_manual_workout_form,
|
command=self._submit_manual_workout_form,
|
||||||
width=12,
|
width=12,
|
||||||
).pack(side="left", padx=10)
|
).pack(side="left", padx=10)
|
||||||
self._button(
|
self._button(
|
||||||
button_row,
|
button_row,
|
||||||
"BACK",
|
"BACK",
|
||||||
bg=self._colors.field_bg,
|
bg="#aa0000",
|
||||||
command=self._on_manual_workout_cancelled,
|
command=self._on_manual_workout_cancelled,
|
||||||
width=12,
|
width=12,
|
||||||
).pack(side="left", padx=10)
|
).pack(side="left", padx=10)
|
||||||
@ -195,13 +190,13 @@ class ManualWorkoutDialogMixin(ManualWorkoutFormWidgetsMixin):
|
|||||||
self._mw_sport_var = tk.StringVar(
|
self._mw_sport_var = tk.StringVar(
|
||||||
value=_manual_workout.SPORT_LABELS[_manual_workout.SPORT_TABLE_TENNIS]
|
value=_manual_workout.SPORT_LABELS[_manual_workout.SPORT_TABLE_TENNIS]
|
||||||
)
|
)
|
||||||
row = tk.Frame(parent, bg=self._colors.bg)
|
row = tk.Frame(parent, bg="#1a1a1a")
|
||||||
tk.Label(
|
tk.Label(
|
||||||
row,
|
row,
|
||||||
text="Sport:",
|
text="Sport:",
|
||||||
font=(self._colors.font_family, 16),
|
font=("Arial", 16),
|
||||||
fg=self._colors.fg,
|
fg="white",
|
||||||
bg=self._colors.bg,
|
bg="#1a1a1a",
|
||||||
).pack(side="left", padx=5)
|
).pack(side="left", padx=5)
|
||||||
tk.OptionMenu(
|
tk.OptionMenu(
|
||||||
row,
|
row,
|
||||||
|
|||||||
@ -44,7 +44,7 @@ class ManualWorkoutFormWidgetsMixin:
|
|||||||
columnspan=2 if full else 1,
|
columnspan=2 if full else 1,
|
||||||
sticky="ew",
|
sticky="ew",
|
||||||
padx=12,
|
padx=12,
|
||||||
pady=8,
|
pady=6,
|
||||||
)
|
)
|
||||||
counters[id(parent)] = idx + (2 if full else 1)
|
counters[id(parent)] = idx + (2 if full else 1)
|
||||||
|
|
||||||
@ -67,9 +67,9 @@ class ManualWorkoutFormWidgetsMixin:
|
|||||||
label = tk.Label(
|
label = tk.Label(
|
||||||
parent,
|
parent,
|
||||||
text=title,
|
text=title,
|
||||||
font=(self._colors.font_family, 20, "bold"),
|
font=("Arial", 20, "bold"),
|
||||||
fg=self._colors.accent,
|
fg="#88ccff",
|
||||||
bg=self._colors.bg,
|
bg="#1a1a1a",
|
||||||
anchor="w",
|
anchor="w",
|
||||||
)
|
)
|
||||||
self._mw_grid(parent, label, full=True)
|
self._mw_grid(parent, label, full=True)
|
||||||
@ -82,24 +82,24 @@ class ManualWorkoutFormWidgetsMixin:
|
|||||||
the two-column grid. Paste stays disabled via ``disable_paste``.
|
the two-column grid. Paste stays disabled via ``disable_paste``.
|
||||||
"""
|
"""
|
||||||
var = tk.StringVar()
|
var = tk.StringVar()
|
||||||
cell = tk.Frame(parent, bg=self._colors.bg)
|
cell = tk.Frame(parent, bg="#1a1a1a")
|
||||||
tk.Label(
|
tk.Label(
|
||||||
cell,
|
cell,
|
||||||
text=label,
|
text=label,
|
||||||
font=(self._colors.font_family, 16),
|
font=("Arial", 16),
|
||||||
fg=self._colors.fg,
|
fg="white",
|
||||||
bg=self._colors.bg,
|
bg="#1a1a1a",
|
||||||
anchor="w",
|
anchor="w",
|
||||||
).pack(fill="x")
|
).pack(fill="x")
|
||||||
entry = tk.Entry(
|
entry = tk.Entry(
|
||||||
cell,
|
cell,
|
||||||
textvariable=var,
|
textvariable=var,
|
||||||
font=(self._colors.font_family, 18),
|
font=("Arial", 18),
|
||||||
bg=self._colors.field_bg,
|
bg="#2a2a2a",
|
||||||
fg=self._colors.fg,
|
fg="white",
|
||||||
insertbackground=self._colors.fg,
|
insertbackground="white",
|
||||||
)
|
)
|
||||||
entry.pack(fill="x", pady=4)
|
entry.pack(fill="x", pady=2)
|
||||||
disable_paste(entry)
|
disable_paste(entry)
|
||||||
self._mw_grid(parent, cell)
|
self._mw_grid(parent, cell)
|
||||||
return var
|
return var
|
||||||
@ -109,13 +109,13 @@ class ManualWorkoutFormWidgetsMixin:
|
|||||||
) -> tk.IntVar:
|
) -> tk.IntVar:
|
||||||
"""Add a half-width label + numeric Spinbox and return its IntVar."""
|
"""Add a half-width label + numeric Spinbox and return its IntVar."""
|
||||||
var = tk.IntVar(value=0)
|
var = tk.IntVar(value=0)
|
||||||
row = tk.Frame(parent, bg=self._colors.bg)
|
row = tk.Frame(parent, bg="#1a1a1a")
|
||||||
tk.Label(
|
tk.Label(
|
||||||
row,
|
row,
|
||||||
text=label,
|
text=label,
|
||||||
font=(self._colors.font_family, 16),
|
font=("Arial", 16),
|
||||||
fg=self._colors.fg,
|
fg="white",
|
||||||
bg=self._colors.bg,
|
bg="#1a1a1a",
|
||||||
).pack(side="left", padx=5)
|
).pack(side="left", padx=5)
|
||||||
tk.Spinbox(
|
tk.Spinbox(
|
||||||
row,
|
row,
|
||||||
@ -123,47 +123,47 @@ class ManualWorkoutFormWidgetsMixin:
|
|||||||
to=to,
|
to=to,
|
||||||
textvariable=var,
|
textvariable=var,
|
||||||
width=4,
|
width=4,
|
||||||
font=(self._colors.font_family, 16),
|
font=("Arial", 16),
|
||||||
).pack(side="left", padx=5)
|
).pack(side="left", padx=5)
|
||||||
self._mw_grid(parent, row)
|
self._mw_grid(parent, row)
|
||||||
return var
|
return var
|
||||||
|
|
||||||
def _mw_textbox(self, parent: tk.Widget, label: str) -> tk.Text:
|
def _mw_textbox(self, parent: tk.Widget, label: str) -> tk.Text:
|
||||||
"""Add a full-width label + multi-line Text cell and return the widget."""
|
"""Add a full-width label + multi-line Text cell and return the widget."""
|
||||||
cell = tk.Frame(parent, bg=self._colors.bg)
|
cell = tk.Frame(parent, bg="#1a1a1a")
|
||||||
tk.Label(
|
tk.Label(
|
||||||
cell,
|
cell,
|
||||||
text=label,
|
text=label,
|
||||||
font=(self._colors.font_family, 16),
|
font=("Arial", 16),
|
||||||
fg=self._colors.fg,
|
fg="white",
|
||||||
bg=self._colors.bg,
|
bg="#1a1a1a",
|
||||||
anchor="w",
|
anchor="w",
|
||||||
).pack(fill="x", pady=(8, 0))
|
).pack(fill="x", pady=(5, 0))
|
||||||
text_widget = tk.Text(
|
text_widget = tk.Text(
|
||||||
cell,
|
cell,
|
||||||
height=3,
|
height=3,
|
||||||
font=(self._colors.font_family, 14),
|
font=("Arial", 14),
|
||||||
bg=self._colors.field_bg,
|
bg="#2a2a2a",
|
||||||
fg=self._colors.fg,
|
fg="white",
|
||||||
insertbackground=self._colors.fg,
|
insertbackground="white",
|
||||||
)
|
)
|
||||||
text_widget.pack(pady=4, fill="x")
|
text_widget.pack(pady=2, fill="x")
|
||||||
disable_paste(text_widget)
|
disable_paste(text_widget)
|
||||||
self._mw_grid(parent, cell, full=True)
|
self._mw_grid(parent, cell, full=True)
|
||||||
return text_widget
|
return text_widget
|
||||||
|
|
||||||
def _mw_rpe_row(self, parent: tk.Widget) -> None:
|
def _mw_rpe_row(self, parent: tk.Widget) -> None:
|
||||||
"""Add the RPE (rate of perceived exertion) spinbox row."""
|
"""Add the RPE (rate of perceived exertion) spinbox row."""
|
||||||
row = tk.Frame(parent, bg=self._colors.bg)
|
row = tk.Frame(parent, bg="#1a1a1a")
|
||||||
tk.Label(
|
tk.Label(
|
||||||
row,
|
row,
|
||||||
text=(
|
text=(
|
||||||
f"RPE — perceived exertion "
|
f"RPE — perceived exertion "
|
||||||
f"({MANUAL_WORKOUT_RPE_MIN}-{MANUAL_WORKOUT_RPE_MAX}):"
|
f"({MANUAL_WORKOUT_RPE_MIN}-{MANUAL_WORKOUT_RPE_MAX}):"
|
||||||
),
|
),
|
||||||
font=(self._colors.font_family, 16),
|
font=("Arial", 16),
|
||||||
fg=self._colors.fg,
|
fg="white",
|
||||||
bg=self._colors.bg,
|
bg="#1a1a1a",
|
||||||
).pack(side="left", padx=5)
|
).pack(side="left", padx=5)
|
||||||
tk.Spinbox(
|
tk.Spinbox(
|
||||||
row,
|
row,
|
||||||
@ -171,6 +171,6 @@ class ManualWorkoutFormWidgetsMixin:
|
|||||||
to=MANUAL_WORKOUT_RPE_MAX,
|
to=MANUAL_WORKOUT_RPE_MAX,
|
||||||
textvariable=self._mw_rpe_var,
|
textvariable=self._mw_rpe_var,
|
||||||
width=4,
|
width=4,
|
||||||
font=(self._colors.font_family, 16),
|
font=("Arial", 16),
|
||||||
).pack(side="left", padx=5)
|
).pack(side="left", padx=5)
|
||||||
self._mw_grid(parent, row)
|
self._mw_grid(parent, row)
|
||||||
|
|||||||
@ -34,34 +34,32 @@ class SickDialogMixin:
|
|||||||
history = _sick_tracker.load_history()
|
history = _sick_tracker.load_history()
|
||||||
self._sick_history_cache: SickHistory = history
|
self._sick_history_cache: SickHistory = history
|
||||||
self.clear_container()
|
self.clear_container()
|
||||||
self._label("Sick Day Request", color=self._colors.warning, pady=10)
|
self._label("Sick Day Request", color="#cc6600", pady=10)
|
||||||
self._text(_sick_tracker.budget_summary(history), color=self._colors.warning)
|
self._text(_sick_tracker.budget_summary(history), color="#ffaa00")
|
||||||
|
|
||||||
recent = _sick_tracker.format_recent_justifications(history)
|
recent = _sick_tracker.format_recent_justifications(history)
|
||||||
if recent:
|
if recent:
|
||||||
self._text(
|
self._text("Recent sick days:", font_size=14, color="#888888", pady=5)
|
||||||
"Recent sick days:", font_size=14, color=self._colors.muted, pady=8
|
self._text(recent, font_size=14, color="#cccccc", pady=5)
|
||||||
)
|
|
||||||
self._text(recent, font_size=14, color=self._colors.muted, pady=8)
|
|
||||||
|
|
||||||
had_commitment = _sick_tracker.had_commitment_for_today(history)
|
had_commitment = _sick_tracker.had_commitment_for_today(history)
|
||||||
if had_commitment:
|
if had_commitment:
|
||||||
self._text(
|
self._text(
|
||||||
"⚠ Yesterday you committed to working out today.",
|
"⚠ Yesterday you committed to working out today.",
|
||||||
font_size=18,
|
font_size=18,
|
||||||
color=self._colors.danger,
|
color="#ff6666",
|
||||||
)
|
)
|
||||||
self._text(
|
self._text(
|
||||||
"Breaking the commitment costs 2 sick-budget days.",
|
"Breaking the commitment costs 2 sick-budget days.",
|
||||||
font_size=14,
|
font_size=14,
|
||||||
color=self._colors.danger,
|
color="#ff6666",
|
||||||
)
|
)
|
||||||
|
|
||||||
self._build_justification_form(had_commitment=had_commitment)
|
self._build_justification_form(had_commitment=had_commitment)
|
||||||
|
|
||||||
def _build_justification_form(self, *, had_commitment: bool) -> None:
|
def _build_justification_form(self, *, had_commitment: bool) -> None:
|
||||||
"""Add justification form fields and submit button to the container."""
|
"""Add justification form fields and submit button to the container."""
|
||||||
form = tk.Frame(self.container, bg=self._colors.bg)
|
form = tk.Frame(self.container, bg="#1a1a1a")
|
||||||
form.pack(pady=10)
|
form.pack(pady=10)
|
||||||
|
|
||||||
self._sick_symptom_var = tk.StringVar()
|
self._sick_symptom_var = tk.StringVar()
|
||||||
@ -69,16 +67,13 @@ class SickDialogMixin:
|
|||||||
self._sick_severity_var = tk.IntVar(value=5)
|
self._sick_severity_var = tk.IntVar(value=5)
|
||||||
self._sick_text_widget = self._add_form_widgets(form)
|
self._sick_text_widget = self._add_form_widgets(form)
|
||||||
|
|
||||||
self._sick_error_label = self._text("", color=self._colors.danger, pady=8)
|
self._sick_error_label = self._text("", color="#ff4444", pady=5)
|
||||||
|
|
||||||
button_row = self._button_row()
|
button_row = self._button_row()
|
||||||
# Starts disabled during the forced-read delay -- field_bg (our
|
|
||||||
# neutral/secondary token) signals "not yet actionable" better than
|
|
||||||
# the accent used for an immediately-clickable submit.
|
|
||||||
self._sick_submit_button = self._button(
|
self._sick_submit_button = self._button(
|
||||||
button_row,
|
button_row,
|
||||||
"SUBMIT",
|
"SUBMIT",
|
||||||
bg=self._colors.field_bg,
|
bg="#666666",
|
||||||
command=self._submit_sick_justification,
|
command=self._submit_sick_justification,
|
||||||
width=12,
|
width=12,
|
||||||
)
|
)
|
||||||
@ -86,7 +81,7 @@ class SickDialogMixin:
|
|||||||
self._button(
|
self._button(
|
||||||
button_row,
|
button_row,
|
||||||
"BACK",
|
"BACK",
|
||||||
bg=self._colors.field_bg,
|
bg="#aa0000",
|
||||||
command=self._start_phone_check,
|
command=self._start_phone_check,
|
||||||
width=12,
|
width=12,
|
||||||
).pack(side="left", padx=10)
|
).pack(side="left", padx=10)
|
||||||
@ -108,14 +103,14 @@ class SickDialogMixin:
|
|||||||
label="When did it start? (e.g. last night):",
|
label="When did it start? (e.g. last night):",
|
||||||
variable=self._sick_onset_var,
|
variable=self._sick_onset_var,
|
||||||
)
|
)
|
||||||
sev_row = tk.Frame(parent, bg=self._colors.bg)
|
sev_row = tk.Frame(parent, bg="#1a1a1a")
|
||||||
sev_row.pack(pady=8)
|
sev_row.pack(pady=5)
|
||||||
tk.Label(
|
tk.Label(
|
||||||
sev_row,
|
sev_row,
|
||||||
text="Severity (1-10):",
|
text="Severity (1-10):",
|
||||||
font=(self._colors.font_family, 14),
|
font=("Arial", 14),
|
||||||
fg=self._colors.fg,
|
fg="white",
|
||||||
bg=self._colors.bg,
|
bg="#1a1a1a",
|
||||||
).pack(side="left", padx=5)
|
).pack(side="left", padx=5)
|
||||||
tk.Spinbox(
|
tk.Spinbox(
|
||||||
sev_row,
|
sev_row,
|
||||||
@ -123,26 +118,26 @@ class SickDialogMixin:
|
|||||||
to=10,
|
to=10,
|
||||||
textvariable=self._sick_severity_var,
|
textvariable=self._sick_severity_var,
|
||||||
width=4,
|
width=4,
|
||||||
font=(self._colors.font_family, 14),
|
font=("Arial", 14),
|
||||||
).pack(side="left", padx=5)
|
).pack(side="left", padx=5)
|
||||||
|
|
||||||
tk.Label(
|
tk.Label(
|
||||||
parent,
|
parent,
|
||||||
text=(f"Describe how you feel (min {SICK_JUSTIFICATION_MIN_CHARS} chars):"),
|
text=(f"Describe how you feel (min {SICK_JUSTIFICATION_MIN_CHARS} chars):"),
|
||||||
font=(self._colors.font_family, 14),
|
font=("Arial", 14),
|
||||||
fg=self._colors.fg,
|
fg="white",
|
||||||
bg=self._colors.bg,
|
bg="#1a1a1a",
|
||||||
).pack(pady=8)
|
).pack(pady=5)
|
||||||
text_widget = tk.Text(
|
text_widget = tk.Text(
|
||||||
parent,
|
parent,
|
||||||
width=60,
|
width=60,
|
||||||
height=6,
|
height=6,
|
||||||
font=(self._colors.font_family, 14),
|
font=("Arial", 12),
|
||||||
bg=self._colors.field_bg,
|
bg="#2a2a2a",
|
||||||
fg=self._colors.fg,
|
fg="white",
|
||||||
insertbackground=self._colors.fg,
|
insertbackground="white",
|
||||||
)
|
)
|
||||||
text_widget.pack(pady=8)
|
text_widget.pack(pady=5)
|
||||||
_disable_paste(text_widget)
|
_disable_paste(text_widget)
|
||||||
return text_widget
|
return text_widget
|
||||||
|
|
||||||
@ -204,35 +199,32 @@ class SickDialogMixin:
|
|||||||
self._label(
|
self._label(
|
||||||
"Commit to working out tomorrow?",
|
"Commit to working out tomorrow?",
|
||||||
font_size=32,
|
font_size=32,
|
||||||
color=self._colors.warning,
|
color="#ffaa00",
|
||||||
pady=20,
|
pady=20,
|
||||||
)
|
)
|
||||||
# ~80 chars at font_size 16 would render as one unbroken line past the
|
self._text(
|
||||||
# ~70-char readable range (rule 21) -- wrap it explicitly.
|
|
||||||
prompt = self._text(
|
|
||||||
"If you say YES and skip via 'I'm sick' tomorrow, "
|
"If you say YES and skip via 'I'm sick' tomorrow, "
|
||||||
"the sick day costs 2x normal.",
|
"the sick day costs 2x normal.",
|
||||||
font_size=16,
|
font_size=16,
|
||||||
)
|
)
|
||||||
prompt.config(wraplength=560, justify="center")
|
|
||||||
self._commitment_done_fn = on_done
|
self._commitment_done_fn = on_done
|
||||||
self._commitment_remaining = COMMITMENT_PROMPT_TIMEOUT_SECONDS
|
self._commitment_remaining = COMMITMENT_PROMPT_TIMEOUT_SECONDS
|
||||||
self._commitment_timer_label = self._text(
|
self._commitment_timer_label = self._text(
|
||||||
f"Auto-skipping in {COMMITMENT_PROMPT_TIMEOUT_SECONDS}s",
|
f"Auto-skipping in {COMMITMENT_PROMPT_TIMEOUT_SECONDS}s",
|
||||||
color=self._colors.muted,
|
color="#888888",
|
||||||
)
|
)
|
||||||
row = self._button_row()
|
row = self._button_row()
|
||||||
self._button(
|
self._button(
|
||||||
row,
|
row,
|
||||||
"YES",
|
"YES",
|
||||||
bg=self._colors.success,
|
bg="#00aa00",
|
||||||
command=lambda: self._answer_commitment(commit=True),
|
command=lambda: self._answer_commitment(commit=True),
|
||||||
width=12,
|
width=12,
|
||||||
).pack(side="left", padx=10)
|
).pack(side="left", padx=10)
|
||||||
self._button(
|
self._button(
|
||||||
row,
|
row,
|
||||||
"NO",
|
"NO",
|
||||||
bg=self._colors.field_bg,
|
bg="#aa0000",
|
||||||
command=lambda: self._answer_commitment(commit=False),
|
command=lambda: self._answer_commitment(commit=False),
|
||||||
width=12,
|
width=12,
|
||||||
).pack(side="left", padx=10)
|
).pack(side="left", padx=10)
|
||||||
|
|||||||
@ -40,23 +40,21 @@ class TemperatureStatusMixin:
|
|||||||
self._label("Warsaw Temperature", font_size=16, pady=8)
|
self._label("Warsaw Temperature", font_size=16, pady=8)
|
||||||
result = self._temp_result
|
result = self._temp_result
|
||||||
if result is None:
|
if result is None:
|
||||||
self._text(
|
self._text("Checking Warsaw temperature…", font_size=12, color="#888888")
|
||||||
"Checking Warsaw temperature…", font_size=12, color=self._colors.muted
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
if result.timed_out:
|
if result.timed_out:
|
||||||
self._text(
|
self._text(
|
||||||
f"Warsaw temperature check timed out after ~"
|
f"Warsaw temperature check timed out after ~"
|
||||||
f"{int(HARD_TIMEOUT_SECONDS)}s — network may be down.",
|
f"{int(HARD_TIMEOUT_SECONDS)}s — network may be down.",
|
||||||
font_size=12,
|
font_size=12,
|
||||||
color=self._colors.warning,
|
color="#ff8844",
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
if result.temp_celsius is None:
|
if result.temp_celsius is None:
|
||||||
self._text(
|
self._text(
|
||||||
"Warsaw temperature check failed (network/API error).",
|
"Warsaw temperature check failed (network/API error).",
|
||||||
font_size=12,
|
font_size=12,
|
||||||
color=self._colors.warning,
|
color="#ff8844",
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
hot = result.temp_celsius >= HEAT_SKIP_TEMP_THRESHOLD
|
hot = result.temp_celsius >= HEAT_SKIP_TEMP_THRESHOLD
|
||||||
@ -64,14 +62,10 @@ class TemperatureStatusMixin:
|
|||||||
f"Warsaw: {result.temp_celsius:.0f}°C (heat-skip threshold "
|
f"Warsaw: {result.temp_celsius:.0f}°C (heat-skip threshold "
|
||||||
f"{HEAT_SKIP_TEMP_THRESHOLD}°C)",
|
f"{HEAT_SKIP_TEMP_THRESHOLD}°C)",
|
||||||
font_size=12,
|
font_size=12,
|
||||||
color=self._colors.warning if hot else self._colors.muted,
|
color="#ff8844" if hot else "#cccccc",
|
||||||
)
|
)
|
||||||
if hot:
|
if hot:
|
||||||
self._text(
|
self._text("Would trigger heat-skip today.", font_size=11, color="#ff4444")
|
||||||
"Would trigger heat-skip today.",
|
|
||||||
font_size=11,
|
|
||||||
color=self._colors.danger,
|
|
||||||
)
|
|
||||||
|
|
||||||
def _start_temperature_check(self) -> None:
|
def _start_temperature_check(self) -> None:
|
||||||
"""Submit a background Warsaw-temperature fetch and start polling it.
|
"""Submit a background Warsaw-temperature fetch and start polling it.
|
||||||
|
|||||||
@ -22,9 +22,7 @@ class UIFlowsMixin:
|
|||||||
def _start_phone_check(self) -> None:
|
def _start_phone_check(self) -> None:
|
||||||
"""Check phone for today's workout immediately at startup."""
|
"""Check phone for today's workout immediately at startup."""
|
||||||
self.clear_container()
|
self.clear_container()
|
||||||
self._label(
|
self._label("Checking phone...", font_size=36, color="#ffaa00", pady=30)
|
||||||
"Checking phone...", font_size=36, color=self._colors.warning, pady=30
|
|
||||||
)
|
|
||||||
self._text("Looking for today's workout in StrongLifts...", font_size=18)
|
self._text("Looking for today's workout in StrongLifts...", font_size=18)
|
||||||
executor = ThreadPoolExecutor(max_workers=1)
|
executor = ThreadPoolExecutor(max_workers=1)
|
||||||
self._phone_future = executor.submit(self._verify_phone_workout)
|
self._phone_future = executor.submit(self._verify_phone_workout)
|
||||||
@ -42,46 +40,42 @@ class UIFlowsMixin:
|
|||||||
def _show_retry_and_sick(self, message: str) -> None:
|
def _show_retry_and_sick(self, message: str) -> None:
|
||||||
"""Show TRY AGAIN and (if budget allows) I'm sick after a failed check."""
|
"""Show TRY AGAIN and (if budget allows) I'm sick after a failed check."""
|
||||||
self.clear_container()
|
self.clear_container()
|
||||||
self._label(
|
self._label("No Workout Found", font_size=36, color="#ff4444", pady=20)
|
||||||
"No Workout Found", font_size=36, color=self._colors.danger, pady=20
|
self._text(message, color="#ffaa00")
|
||||||
)
|
|
||||||
self._text(message, color=self._colors.warning)
|
|
||||||
history = _sick_tracker.load_history()
|
history = _sick_tracker.load_history()
|
||||||
self._text(_sick_tracker.budget_summary(history), color=self._colors.muted)
|
self._text(_sick_tracker.budget_summary(history), color="#888888")
|
||||||
self._text(
|
self._text(_manual_workout.budget_summary(self.log_file), color="#888888")
|
||||||
_manual_workout.budget_summary(self.log_file), color=self._colors.muted
|
|
||||||
)
|
|
||||||
frame = self._button_row()
|
frame = self._button_row()
|
||||||
self._button(
|
self._button(
|
||||||
frame,
|
frame,
|
||||||
"TRY AGAIN",
|
"TRY AGAIN",
|
||||||
bg=self._colors.accent,
|
bg="#0066cc",
|
||||||
command=self._start_phone_check,
|
command=self._start_phone_check,
|
||||||
width=12,
|
width=12,
|
||||||
).pack(side="left", padx=10)
|
).pack(side="left", padx=10)
|
||||||
if _sick_tracker.is_budget_exhausted(history):
|
if _sick_tracker.is_budget_exhausted(history):
|
||||||
self._text(
|
self._text(
|
||||||
"Sick budget exhausted. No 'I'm sick' option available.",
|
"Sick budget exhausted. No 'I'm sick' option available.",
|
||||||
color=self._colors.danger,
|
color="#ff6666",
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self._button(
|
self._button(
|
||||||
frame,
|
frame,
|
||||||
"I'm sick",
|
"I'm sick",
|
||||||
bg=self._colors.warning,
|
bg="#cc6600",
|
||||||
command=self.ask_if_sick,
|
command=self.ask_if_sick,
|
||||||
width=12,
|
width=12,
|
||||||
).pack(side="left", padx=10)
|
).pack(side="left", padx=10)
|
||||||
if _manual_workout.is_budget_exhausted(self.log_file):
|
if _manual_workout.is_budget_exhausted(self.log_file):
|
||||||
self._text(
|
self._text(
|
||||||
"Manual-workout budget exhausted. No manual-log option available.",
|
"Manual-workout budget exhausted. No manual-log option available.",
|
||||||
color=self._colors.danger,
|
color="#ff6666",
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self._button(
|
self._button(
|
||||||
frame,
|
frame,
|
||||||
"Log Manual Workout",
|
"Log Manual Workout",
|
||||||
bg=self._colors.accent,
|
bg="#0088cc",
|
||||||
command=self._show_manual_workout_form,
|
command=self._show_manual_workout_form,
|
||||||
width=16,
|
width=16,
|
||||||
).pack(side="left", padx=10)
|
).pack(side="left", padx=10)
|
||||||
@ -90,14 +84,9 @@ class UIFlowsMixin:
|
|||||||
"""Show confirmation and unlock after a manual-workout entry is built."""
|
"""Show confirmation and unlock after a manual-workout entry is built."""
|
||||||
self.workout_data = entry
|
self.workout_data = entry
|
||||||
self.clear_container()
|
self.clear_container()
|
||||||
self._label(
|
self._label("✓ Manual Workout Logged!", font_size=42, color="#00cc44", pady=30)
|
||||||
"✓ Manual Workout Logged!",
|
self._text(entry.get("source", ""), font_size=20, color="#aaffaa")
|
||||||
font_size=42,
|
self._text("Unlocking...", font_size=18, color="#888888")
|
||||||
color=self._colors.success,
|
|
||||||
pady=30,
|
|
||||||
)
|
|
||||||
self._text(entry.get("source", ""), font_size=20, color=self._colors.success)
|
|
||||||
self._text("Unlocking...", font_size=18, color=self._colors.muted)
|
|
||||||
unlock_delay = 1500 if self.demo_mode else 2000
|
unlock_delay = 1500 if self.demo_mode else 2000
|
||||||
self.root.after(unlock_delay, self.unlock_screen)
|
self.root.after(unlock_delay, self.unlock_screen)
|
||||||
|
|
||||||
@ -111,14 +100,9 @@ class UIFlowsMixin:
|
|||||||
self.workout_data["type"] = "phone_verified"
|
self.workout_data["type"] = "phone_verified"
|
||||||
self.workout_data["source"] = message
|
self.workout_data["source"] = message
|
||||||
self.clear_container()
|
self.clear_container()
|
||||||
self._label(
|
self._label("✓ Workout Verified!", font_size=42, color="#00cc44", pady=30)
|
||||||
"✓ Workout Verified!",
|
self._text(message, font_size=20, color="#aaffaa")
|
||||||
font_size=42,
|
self._text("Unlocking...", font_size=18, color="#888888")
|
||||||
color=self._colors.success,
|
|
||||||
pady=30,
|
|
||||||
)
|
|
||||||
self._text(message, font_size=20, color=self._colors.success)
|
|
||||||
self._text("Unlocking...", font_size=18, color=self._colors.muted)
|
|
||||||
unlock_delay = 1500 if self.demo_mode else 2000
|
unlock_delay = 1500 if self.demo_mode else 2000
|
||||||
self.root.after(unlock_delay, self.unlock_screen)
|
self.root.after(unlock_delay, self.unlock_screen)
|
||||||
elif status == "too_short":
|
elif status == "too_short":
|
||||||
@ -154,9 +138,7 @@ class UIFlowsMixin:
|
|||||||
either unlocks (run verified) or calls ``on_failure``.
|
either unlocks (run verified) or calls ``on_failure``.
|
||||||
"""
|
"""
|
||||||
self.clear_container()
|
self.clear_container()
|
||||||
self._label(
|
self._label("Checking RunnerUp...", font_size=36, color="#ffaa00", pady=30)
|
||||||
"Checking RunnerUp...", font_size=36, color=self._colors.warning, pady=30
|
|
||||||
)
|
|
||||||
self._text("Looking for today's run in RunnerUp...", font_size=18)
|
self._text("Looking for today's run in RunnerUp...", font_size=18)
|
||||||
executor = ThreadPoolExecutor(max_workers=1)
|
executor = ThreadPoolExecutor(max_workers=1)
|
||||||
self._runnerup_future = executor.submit(self._verify_runnerup_workout)
|
self._runnerup_future = executor.submit(self._verify_runnerup_workout)
|
||||||
@ -172,14 +154,9 @@ class UIFlowsMixin:
|
|||||||
self.workout_data["type"] = "runnerup_verified"
|
self.workout_data["type"] = "runnerup_verified"
|
||||||
self.workout_data["source"] = message
|
self.workout_data["source"] = message
|
||||||
self.clear_container()
|
self.clear_container()
|
||||||
self._label(
|
self._label("✓ Run Verified!", font_size=42, color="#00cc44", pady=30)
|
||||||
"✓ Run Verified!",
|
self._text(message, font_size=20, color="#aaffaa")
|
||||||
font_size=42,
|
self._text("Unlocking...", font_size=18, color="#888888")
|
||||||
color=self._colors.success,
|
|
||||||
pady=30,
|
|
||||||
)
|
|
||||||
self._text(message, font_size=20, color=self._colors.success)
|
|
||||||
self._text("Unlocking...", font_size=18, color=self._colors.muted)
|
|
||||||
unlock_delay = 1500 if self.demo_mode else 2000
|
unlock_delay = 1500 if self.demo_mode else 2000
|
||||||
self.root.after(unlock_delay, self.unlock_screen)
|
self.root.after(unlock_delay, self.unlock_screen)
|
||||||
else:
|
else:
|
||||||
@ -194,15 +171,12 @@ class UIFlowsMixin:
|
|||||||
def _get_sick_day_status(self) -> tuple[str, str]:
|
def _get_sick_day_status(self) -> tuple[str, str]:
|
||||||
"""Determine sick day status text and color."""
|
"""Determine sick day status text and color."""
|
||||||
if self._sick_mode_used_today():
|
if self._sick_mode_used_today():
|
||||||
return "Shutdown time already adjusted today", self._colors.warning
|
return "Shutdown time already adjusted today", "#ffaa00"
|
||||||
if self._adjust_shutdown_time_earlier():
|
if self._adjust_shutdown_time_earlier():
|
||||||
return (
|
return (
|
||||||
"Shutdown time moved 1.5 hours earlier ✓\n(Will revert tomorrow)"
|
"Shutdown time moved 1.5 hours earlier ✓\n(Will revert tomorrow)"
|
||||||
), self._colors.success
|
), "#00aa00"
|
||||||
return (
|
return "Could not adjust shutdown time (check permissions)", "#ff4444"
|
||||||
"Could not adjust shutdown time (check permissions)",
|
|
||||||
self._colors.danger,
|
|
||||||
)
|
|
||||||
|
|
||||||
def _proceed_to_sick_countdown(self) -> None:
|
def _proceed_to_sick_countdown(self) -> None:
|
||||||
"""Start the (escalated) sick day countdown after justification."""
|
"""Start the (escalated) sick day countdown after justification."""
|
||||||
@ -228,7 +202,7 @@ class UIFlowsMixin:
|
|||||||
countdown: int,
|
countdown: int,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Display sick day UI labels and countdown."""
|
"""Display sick day UI labels and countdown."""
|
||||||
self._label("Sick Day Mode", color=self._colors.warning, pady=20)
|
self._label("Sick Day Mode", color="#cc6600", pady=20)
|
||||||
self._text(status_text, color=status_color)
|
self._text(status_text, color=status_color)
|
||||||
minutes = countdown // 60
|
minutes = countdown // 60
|
||||||
self._text(
|
self._text(
|
||||||
@ -276,7 +250,7 @@ class UIFlowsMixin:
|
|||||||
self.lockout_label = self._label(
|
self.lockout_label = self._label(
|
||||||
f"Go work out!\nLocked for {self.lockout_time} seconds",
|
f"Go work out!\nLocked for {self.lockout_time} seconds",
|
||||||
font_size=48,
|
font_size=48,
|
||||||
color=self._colors.danger,
|
color="#ff4444",
|
||||||
pady=30,
|
pady=30,
|
||||||
)
|
)
|
||||||
self.countdown_label = self._label(
|
self.countdown_label = self._label(
|
||||||
@ -324,10 +298,10 @@ class UIFlowsMixin:
|
|||||||
self._label(
|
self._label(
|
||||||
"Cannot Verify Workout",
|
"Cannot Verify Workout",
|
||||||
font_size=36,
|
font_size=36,
|
||||||
color=self._colors.warning,
|
color="#ff8800",
|
||||||
pady=20,
|
pady=20,
|
||||||
)
|
)
|
||||||
self._text(message, color=self._colors.warning)
|
self._text(message, color="#ffaa00")
|
||||||
self._text(
|
self._text(
|
||||||
"Connect phone via ADB to skip this wait,\n"
|
"Connect phone via ADB to skip this wait,\n"
|
||||||
"or wait for the penalty timer.\n\n"
|
"or wait for the penalty timer.\n\n"
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class UIFlowsRelaxedMixin:
|
|||||||
self._label(
|
self._label(
|
||||||
"Verifying Workout",
|
"Verifying Workout",
|
||||||
font_size=36,
|
font_size=36,
|
||||||
color=self._colors.warning,
|
color="#ffaa00",
|
||||||
pady=30,
|
pady=30,
|
||||||
)
|
)
|
||||||
self._text(
|
self._text(
|
||||||
@ -59,15 +59,15 @@ class UIFlowsRelaxedMixin:
|
|||||||
self._label(
|
self._label(
|
||||||
"✓ Workout Verified!",
|
"✓ Workout Verified!",
|
||||||
font_size=42,
|
font_size=42,
|
||||||
color=self._colors.success,
|
color="#00cc44",
|
||||||
pady=30,
|
pady=30,
|
||||||
)
|
)
|
||||||
self._text(message, font_size=20, color=self._colors.success)
|
self._text(message, font_size=20, color="#aaffaa")
|
||||||
if adjusted:
|
if adjusted:
|
||||||
self._text(
|
self._text(
|
||||||
"Shutdown time moved later!",
|
"Shutdown time moved later!",
|
||||||
font_size=20,
|
font_size=20,
|
||||||
color=self._colors.warning,
|
color="#ffaa00",
|
||||||
)
|
)
|
||||||
self.root.after(2000, self.close)
|
self.root.after(2000, self.close)
|
||||||
else:
|
else:
|
||||||
@ -79,22 +79,22 @@ class UIFlowsRelaxedMixin:
|
|||||||
self._label(
|
self._label(
|
||||||
"Workout Not Found",
|
"Workout Not Found",
|
||||||
font_size=36,
|
font_size=36,
|
||||||
color=self._colors.danger,
|
color="#ff4444",
|
||||||
pady=20,
|
pady=20,
|
||||||
)
|
)
|
||||||
self._text(message, color=self._colors.warning)
|
self._text(message, color="#ffaa00")
|
||||||
frame = self._button_row()
|
frame = self._button_row()
|
||||||
self._button(
|
self._button(
|
||||||
frame,
|
frame,
|
||||||
"TRY AGAIN",
|
"TRY AGAIN",
|
||||||
bg=self._colors.accent,
|
bg="#0066cc",
|
||||||
command=self._start_verify_workout_check,
|
command=self._start_verify_workout_check,
|
||||||
width=12,
|
width=12,
|
||||||
).pack(side="left", padx=10)
|
).pack(side="left", padx=10)
|
||||||
self._button(
|
self._button(
|
||||||
frame,
|
frame,
|
||||||
"Close",
|
"Close",
|
||||||
bg=self._colors.field_bg,
|
bg="#aa0000",
|
||||||
command=self.close,
|
command=self.close,
|
||||||
width=12,
|
width=12,
|
||||||
).pack(side="left", padx=10)
|
).pack(side="left", padx=10)
|
||||||
@ -114,28 +114,28 @@ class UIFlowsRelaxedMixin:
|
|||||||
self._label(
|
self._label(
|
||||||
"Optional Day (Tue / Wed / Thu)",
|
"Optional Day (Tue / Wed / Thu)",
|
||||||
font_size=30,
|
font_size=30,
|
||||||
color=self._colors.warning,
|
color="#ffaa00",
|
||||||
pady=20,
|
pady=20,
|
||||||
)
|
)
|
||||||
self._text(
|
self._text(
|
||||||
f"Weekly workouts: {count} / {WEEKLY_WORKOUT_MINIMUM}\n"
|
f"Weekly workouts: {count} / {WEEKLY_WORKOUT_MINIMUM}\n"
|
||||||
"No penalty for skipping today.",
|
"No penalty for skipping today.",
|
||||||
font_size=20,
|
font_size=20,
|
||||||
color=self._colors.muted,
|
color="#aaaaaa",
|
||||||
pady=10,
|
pady=10,
|
||||||
)
|
)
|
||||||
frame = self._button_row()
|
frame = self._button_row()
|
||||||
self._button(
|
self._button(
|
||||||
frame,
|
frame,
|
||||||
"Skip — No Penalty",
|
"Skip — No Penalty",
|
||||||
bg=self._colors.success,
|
bg="#006600",
|
||||||
command=self.close,
|
command=self.close,
|
||||||
width=18,
|
width=18,
|
||||||
).pack(side="left", padx=10)
|
).pack(side="left", padx=10)
|
||||||
self._button(
|
self._button(
|
||||||
frame,
|
frame,
|
||||||
"Log Stronglift Workout",
|
"Log Stronglift Workout",
|
||||||
bg=self._colors.accent,
|
bg="#0066cc",
|
||||||
command=self._start_relaxed_phone_check,
|
command=self._start_relaxed_phone_check,
|
||||||
width=20,
|
width=20,
|
||||||
).pack(side="left", padx=10)
|
).pack(side="left", padx=10)
|
||||||
@ -143,9 +143,7 @@ class UIFlowsRelaxedMixin:
|
|||||||
def _start_relaxed_phone_check(self) -> None:
|
def _start_relaxed_phone_check(self) -> None:
|
||||||
"""Run Stronglift check in relaxed mode (no screen grab, no sick option)."""
|
"""Run Stronglift check in relaxed mode (no screen grab, no sick option)."""
|
||||||
self.clear_container()
|
self.clear_container()
|
||||||
self._label(
|
self._label("Checking phone...", font_size=36, color="#ffaa00", pady=30)
|
||||||
"Checking phone...", font_size=36, color=self._colors.warning, pady=30
|
|
||||||
)
|
|
||||||
self._text("Looking for today's workout in StrongLifts...", font_size=18)
|
self._text("Looking for today's workout in StrongLifts...", font_size=18)
|
||||||
executor = ThreadPoolExecutor(max_workers=1)
|
executor = ThreadPoolExecutor(max_workers=1)
|
||||||
self._phone_future = executor.submit(self._verify_phone_workout)
|
self._phone_future = executor.submit(self._verify_phone_workout)
|
||||||
@ -177,22 +175,20 @@ class UIFlowsRelaxedMixin:
|
|||||||
def _show_relaxed_retry(self, message: str, status: str) -> None:
|
def _show_relaxed_retry(self, message: str, status: str) -> None:
|
||||||
"""Show retry and skip-close when workout not found in relaxed mode."""
|
"""Show retry and skip-close when workout not found in relaxed mode."""
|
||||||
self.clear_container()
|
self.clear_container()
|
||||||
self._label(
|
self._label("No Workout Found", font_size=36, color="#ff4444", pady=20)
|
||||||
"No Workout Found", font_size=36, color=self._colors.danger, pady=20
|
self._text(f"❌ {message}\n\nReason: {status}", color="#ffaa00")
|
||||||
)
|
|
||||||
self._text(f"❌ {message}\n\nReason: {status}", color=self._colors.warning)
|
|
||||||
frame = self._button_row()
|
frame = self._button_row()
|
||||||
self._button(
|
self._button(
|
||||||
frame,
|
frame,
|
||||||
"TRY AGAIN",
|
"TRY AGAIN",
|
||||||
bg=self._colors.accent,
|
bg="#0066cc",
|
||||||
command=self._start_relaxed_phone_check,
|
command=self._start_relaxed_phone_check,
|
||||||
width=12,
|
width=12,
|
||||||
).pack(side="left", padx=10)
|
).pack(side="left", padx=10)
|
||||||
self._button(
|
self._button(
|
||||||
frame,
|
frame,
|
||||||
"Close (Skip)",
|
"Close (Skip)",
|
||||||
bg=self._colors.success,
|
bg="#006600",
|
||||||
command=self.close,
|
command=self.close,
|
||||||
width=14,
|
width=14,
|
||||||
).pack(side="left", padx=10)
|
).pack(side="left", padx=10)
|
||||||
|
|||||||
@ -35,16 +35,16 @@ class UIWidgetsMixin:
|
|||||||
text: str,
|
text: str,
|
||||||
*,
|
*,
|
||||||
font_size: int = 36,
|
font_size: int = 36,
|
||||||
color: str | None = None,
|
color: str = "white",
|
||||||
pady: int = 20,
|
pady: int = 20,
|
||||||
) -> tk.Label:
|
) -> tk.Label:
|
||||||
"""Create and pack a bold label in the container."""
|
"""Create and pack a bold label in the container."""
|
||||||
label = tk.Label(
|
label = tk.Label(
|
||||||
self.container,
|
self.container,
|
||||||
text=text,
|
text=text,
|
||||||
font=(self._colors.font_family, font_size, "bold"),
|
font=("Arial", font_size, "bold"),
|
||||||
fg=color or self._colors.fg,
|
fg=color,
|
||||||
bg=self._colors.bg,
|
bg="#1a1a1a",
|
||||||
)
|
)
|
||||||
label.pack(pady=pady)
|
label.pack(pady=pady)
|
||||||
return label
|
return label
|
||||||
@ -54,38 +54,20 @@ class UIWidgetsMixin:
|
|||||||
text: str,
|
text: str,
|
||||||
*,
|
*,
|
||||||
font_size: int = 18,
|
font_size: int = 18,
|
||||||
color: str | None = None,
|
color: str = "white",
|
||||||
pady: int = 10,
|
pady: int = 10,
|
||||||
) -> tk.Label:
|
) -> tk.Label:
|
||||||
"""Create and pack a non-bold text label in the container."""
|
"""Create and pack a non-bold text label in the container."""
|
||||||
label = tk.Label(
|
label = tk.Label(
|
||||||
self.container,
|
self.container,
|
||||||
text=text,
|
text=text,
|
||||||
font=(self._colors.font_family, font_size),
|
font=("Arial", font_size),
|
||||||
fg=color or self._colors.fg,
|
fg=color,
|
||||||
bg=self._colors.bg,
|
bg="#1a1a1a",
|
||||||
)
|
)
|
||||||
label.pack(pady=pady)
|
label.pack(pady=pady)
|
||||||
return label
|
return label
|
||||||
|
|
||||||
def _fg_for(self, bg: str) -> str:
|
|
||||||
"""Return the correct label color for a widget with background `bg`.
|
|
||||||
|
|
||||||
The four filled semantic surfaces (accent/success/warning/danger)
|
|
||||||
all sit in the same mid-light lightness band, so `fg` (near-white,
|
|
||||||
meant for the neutral `bg`/`field_bg` surfaces) under-contrasts on
|
|
||||||
every one of them -- `on_fill` (dark) is required instead. Deriving
|
|
||||||
this from `bg` means a new filled-button call site can't reintroduce
|
|
||||||
the bug by omission.
|
|
||||||
"""
|
|
||||||
fills = {
|
|
||||||
self._colors.accent,
|
|
||||||
self._colors.success,
|
|
||||||
self._colors.warning,
|
|
||||||
self._colors.danger,
|
|
||||||
}
|
|
||||||
return self._colors.on_fill if bg in fills else self._colors.fg
|
|
||||||
|
|
||||||
def _button(
|
def _button(
|
||||||
self,
|
self,
|
||||||
parent: tk.Widget,
|
parent: tk.Widget,
|
||||||
@ -95,29 +77,21 @@ class UIWidgetsMixin:
|
|||||||
command: Callable[[], None],
|
command: Callable[[], None],
|
||||||
width: int = 10,
|
width: int = 10,
|
||||||
) -> tk.Button:
|
) -> tk.Button:
|
||||||
"""Create a styled button (caller must pack).
|
"""Create a styled button (caller must pack)."""
|
||||||
|
|
||||||
Padding follows the shared 2x horizontal:vertical ratio (rule 22);
|
|
||||||
`relief="flat"` is the one depth technique every button in the app
|
|
||||||
uses now (rule 27), matching what `_heat_skip.py` already did alone.
|
|
||||||
"""
|
|
||||||
return tk.Button(
|
return tk.Button(
|
||||||
parent,
|
parent,
|
||||||
text=text,
|
text=text,
|
||||||
font=(self._colors.font_family, 24, "bold"),
|
font=("Arial", 24, "bold"),
|
||||||
bg=bg,
|
bg=bg,
|
||||||
fg=self._fg_for(bg),
|
fg="white",
|
||||||
width=width,
|
width=width,
|
||||||
command=command,
|
command=command,
|
||||||
cursor="hand2" if self.demo_mode else "",
|
cursor="hand2" if self.demo_mode else "",
|
||||||
relief="flat",
|
|
||||||
padx=24,
|
|
||||||
pady=12,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def _button_row(self) -> tk.Frame:
|
def _button_row(self) -> tk.Frame:
|
||||||
"""Create and pack a horizontal button container."""
|
"""Create and pack a horizontal button container."""
|
||||||
frame = tk.Frame(self.container, bg=self._colors.bg)
|
frame = tk.Frame(self.container, bg="#1a1a1a")
|
||||||
frame.pack(pady=20)
|
frame.pack(pady=20)
|
||||||
return frame
|
return frame
|
||||||
|
|
||||||
@ -129,24 +103,24 @@ class UIWidgetsMixin:
|
|||||||
variable: tk.StringVar,
|
variable: tk.StringVar,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Add a label + single-line entry pair, with paste disabled."""
|
"""Add a label + single-line entry pair, with paste disabled."""
|
||||||
row = tk.Frame(parent, bg=self._colors.bg)
|
row = tk.Frame(parent, bg="#1a1a1a")
|
||||||
row.pack(pady=8, fill="x")
|
row.pack(pady=5, fill="x")
|
||||||
tk.Label(
|
tk.Label(
|
||||||
row,
|
row,
|
||||||
text=label,
|
text=label,
|
||||||
font=(self._colors.font_family, 14),
|
font=("Arial", 14),
|
||||||
fg=self._colors.fg,
|
fg="white",
|
||||||
bg=self._colors.bg,
|
bg="#1a1a1a",
|
||||||
anchor="w",
|
anchor="w",
|
||||||
).pack(side="top", anchor="w")
|
).pack(side="top", anchor="w")
|
||||||
entry = tk.Entry(
|
entry = tk.Entry(
|
||||||
row,
|
row,
|
||||||
textvariable=variable,
|
textvariable=variable,
|
||||||
width=50,
|
width=50,
|
||||||
font=(self._colors.font_family, 14),
|
font=("Arial", 14),
|
||||||
bg=self._colors.field_bg,
|
bg="#2a2a2a",
|
||||||
fg=self._colors.fg,
|
fg="white",
|
||||||
insertbackground=self._colors.fg,
|
insertbackground="white",
|
||||||
)
|
)
|
||||||
entry.pack(side="top", anchor="w", pady=4)
|
entry.pack(side="top", anchor="w", pady=2)
|
||||||
disable_paste(entry)
|
disable_paste(entry)
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class WindowSetupMixin:
|
|||||||
def _setup_verify_window(self) -> None:
|
def _setup_verify_window(self) -> None:
|
||||||
"""Configure window for post-sick-day workout verification."""
|
"""Configure window for post-sick-day workout verification."""
|
||||||
self.root.geometry("600x400")
|
self.root.geometry("600x400")
|
||||||
self.root.configure(bg=self._colors.bg, cursor="arrow")
|
self.root.configure(bg="#1a1a1a", cursor="arrow")
|
||||||
self.root.protocol("WM_DELETE_WINDOW", self.close)
|
self.root.protocol("WM_DELETE_WINDOW", self.close)
|
||||||
|
|
||||||
def _setup_demo_close_button(self) -> None:
|
def _setup_demo_close_button(self) -> None:
|
||||||
@ -35,9 +35,9 @@ class WindowSetupMixin:
|
|||||||
close_btn = tk.Button(
|
close_btn = tk.Button(
|
||||||
self.root,
|
self.root,
|
||||||
text="✕ Close Demo",
|
text="✕ Close Demo",
|
||||||
font=(self._colors.font_family, 12),
|
font=("Arial", 12),
|
||||||
bg=self._colors.danger,
|
bg="#ff4444",
|
||||||
fg=self._colors.on_fill,
|
fg="white",
|
||||||
command=self.close,
|
command=self.close,
|
||||||
cursor="hand2",
|
cursor="hand2",
|
||||||
)
|
)
|
||||||
@ -46,5 +46,5 @@ class WindowSetupMixin:
|
|||||||
def _setup_relaxed_day_window(self) -> None:
|
def _setup_relaxed_day_window(self) -> None:
|
||||||
"""Configure a small non-locking window for the optional Tue-Thu prompt."""
|
"""Configure a small non-locking window for the optional Tue-Thu prompt."""
|
||||||
self.root.geometry("700x450")
|
self.root.geometry("700x450")
|
||||||
self.root.configure(bg=self._colors.bg, cursor="arrow")
|
self.root.configure(bg="#1a1a1a", cursor="arrow")
|
||||||
self.root.protocol("WM_DELETE_WINDOW", self.close)
|
self.root.protocol("WM_DELETE_WINDOW", self.close)
|
||||||
|
|||||||
@ -140,25 +140,21 @@ class ScreenLocker(
|
|||||||
self.demo_mode = demo_mode
|
self.demo_mode = demo_mode
|
||||||
self.lockout_time = 10 if demo_mode else 1800
|
self.lockout_time = 10 if demo_mode else 1800
|
||||||
self._lock: LockWindow | None = None
|
self._lock: LockWindow | None = None
|
||||||
# One shared token source for every window/widget this app creates,
|
|
||||||
# lock or not -- see the `unified-design-system` skill. `mode`/`grab`/
|
|
||||||
# `disable_vt` only matter for the fullscreen lock window itself; the
|
|
||||||
# color/font fields apply everywhere, so this is built unconditionally.
|
|
||||||
self._colors = LockConfig(
|
|
||||||
mode="hard",
|
|
||||||
grab="local" if demo_mode else "global",
|
|
||||||
disable_vt=not demo_mode,
|
|
||||||
)
|
|
||||||
if verify_only:
|
if verify_only:
|
||||||
self._setup_verify_window()
|
self._setup_verify_window()
|
||||||
elif self._relaxed_day_mode:
|
elif self._relaxed_day_mode:
|
||||||
self._setup_relaxed_day_window()
|
self._setup_relaxed_day_window()
|
||||||
else:
|
else:
|
||||||
self._lock = LockWindow(self.root, self._colors, hooks=self)
|
config = LockConfig(
|
||||||
|
mode="hard",
|
||||||
|
grab="local" if demo_mode else "global",
|
||||||
|
disable_vt=not demo_mode,
|
||||||
|
)
|
||||||
|
self._lock = LockWindow(self.root, config, hooks=self)
|
||||||
self._lock.setup()
|
self._lock.setup()
|
||||||
if demo_mode:
|
if demo_mode:
|
||||||
self._setup_demo_close_button()
|
self._setup_demo_close_button()
|
||||||
self.container = tk.Frame(self.root, bg=self._colors.bg)
|
self.container = tk.Frame(self.root, bg="#1a1a1a")
|
||||||
self.container.place(relx=0.5, rely=0.5, anchor="center")
|
self.container.place(relx=0.5, rely=0.5, anchor="center")
|
||||||
self._phone_future: Future[tuple[str, str]] | None = None
|
self._phone_future: Future[tuple[str, str]] | None = None
|
||||||
self._runnerup_future: Future[tuple[str, str]] | None = None
|
self._runnerup_future: Future[tuple[str, str]] | None = None
|
||||||
@ -315,33 +311,31 @@ class ScreenLocker(
|
|||||||
credit = self._apply_workout_credit()
|
credit = self._apply_workout_credit()
|
||||||
|
|
||||||
self.clear_container()
|
self.clear_container()
|
||||||
self._label("Great job! 💪", font_size=48, color=self._colors.success, pady=30)
|
self._label("Great job! 💪", font_size=48, color="#00ff00", pady=30)
|
||||||
if credit.shutdown_adjusted:
|
if credit.shutdown_adjusted:
|
||||||
self._text(
|
self._text(
|
||||||
"Shutdown time +2h later! 🎁",
|
"Shutdown time +2h later! 🎁",
|
||||||
font_size=24,
|
font_size=24,
|
||||||
color=self._colors.warning,
|
color="#ffaa00",
|
||||||
)
|
)
|
||||||
if credit.extra_bonus_delta > 0:
|
if credit.extra_bonus_delta > 0:
|
||||||
self._text(
|
self._text(
|
||||||
f"Extra workout today! +{credit.extra_bonus_delta}h tonight",
|
f"Extra workout today! +{credit.extra_bonus_delta}h tonight",
|
||||||
font_size=20,
|
font_size=20,
|
||||||
color=self._colors.warning,
|
color="#ffaa00",
|
||||||
)
|
)
|
||||||
if credit.new_debt is not None:
|
if credit.new_debt is not None:
|
||||||
self._text(
|
self._text(
|
||||||
f"Workout debt: {credit.new_debt}",
|
f"Workout debt: {credit.new_debt}",
|
||||||
font_size=20,
|
font_size=20,
|
||||||
color=self._colors.warning
|
color="#ffaa00" if credit.new_debt > 0 else "#888888",
|
||||||
if credit.new_debt > 0
|
|
||||||
else self._colors.muted,
|
|
||||||
)
|
)
|
||||||
streak = current_streak(EXTRA_BENEFITS_FILE)
|
streak = current_streak(EXTRA_BENEFITS_FILE)
|
||||||
if streak >= 1:
|
if streak >= 1:
|
||||||
self._text(
|
self._text(
|
||||||
f"🔥 {streak}-week streak (5+ workouts each)",
|
f"🔥 {streak}-week streak (5+ workouts each)",
|
||||||
font_size=14,
|
font_size=14,
|
||||||
color=self._colors.muted,
|
color="#888888",
|
||||||
)
|
)
|
||||||
self._text("Screen Unlocked!", font_size=36, pady=20)
|
self._text("Screen Unlocked!", font_size=36, pady=20)
|
||||||
if self.workout_data.get("type") in (
|
if self.workout_data.get("type") in (
|
||||||
|
|||||||
@ -28,8 +28,6 @@ import sys
|
|||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from gatelock import LockConfig
|
|
||||||
|
|
||||||
from screen_locker import _manual_workout
|
from screen_locker import _manual_workout
|
||||||
from screen_locker._manual_workout_dialog import ManualWorkoutDialogMixin
|
from screen_locker._manual_workout_dialog import ManualWorkoutDialogMixin
|
||||||
from screen_locker._status_data import (
|
from screen_locker._status_data import (
|
||||||
@ -58,7 +56,6 @@ if TYPE_CHECKING:
|
|||||||
from screen_locker.screen_lock import ScreenLocker
|
from screen_locker.screen_lock import ScreenLocker
|
||||||
|
|
||||||
_DEFAULT_LOG_FILE = Path(__file__).resolve().parent / "workout_log.json"
|
_DEFAULT_LOG_FILE = Path(__file__).resolve().parent / "workout_log.json"
|
||||||
_STATUS_COLORS = LockConfig()
|
|
||||||
|
|
||||||
|
|
||||||
class StatusWindow(
|
class StatusWindow(
|
||||||
@ -99,8 +96,7 @@ class StatusWindow(
|
|||||||
self._temp_future: Future[TemperatureCheck] | None = None
|
self._temp_future: Future[TemperatureCheck] | None = None
|
||||||
self._temp_result: TemperatureCheck | None = None
|
self._temp_result: TemperatureCheck | None = None
|
||||||
self._last_snapshot = snapshot
|
self._last_snapshot = snapshot
|
||||||
self._colors = _STATUS_COLORS
|
self.container = tk.Frame(root, bg="#1a1a1a")
|
||||||
self.container = tk.Frame(root, bg=self._colors.bg)
|
|
||||||
self.container.pack(fill="both", expand=True)
|
self.container.pack(fill="both", expand=True)
|
||||||
self._start_temperature_check()
|
self._start_temperature_check()
|
||||||
self.render(snapshot)
|
self.render(snapshot)
|
||||||
@ -121,20 +117,15 @@ class StatusWindow(
|
|||||||
self._section_shutdown(self.container, snapshot.shutdown)
|
self._section_shutdown(self.container, snapshot.shutdown)
|
||||||
if self._phone_check_result is not None:
|
if self._phone_check_result is not None:
|
||||||
status, message = self._phone_check_result
|
status, message = self._phone_check_result
|
||||||
color = (
|
color = "#00cc44" if status == "verified" else "#ff8844"
|
||||||
self._colors.success if status == "verified" else self._colors.warning
|
self._text(f"Phone check ({status}): {message}", font_size=13, color=color)
|
||||||
)
|
|
||||||
self._text(f"Phone check ({status}): {message}", font_size=16, color=color)
|
|
||||||
if self._credit_message is not None:
|
if self._credit_message is not None:
|
||||||
self._text(self._credit_message, font_size=16, color=self._colors.success)
|
self._text(self._credit_message, font_size=13, color="#00cc44")
|
||||||
# "Check Phone"/"Log Manual Workout" are the primary write actions
|
|
||||||
# (accent, high contrast per rule 3); "Refresh"/"Close" are secondary
|
|
||||||
# utility actions (muted) -- two tiers instead of four arbitrary hues.
|
|
||||||
frame = self._button_row()
|
frame = self._button_row()
|
||||||
self._button(
|
self._button(
|
||||||
frame,
|
frame,
|
||||||
"Check Phone",
|
"Check Phone",
|
||||||
bg=self._colors.accent,
|
bg="#0066cc",
|
||||||
command=self._on_check_phone_clicked,
|
command=self._on_check_phone_clicked,
|
||||||
width=14,
|
width=14,
|
||||||
).pack(side="left", padx=8)
|
).pack(side="left", padx=8)
|
||||||
@ -142,23 +133,15 @@ class StatusWindow(
|
|||||||
self._button(
|
self._button(
|
||||||
frame,
|
frame,
|
||||||
"Log Manual Workout",
|
"Log Manual Workout",
|
||||||
bg=self._colors.accent,
|
bg="#0088cc",
|
||||||
command=self._show_manual_workout_form,
|
command=self._show_manual_workout_form,
|
||||||
width=16,
|
width=16,
|
||||||
).pack(side="left", padx=8)
|
).pack(side="left", padx=8)
|
||||||
self._button(
|
self._button(
|
||||||
frame,
|
frame, "Refresh", bg="#006600", command=self._on_refresh_clicked, width=10
|
||||||
"Refresh",
|
|
||||||
bg=self._colors.field_bg,
|
|
||||||
command=self._on_refresh_clicked,
|
|
||||||
width=10,
|
|
||||||
).pack(side="left", padx=8)
|
).pack(side="left", padx=8)
|
||||||
self._button(
|
self._button(
|
||||||
frame,
|
frame, "Close", bg="#aa0000", command=self.root.destroy, width=8
|
||||||
"Close",
|
|
||||||
bg=self._colors.field_bg,
|
|
||||||
command=self.root.destroy,
|
|
||||||
width=8,
|
|
||||||
).pack(side="left", padx=8)
|
).pack(side="left", padx=8)
|
||||||
|
|
||||||
def _section_today(self, parent: tk.Widget, day: DayStatus) -> None:
|
def _section_today(self, parent: tk.Widget, day: DayStatus) -> None:
|
||||||
@ -171,12 +154,10 @@ class StatusWindow(
|
|||||||
self._text(
|
self._text(
|
||||||
f"{mark} Today ({day.label}): {entry_str}",
|
f"{mark} Today ({day.label}): {entry_str}",
|
||||||
font_size=18,
|
font_size=18,
|
||||||
color=self._colors.success if day.counted else self._colors.warning,
|
color="#aaffaa" if day.counted else "#ffaa00",
|
||||||
)
|
)
|
||||||
if day.source:
|
if day.source:
|
||||||
# Secondary provenance note on an already-shown entry -- a
|
self._text(day.source, font_size=12, color="#888888", pady=2)
|
||||||
# deliberately caption-sized exception to the 16px floor.
|
|
||||||
self._text(day.source, font_size=12, color=self._colors.muted, pady=4)
|
|
||||||
|
|
||||||
def _section_week(self, parent: tk.Widget, week: WeeklySummary) -> None:
|
def _section_week(self, parent: tk.Widget, week: WeeklySummary) -> None:
|
||||||
"""Render this ISO week's per-day breakdown and totals."""
|
"""Render this ISO week's per-day breakdown and totals."""
|
||||||
@ -191,21 +172,17 @@ class StatusWindow(
|
|||||||
)
|
)
|
||||||
self._text(
|
self._text(
|
||||||
f"{mark} {day.label}: {entry_str}",
|
f"{mark} {day.label}: {entry_str}",
|
||||||
font_size=16,
|
font_size=12,
|
||||||
color=self._colors.muted,
|
color="#cccccc",
|
||||||
pady=4,
|
pady=1,
|
||||||
)
|
)
|
||||||
if week.remaining > 0:
|
if week.remaining > 0:
|
||||||
self._text(
|
self._text(
|
||||||
f"Need {week.remaining} more this week.",
|
f"Need {week.remaining} more this week.", font_size=13, color="#ffaa00"
|
||||||
font_size=16,
|
|
||||||
color=self._colors.warning,
|
|
||||||
)
|
)
|
||||||
elif week.extra > 0:
|
elif week.extra > 0:
|
||||||
self._text(
|
self._text(
|
||||||
f"{week.extra} above the weekly minimum!",
|
f"{week.extra} above the weekly minimum!", font_size=13, color="#00cc44"
|
||||||
font_size=16,
|
|
||||||
color=self._colors.success,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def _section_lock_explanation(
|
def _section_lock_explanation(
|
||||||
@ -215,15 +192,13 @@ class StatusWindow(
|
|||||||
del parent
|
del parent
|
||||||
self._label("Why the lock did/didn't fire", font_size=16, pady=8)
|
self._label("Why the lock did/didn't fire", font_size=16, pady=8)
|
||||||
self._text(
|
self._text(
|
||||||
expl.reason,
|
expl.reason, font_size=13, color="#ff4444" if expl.fired else "#00cc44"
|
||||||
font_size=16,
|
|
||||||
color=self._colors.danger if expl.fired else self._colors.success,
|
|
||||||
)
|
)
|
||||||
if expl.auto_upgrade.would_attempt:
|
if expl.auto_upgrade.would_attempt:
|
||||||
self._text(
|
self._text(
|
||||||
f"Pending auto-upgrade: {expl.auto_upgrade.reason}",
|
f"Pending auto-upgrade: {expl.auto_upgrade.reason}",
|
||||||
font_size=14,
|
font_size=11,
|
||||||
color=self._colors.warning,
|
color="#ffaa00",
|
||||||
)
|
)
|
||||||
|
|
||||||
def _section_sick_budget(self, parent: tk.Widget, sick: SickBudgetStatus) -> None:
|
def _section_sick_budget(self, parent: tk.Widget, sick: SickBudgetStatus) -> None:
|
||||||
@ -233,8 +208,8 @@ class StatusWindow(
|
|||||||
self._text(
|
self._text(
|
||||||
f"{sick.used_7d}/{sick.budget_7d} week · {sick.used_30d}/{sick.budget_30d} "
|
f"{sick.used_7d}/{sick.budget_7d} week · {sick.used_30d}/{sick.budget_30d} "
|
||||||
f"month · {sick.used_90d}/{sick.budget_90d} quarter · debt {sick.debt}",
|
f"month · {sick.used_90d}/{sick.budget_90d} quarter · debt {sick.debt}",
|
||||||
font_size=16,
|
font_size=12,
|
||||||
color=self._colors.danger if sick.exhausted else self._colors.muted,
|
color="#ff4444" if sick.exhausted else "#cccccc",
|
||||||
)
|
)
|
||||||
|
|
||||||
def _section_manual_workout_budget(
|
def _section_manual_workout_budget(
|
||||||
@ -246,8 +221,8 @@ class StatusWindow(
|
|||||||
self._text(
|
self._text(
|
||||||
f"{manual.used_7d}/{manual.budget_7d} week · "
|
f"{manual.used_7d}/{manual.budget_7d} week · "
|
||||||
f"{manual.used_30d}/{manual.budget_30d} month",
|
f"{manual.used_30d}/{manual.budget_30d} month",
|
||||||
font_size=16,
|
font_size=12,
|
||||||
color=self._colors.danger if manual.exhausted else self._colors.muted,
|
color="#ff4444" if manual.exhausted else "#cccccc",
|
||||||
)
|
)
|
||||||
|
|
||||||
def _section_shutdown(
|
def _section_shutdown(
|
||||||
@ -261,31 +236,23 @@ class StatusWindow(
|
|||||||
self._text(
|
self._text(
|
||||||
f"Live config — Mon-Wed {mon_wed_hour:02d}:00, "
|
f"Live config — Mon-Wed {mon_wed_hour:02d}:00, "
|
||||||
f"Thu-Sun {thu_sun_hour:02d}:00",
|
f"Thu-Sun {thu_sun_hour:02d}:00",
|
||||||
font_size=16,
|
font_size=12,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self._text(
|
self._text(
|
||||||
"Live shutdown config unavailable.",
|
"Live shutdown config unavailable.", font_size=12, color="#ff8844"
|
||||||
font_size=16,
|
|
||||||
color=self._colors.warning,
|
|
||||||
)
|
)
|
||||||
# Rest-of-week/next-week/explanation are speculative annotations, not
|
|
||||||
# the section's primary content -- a deliberate caption-sized
|
|
||||||
# exception to the 16px floor, all sharing one muted tone instead of
|
|
||||||
# three unrelated ad hoc grays.
|
|
||||||
rest_line = ", ".join(
|
rest_line = ", ".join(
|
||||||
f"{d.label} {d.hour:02d}:00" for d in shutdown.rest_of_week
|
f"{d.label} {d.hour:02d}:00" for d in shutdown.rest_of_week
|
||||||
)
|
)
|
||||||
self._text(f"Rest of week: {rest_line}", font_size=12, color=self._colors.muted)
|
self._text(f"Rest of week: {rest_line}", font_size=10, color="#cccccc")
|
||||||
next_line = ", ".join(
|
next_line = ", ".join(
|
||||||
f"{d.label} {d.hour:02d}:00" for d in shutdown.next_week_preview
|
f"{d.label} {d.hour:02d}:00" for d in shutdown.next_week_preview
|
||||||
)
|
)
|
||||||
self._text(
|
self._text(
|
||||||
f"Next week (speculative): {next_line}",
|
f"Next week (speculative): {next_line}", font_size=10, color="#888888"
|
||||||
font_size=12,
|
|
||||||
color=self._colors.muted,
|
|
||||||
)
|
)
|
||||||
self._text(shutdown.explanation, font_size=12, color=self._colors.muted)
|
self._text(shutdown.explanation, font_size=10, color="#666666")
|
||||||
|
|
||||||
def _on_refresh_clicked(self) -> None:
|
def _on_refresh_clicked(self) -> None:
|
||||||
"""Clear any stale phone-check/credit/temperature results, re-check both."""
|
"""Clear any stale phone-check/credit/temperature results, re-check both."""
|
||||||
@ -347,7 +314,7 @@ def main(argv: list[str] | None = None) -> None:
|
|||||||
|
|
||||||
root = tk.Tk()
|
root = tk.Tk()
|
||||||
root.title("Workout Status")
|
root.title("Workout Status")
|
||||||
root.configure(bg=_STATUS_COLORS.bg)
|
root.configure(bg="#1a1a1a")
|
||||||
root.minsize(560, 200)
|
root.minsize(560, 200)
|
||||||
|
|
||||||
def refresh() -> None:
|
def refresh() -> None:
|
||||||
|
|||||||
@ -26,25 +26,25 @@ class TestSectionManualWorkoutBudget:
|
|||||||
snap = _snapshot(
|
snap = _snapshot(
|
||||||
manual_workout_budget=_manual_workout_budget(used_7d=2, exhausted=True)
|
manual_workout_budget=_manual_workout_budget(used_7d=2, exhausted=True)
|
||||||
)
|
)
|
||||||
window = _make_window(mock_tk, snap)
|
_make_window(mock_tk, snap)
|
||||||
calls = [
|
calls = [
|
||||||
c
|
c
|
||||||
for c in mock_tk.Label.call_args_list
|
for c in mock_tk.Label.call_args_list
|
||||||
if "week" in c.kwargs.get("text", "")
|
if "week" in c.kwargs.get("text", "")
|
||||||
]
|
]
|
||||||
assert any(c.kwargs.get("fg") == window._colors.danger for c in calls)
|
assert any(c.kwargs.get("fg") == "#ff4444" for c in calls)
|
||||||
|
|
||||||
def test_not_exhausted_uses_normal_color(self, mock_tk: MagicMock) -> None:
|
def test_not_exhausted_uses_normal_color(self, mock_tk: MagicMock) -> None:
|
||||||
snap = _snapshot(
|
snap = _snapshot(
|
||||||
manual_workout_budget=_manual_workout_budget(used_7d=0, exhausted=False)
|
manual_workout_budget=_manual_workout_budget(used_7d=0, exhausted=False)
|
||||||
)
|
)
|
||||||
window = _make_window(mock_tk, snap)
|
_make_window(mock_tk, snap)
|
||||||
calls = [
|
calls = [
|
||||||
c
|
c
|
||||||
for c in mock_tk.Label.call_args_list
|
for c in mock_tk.Label.call_args_list
|
||||||
if "week" in c.kwargs.get("text", "")
|
if "week" in c.kwargs.get("text", "")
|
||||||
]
|
]
|
||||||
assert any(c.kwargs.get("fg") == window._colors.muted for c in calls)
|
assert any(c.kwargs.get("fg") == "#cccccc" for c in calls)
|
||||||
|
|
||||||
|
|
||||||
class TestManualWorkoutButtonVisibility:
|
class TestManualWorkoutButtonVisibility:
|
||||||
|
|||||||
@ -145,23 +145,23 @@ class TestSectionLockExplanation:
|
|||||||
class TestSectionSickBudget:
|
class TestSectionSickBudget:
|
||||||
def test_exhausted_uses_warning_color(self, mock_tk: MagicMock) -> None:
|
def test_exhausted_uses_warning_color(self, mock_tk: MagicMock) -> None:
|
||||||
snap = _snapshot(sick_budget=_sick_budget(used_7d=1, exhausted=True))
|
snap = _snapshot(sick_budget=_sick_budget(used_7d=1, exhausted=True))
|
||||||
window = _make_window(mock_tk, snap)
|
_make_window(mock_tk, snap)
|
||||||
calls = [
|
calls = [
|
||||||
c
|
c
|
||||||
for c in mock_tk.Label.call_args_list
|
for c in mock_tk.Label.call_args_list
|
||||||
if "week" in c.kwargs.get("text", "")
|
if "week" in c.kwargs.get("text", "")
|
||||||
]
|
]
|
||||||
assert any(c.kwargs.get("fg") == window._colors.danger for c in calls)
|
assert any(c.kwargs.get("fg") == "#ff4444" for c in calls)
|
||||||
|
|
||||||
def test_not_exhausted_uses_normal_color(self, mock_tk: MagicMock) -> None:
|
def test_not_exhausted_uses_normal_color(self, mock_tk: MagicMock) -> None:
|
||||||
snap = _snapshot(sick_budget=_sick_budget(used_7d=0, exhausted=False))
|
snap = _snapshot(sick_budget=_sick_budget(used_7d=0, exhausted=False))
|
||||||
window = _make_window(mock_tk, snap)
|
_make_window(mock_tk, snap)
|
||||||
calls = [
|
calls = [
|
||||||
c
|
c
|
||||||
for c in mock_tk.Label.call_args_list
|
for c in mock_tk.Label.call_args_list
|
||||||
if "week" in c.kwargs.get("text", "")
|
if "week" in c.kwargs.get("text", "")
|
||||||
]
|
]
|
||||||
assert any(c.kwargs.get("fg") == window._colors.muted for c in calls)
|
assert any(c.kwargs.get("fg") == "#cccccc" for c in calls)
|
||||||
|
|
||||||
|
|
||||||
class TestSectionShutdown:
|
class TestSectionShutdown:
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class TestPhoneCheckResultRendering:
|
|||||||
if "Phone check" in c.kwargs.get("text", "")
|
if "Phone check" in c.kwargs.get("text", "")
|
||||||
]
|
]
|
||||||
assert calls
|
assert calls
|
||||||
assert calls[-1].kwargs.get("fg") == window._colors.success
|
assert calls[-1].kwargs.get("fg") == "#00cc44"
|
||||||
|
|
||||||
def test_non_verified_result_shown_in_orange(self, mock_tk: MagicMock) -> None:
|
def test_non_verified_result_shown_in_orange(self, mock_tk: MagicMock) -> None:
|
||||||
window = _make_window(mock_tk, _snapshot())
|
window = _make_window(mock_tk, _snapshot())
|
||||||
@ -58,7 +58,7 @@ class TestPhoneCheckResultRendering:
|
|||||||
if "Phone check" in c.kwargs.get("text", "")
|
if "Phone check" in c.kwargs.get("text", "")
|
||||||
]
|
]
|
||||||
assert calls
|
assert calls
|
||||||
assert calls[-1].kwargs.get("fg") == window._colors.warning
|
assert calls[-1].kwargs.get("fg") == "#ff8844"
|
||||||
|
|
||||||
|
|
||||||
class TestButtons:
|
class TestButtons:
|
||||||
|
|||||||
@ -144,7 +144,7 @@ class TestGetSickDayStatus:
|
|||||||
)
|
)
|
||||||
text, color = locker._get_sick_day_status()
|
text, color = locker._get_sick_day_status()
|
||||||
assert "already adjusted" in text
|
assert "already adjusted" in text
|
||||||
assert color == locker._colors.warning
|
assert color == "#ffaa00"
|
||||||
|
|
||||||
def test_adjustment_success(
|
def test_adjustment_success(
|
||||||
self, mock_tk: MagicMock, mock_sys_exit: MagicMock, tmp_path: Path
|
self, mock_tk: MagicMock, mock_sys_exit: MagicMock, tmp_path: Path
|
||||||
@ -159,7 +159,7 @@ class TestGetSickDayStatus:
|
|||||||
)
|
)
|
||||||
text, color = locker._get_sick_day_status()
|
text, color = locker._get_sick_day_status()
|
||||||
assert "earlier" in text
|
assert "earlier" in text
|
||||||
assert color == locker._colors.success
|
assert color == "#00aa00"
|
||||||
|
|
||||||
def test_adjustment_failure(
|
def test_adjustment_failure(
|
||||||
self, mock_tk: MagicMock, mock_sys_exit: MagicMock, tmp_path: Path
|
self, mock_tk: MagicMock, mock_sys_exit: MagicMock, tmp_path: Path
|
||||||
@ -174,7 +174,7 @@ class TestGetSickDayStatus:
|
|||||||
)
|
)
|
||||||
text, color = locker._get_sick_day_status()
|
text, color = locker._get_sick_day_status()
|
||||||
assert "Could not adjust" in text
|
assert "Could not adjust" in text
|
||||||
assert color == locker._colors.danger
|
assert color == "#ff4444"
|
||||||
|
|
||||||
|
|
||||||
class TestShowRetryAndSick:
|
class TestShowRetryAndSick:
|
||||||
|
|||||||
@ -151,7 +151,7 @@ class TestSetupVerifyWindow:
|
|||||||
)
|
)
|
||||||
locker.root.geometry.assert_called_with("600x400")
|
locker.root.geometry.assert_called_with("600x400")
|
||||||
locker.root.configure.assert_called_with(
|
locker.root.configure.assert_called_with(
|
||||||
bg=locker._colors.bg,
|
bg="#1a1a1a",
|
||||||
cursor="arrow",
|
cursor="arrow",
|
||||||
)
|
)
|
||||||
locker.root.protocol.assert_called_with(
|
locker.root.protocol.assert_called_with(
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 1012 B After Width: | Height: | Size: 1016 B |
|
Before Width: | Height: | Size: 639 B After Width: | Height: | Size: 620 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="ic_launcher_background">#211D1B</color>
|
<color name="ic_launcher_background">#1B1D21</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
@ -1,6 +1,6 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
|
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
|
||||||
<rect width="1024" height="1024" fill="#211D1B"/>
|
<rect width="1024" height="1024" fill="#1B1D21"/>
|
||||||
<g fill="none" stroke="#B8862E" stroke-width="72" stroke-linecap="round" stroke-linejoin="round" transform="translate(0,0)">
|
<g fill="none" stroke="#FF4444" stroke-width="72" stroke-linecap="round" stroke-linejoin="round" transform="translate(0,0)">
|
||||||
<path d="M 268 512 L 756 512"/>
|
<path d="M 268 512 L 756 512"/>
|
||||||
<path d="M 364 356 L 364 668"/>
|
<path d="M 364 356 L 364 668"/>
|
||||||
<path d="M 660 356 L 660 668"/>
|
<path d="M 660 356 L 660 668"/>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 465 B After Width: | Height: | Size: 465 B |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.0 KiB |
@ -1,5 +1,5 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
|
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
|
||||||
<g fill="none" stroke="#B8862E" stroke-width="72" stroke-linecap="round" stroke-linejoin="round" transform="translate(0,0)">
|
<g fill="none" stroke="#FF4444" stroke-width="72" stroke-linecap="round" stroke-linejoin="round" transform="translate(0,0)">
|
||||||
<path d="M 268 512 L 756 512"/>
|
<path d="M 268 512 L 756 512"/>
|
||||||
<path d="M 364 356 L 364 668"/>
|
<path d="M 364 356 L 364 668"/>
|
||||||
<path d="M 660 356 L 660 668"/>
|
<path d="M 660 356 L 660 668"/>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 413 B After Width: | Height: | Size: 413 B |
@ -49,7 +49,7 @@ flutter_launcher_icons:
|
|||||||
android: true
|
android: true
|
||||||
ios: false
|
ios: false
|
||||||
image_path: "assets/icon/icon.png"
|
image_path: "assets/icon/icon.png"
|
||||||
adaptive_icon_background: "#211D1B"
|
adaptive_icon_background: "#1B1D21"
|
||||||
adaptive_icon_foreground: "assets/icon/icon_foreground.png"
|
adaptive_icon_foreground: "assets/icon/icon_foreground.png"
|
||||||
adaptive_icon_monochrome: "assets/icon/icon_monochrome.png"
|
adaptive_icon_monochrome: "assets/icon/icon_monochrome.png"
|
||||||
min_sdk_android: 21
|
min_sdk_android: 21
|
||||||
|
|||||||