mirror of
https://github.com/kuhyx/diet-guard.git
synced 2026-11-28 08:09:04 +01:00
Take gatelock 0.8.1: colour reads through LockConfig.palette
Some checks failed
dependency freshness / dependencies on newest stable (push) Has been cancelled
file-length / file length <= 250 lines (push) Has been cancelled
md-naming / markdown naming convention (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
Tests / test (push) Has been cancelled
release-apk / release (APK) (push) Has been cancelled
Some checks failed
dependency freshness / dependencies on newest stable (push) Has been cancelled
file-length / file length <= 250 lines (push) Has been cancelled
md-naming / markdown naming convention (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
Tests / test (push) Has been cancelled
release-apk / release (APK) (push) Has been cancelled
LockConfig's colours moved into a nested LockPalette record; every _COLORS.<colour> read follows. Nothing about the gate's behaviour changed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HHCbkJWXHjtTUaqvnHRAqA
This commit is contained in:
parent
b3aeb4f4b7
commit
3f6a9b0ebf
2
.github/workflows/release-apk.yml
vendored
2
.github/workflows/release-apk.yml
vendored
@ -50,7 +50,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
flutter-version: 3.47.3
|
flutter-version: 3.47.4
|
||||||
channel: stable
|
channel: stable
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
|
|||||||
@ -106,7 +106,7 @@ repos:
|
|||||||
# direct URLs for one distribution, so any pin that drifts from
|
# direct URLs for one distribution, so any pin that drifts from
|
||||||
# the manifest becomes an unresolvable hook environment rather
|
# the manifest becomes an unresolvable hook environment rather
|
||||||
# than merely an old one.
|
# than merely an old one.
|
||||||
- gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.7.3#subdirectory=gatelock
|
- gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.8.1#subdirectory=gatelock
|
||||||
- crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.1#subdirectory=crdt-sync
|
- crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.1#subdirectory=crdt-sync
|
||||||
- freedays @ git+https://github.com/kuhyx/utils@freedays-v0.2.0#subdirectory=freedays
|
- freedays @ git+https://github.com/kuhyx/utils@freedays-v0.2.0#subdirectory=freedays
|
||||||
- mcp>=2,<3
|
- mcp>=2,<3
|
||||||
|
|||||||
@ -203,10 +203,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: flutter_secure_storage
|
name: flutter_secure_storage
|
||||||
sha256: "4540927d8b37e6cc47aaa2d17b6035a2d49049e2797cb19d2bdd299bff602c67"
|
sha256: d87713a152ee2f255117bdbbf43da1dea1797e0551e499e0334f0c9dcfafddd2
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "11.1.0"
|
version: "11.1.1"
|
||||||
flutter_secure_storage_darwin:
|
flutter_secure_storage_darwin:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@ -2,7 +2,7 @@ name: diet_guard_app
|
|||||||
description: "Companion phone app for diet_guard: log meals on the go."
|
description: "Companion phone app for diet_guard: log meals on the go."
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 1.0.80+1
|
version: 1.0.81+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.12.2
|
sdk: ^3.12.2
|
||||||
@ -17,7 +17,7 @@ dependencies:
|
|||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
flutter_local_notifications: 22.3.0
|
flutter_local_notifications: 22.3.0
|
||||||
flutter_secure_storage: 11.1.0
|
flutter_secure_storage: 11.1.1
|
||||||
|
|
||||||
# One-tap sign-in for the sync account. App-side only: crdt_sync stays pure
|
# One-tap sign-in for the sync account. App-side only: crdt_sync stays pure
|
||||||
# Dart so it keeps working on Linux desktop and headless.
|
# Dart so it keeps working on Linux desktop and headless.
|
||||||
|
|||||||
@ -38,12 +38,12 @@ _COLORS = LockConfig()
|
|||||||
_NOT_LOGGED_FILL = BG
|
_NOT_LOGGED_FILL = BG
|
||||||
_NOT_LOGGED_OUTLINE = FG
|
_NOT_LOGGED_OUTLINE = FG
|
||||||
_STATUS_COLORS = {
|
_STATUS_COLORS = {
|
||||||
DayStatus.GREEN: _COLORS.success,
|
DayStatus.GREEN: _COLORS.palette.success,
|
||||||
DayStatus.YELLOW: _COLORS.warning,
|
DayStatus.YELLOW: _COLORS.palette.warning,
|
||||||
DayStatus.RED: _COLORS.danger,
|
DayStatus.RED: _COLORS.palette.danger,
|
||||||
}
|
}
|
||||||
_STATUS_TEXT_COLOR = _COLORS.on_fill
|
_STATUS_TEXT_COLOR = _COLORS.palette.on_fill
|
||||||
_MUTED = _COLORS.muted
|
_MUTED = _COLORS.palette.muted
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
|
|||||||
@ -33,7 +33,7 @@ def _spin_entry(row: tk.Frame, variable: tk.StringVar) -> tk.Entry:
|
|||||||
entry = tk.Entry(
|
entry = tk.Entry(
|
||||||
row,
|
row,
|
||||||
textvariable=variable,
|
textvariable=variable,
|
||||||
font=(_COLORS.font_family, BODY),
|
font=(_COLORS.typography.font_family, BODY),
|
||||||
width=_ENTRY_WIDTH,
|
width=_ENTRY_WIDTH,
|
||||||
bg=_FIELD_BG,
|
bg=_FIELD_BG,
|
||||||
fg=FG,
|
fg=FG,
|
||||||
@ -65,7 +65,7 @@ def build_schedule_row(
|
|||||||
tk.Label(
|
tk.Label(
|
||||||
row,
|
row,
|
||||||
text="Meals:",
|
text="Meals:",
|
||||||
font=(_COLORS.font_family, LABEL),
|
font=(_COLORS.typography.font_family, LABEL),
|
||||||
bg=BG,
|
bg=BG,
|
||||||
fg=FG,
|
fg=FG,
|
||||||
).pack(side="left")
|
).pack(side="left")
|
||||||
@ -73,7 +73,7 @@ def build_schedule_row(
|
|||||||
tk.Label(
|
tk.Label(
|
||||||
row,
|
row,
|
||||||
text="to",
|
text="to",
|
||||||
font=(_COLORS.font_family, LABEL),
|
font=(_COLORS.typography.font_family, LABEL),
|
||||||
bg=BG,
|
bg=BG,
|
||||||
fg=FG,
|
fg=FG,
|
||||||
).pack(side="left")
|
).pack(side="left")
|
||||||
@ -81,7 +81,7 @@ def build_schedule_row(
|
|||||||
tk.Label(
|
tk.Label(
|
||||||
row,
|
row,
|
||||||
text="x",
|
text="x",
|
||||||
font=(_COLORS.font_family, LABEL),
|
font=(_COLORS.typography.font_family, LABEL),
|
||||||
bg=BG,
|
bg=BG,
|
||||||
fg=FG,
|
fg=FG,
|
||||||
).pack(side="left")
|
).pack(side="left")
|
||||||
@ -94,14 +94,14 @@ def build_schedule_row(
|
|||||||
tk.Label(
|
tk.Label(
|
||||||
parent,
|
parent,
|
||||||
textvariable=vars_.schedule.times,
|
textvariable=vars_.schedule.times,
|
||||||
font=(_COLORS.font_family, LABEL),
|
font=(_COLORS.typography.font_family, LABEL),
|
||||||
bg=BG,
|
bg=BG,
|
||||||
fg=FG,
|
fg=FG,
|
||||||
).pack(pady=(0, XS))
|
).pack(pady=(0, XS))
|
||||||
status_label = tk.Label(
|
status_label = tk.Label(
|
||||||
parent,
|
parent,
|
||||||
textvariable=vars_.schedule.status,
|
textvariable=vars_.schedule.status,
|
||||||
font=(_COLORS.font_family, LABEL),
|
font=(_COLORS.typography.font_family, LABEL),
|
||||||
bg=BG,
|
bg=BG,
|
||||||
fg=FG,
|
fg=FG,
|
||||||
)
|
)
|
||||||
|
|||||||
@ -25,9 +25,9 @@ if TYPE_CHECKING:
|
|||||||
# used to be its own hardcoded copy of _gatelock_ui's private constants; now
|
# used to be its own hardcoded copy of _gatelock_ui's private constants; now
|
||||||
# it reads the same shared LockConfig() directly instead.
|
# it reads the same shared LockConfig() directly instead.
|
||||||
_COLORS = LockConfig()
|
_COLORS = LockConfig()
|
||||||
_MUTED = _COLORS.muted
|
_MUTED = _COLORS.palette.muted
|
||||||
_FIELD_BG = _COLORS.field_bg
|
_FIELD_BG = _COLORS.palette.field_bg
|
||||||
_ACCENT = _COLORS.accent
|
_ACCENT = _COLORS.palette.accent
|
||||||
|
|
||||||
# calendar.monthcalendar never returns more than 6 weeks for any month.
|
# calendar.monthcalendar never returns more than 6 weeks for any month.
|
||||||
_MONTH_ROWS = 6
|
_MONTH_ROWS = 6
|
||||||
|
|||||||
@ -75,5 +75,5 @@ def _style_notebook(root: tk.Misc) -> None:
|
|||||||
style.map(
|
style.map(
|
||||||
"TNotebook.Tab",
|
"TNotebook.Tab",
|
||||||
background=[("selected", _ACCENT)],
|
background=[("selected", _ACCENT)],
|
||||||
foreground=[("selected", _COLORS.on_fill)],
|
foreground=[("selected", _COLORS.palette.on_fill)],
|
||||||
)
|
)
|
||||||
|
|||||||
@ -60,14 +60,14 @@ def _build_budget_row(
|
|||||||
tk.Label(
|
tk.Label(
|
||||||
row,
|
row,
|
||||||
text="Daily budget (kcal):",
|
text="Daily budget (kcal):",
|
||||||
font=(_COLORS.font_family, LABEL),
|
font=(_COLORS.typography.font_family, LABEL),
|
||||||
bg=BG,
|
bg=BG,
|
||||||
fg=FG,
|
fg=FG,
|
||||||
).pack(side="left")
|
).pack(side="left")
|
||||||
entry = tk.Entry(
|
entry = tk.Entry(
|
||||||
row,
|
row,
|
||||||
textvariable=vars_.budget,
|
textvariable=vars_.budget,
|
||||||
font=(_COLORS.font_family, BODY),
|
font=(_COLORS.typography.font_family, BODY),
|
||||||
width=8,
|
width=8,
|
||||||
bg=_FIELD_BG,
|
bg=_FIELD_BG,
|
||||||
fg=FG,
|
fg=FG,
|
||||||
@ -87,7 +87,7 @@ def _build_budget_row(
|
|||||||
status_label = tk.Label(
|
status_label = tk.Label(
|
||||||
parent,
|
parent,
|
||||||
textvariable=vars_.budget_status,
|
textvariable=vars_.budget_status,
|
||||||
font=(_COLORS.font_family, LABEL),
|
font=(_COLORS.typography.font_family, LABEL),
|
||||||
bg=BG,
|
bg=BG,
|
||||||
fg=FG,
|
fg=FG,
|
||||||
)
|
)
|
||||||
@ -113,7 +113,7 @@ def _build_month_nav(
|
|||||||
tk.Label(
|
tk.Label(
|
||||||
row,
|
row,
|
||||||
textvariable=vars_.month_label,
|
textvariable=vars_.month_label,
|
||||||
font=(_COLORS.font_family, LABEL, "bold"),
|
font=(_COLORS.typography.font_family, LABEL, "bold"),
|
||||||
bg=BG,
|
bg=BG,
|
||||||
fg=FG,
|
fg=FG,
|
||||||
width=16,
|
width=16,
|
||||||
@ -136,7 +136,7 @@ def _build_grid(parent: tk.Frame) -> list[tk.Label]:
|
|||||||
tk.Label(
|
tk.Label(
|
||||||
weekday_row,
|
weekday_row,
|
||||||
text=label,
|
text=label,
|
||||||
font=(_COLORS.font_family, CAPTION, "bold"),
|
font=(_COLORS.typography.font_family, CAPTION, "bold"),
|
||||||
bg=BG,
|
bg=BG,
|
||||||
fg=_MUTED,
|
fg=_MUTED,
|
||||||
width=4,
|
width=4,
|
||||||
@ -150,7 +150,7 @@ def _build_grid(parent: tk.Frame) -> list[tk.Label]:
|
|||||||
cell = tk.Label(
|
cell = tk.Label(
|
||||||
grid_frame,
|
grid_frame,
|
||||||
text="",
|
text="",
|
||||||
font=(_COLORS.font_family, CAPTION),
|
font=(_COLORS.typography.font_family, CAPTION),
|
||||||
width=4,
|
width=4,
|
||||||
height=2,
|
height=2,
|
||||||
bg=BG,
|
bg=BG,
|
||||||
@ -173,7 +173,7 @@ def build_calendar_frame(
|
|||||||
tk.Label(
|
tk.Label(
|
||||||
frame,
|
frame,
|
||||||
text="📅 History",
|
text="📅 History",
|
||||||
font=(_COLORS.font_family, TITLE, "bold"),
|
font=(_COLORS.typography.font_family, TITLE, "bold"),
|
||||||
bg=BG,
|
bg=BG,
|
||||||
fg=_ACCENT,
|
fg=_ACCENT,
|
||||||
).pack(pady=(SM, 0))
|
).pack(pady=(SM, 0))
|
||||||
@ -200,21 +200,21 @@ def build_calendar_frame(
|
|||||||
tk.Label(
|
tk.Label(
|
||||||
frame,
|
frame,
|
||||||
textvariable=vars_.streaks,
|
textvariable=vars_.streaks,
|
||||||
font=(_COLORS.font_family, LABEL, "bold"),
|
font=(_COLORS.typography.font_family, LABEL, "bold"),
|
||||||
bg=BG,
|
bg=BG,
|
||||||
fg=FG,
|
fg=FG,
|
||||||
).pack(pady=(SM, 0))
|
).pack(pady=(SM, 0))
|
||||||
tk.Label(
|
tk.Label(
|
||||||
frame,
|
frame,
|
||||||
textvariable=vars_.ytd,
|
textvariable=vars_.ytd,
|
||||||
font=(_COLORS.font_family, CAPTION),
|
font=(_COLORS.typography.font_family, CAPTION),
|
||||||
bg=BG,
|
bg=BG,
|
||||||
fg=_MUTED,
|
fg=_MUTED,
|
||||||
).pack(pady=(XS, 0))
|
).pack(pady=(XS, 0))
|
||||||
tk.Label(
|
tk.Label(
|
||||||
frame,
|
frame,
|
||||||
textvariable=vars_.averages,
|
textvariable=vars_.averages,
|
||||||
font=(_COLORS.font_family, CAPTION),
|
font=(_COLORS.typography.font_family, CAPTION),
|
||||||
bg=BG,
|
bg=BG,
|
||||||
fg=_MUTED,
|
fg=_MUTED,
|
||||||
).pack(pady=(XS, SM))
|
).pack(pady=(XS, SM))
|
||||||
|
|||||||
@ -103,7 +103,7 @@ def build_suggestion_box(parent: tk.Frame) -> tk.Listbox:
|
|||||||
bg=_FIELD_BG,
|
bg=_FIELD_BG,
|
||||||
fg=FG,
|
fg=FG,
|
||||||
selectbackground=_ACCENT,
|
selectbackground=_ACCENT,
|
||||||
selectforeground=_COLORS.on_fill,
|
selectforeground=_COLORS.palette.on_fill,
|
||||||
activestyle="none",
|
activestyle="none",
|
||||||
# Was highlightthickness=0, which removed the focus ring entirely. The
|
# Was highlightthickness=0, which removed the focus ring entirely. The
|
||||||
# list *is* arrow-key navigable, so it was keyboard-usable with no
|
# list *is* arrow-key navigable, so it was keyboard-usable with no
|
||||||
|
|||||||
@ -44,13 +44,13 @@ from diet_guard._gatelock_ui_types import (
|
|||||||
# already import them by name; they now track LockConfig instead of a
|
# already import them by name; they now track LockConfig instead of a
|
||||||
# separate, driftable copy.
|
# separate, driftable copy.
|
||||||
_COLORS = LockConfig()
|
_COLORS = LockConfig()
|
||||||
BG = _COLORS.bg
|
BG = _COLORS.palette.bg
|
||||||
FG = _COLORS.fg
|
FG = _COLORS.palette.fg
|
||||||
ERR = _COLORS.danger
|
ERR = _COLORS.palette.danger
|
||||||
_ACCENT = _COLORS.accent
|
_ACCENT = _COLORS.palette.accent
|
||||||
_FIELD_BG = _COLORS.field_bg
|
_FIELD_BG = _COLORS.palette.field_bg
|
||||||
_MUTED = _COLORS.muted
|
_MUTED = _COLORS.palette.muted
|
||||||
_FONT = _COLORS.font_family
|
_FONT = _COLORS.typography.font_family
|
||||||
# Number of food-bank / staple / OFF suggestions shown in the picker list.
|
# Number of food-bank / staple / OFF suggestions shown in the picker list.
|
||||||
SUGGESTION_ROWS = 5
|
SUGGESTION_ROWS = 5
|
||||||
# Grams a label's macros are assumed to describe when the "per" field is blank.
|
# Grams a label's macros are assumed to describe when the "per" field is blank.
|
||||||
|
|||||||
@ -130,7 +130,7 @@ class TestFocusRingIsVisible:
|
|||||||
against ``bg`` the moment it took focus.
|
against ``bg`` the moment it took focus.
|
||||||
"""
|
"""
|
||||||
kwargs = _gatelock_ui._COLORS.focus_kwargs()
|
kwargs = _gatelock_ui._COLORS.focus_kwargs()
|
||||||
assert kwargs["highlightcolor"] == _gatelock_ui._COLORS.accent
|
assert kwargs["highlightcolor"] == _gatelock_ui._COLORS.palette.accent
|
||||||
assert kwargs["highlightcolor"] != "#000000"
|
assert kwargs["highlightcolor"] != "#000000"
|
||||||
assert int(kwargs["highlightthickness"]) > 0
|
assert int(kwargs["highlightthickness"]) > 0
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ version = "1.0.0"
|
|||||||
description = "Tkinter/systemd log-to-unlock meal gate with calorie/macro budget tracking"
|
description = "Tkinter/systemd log-to-unlock meal gate with calorie/macro budget tracking"
|
||||||
requires-python = ">=3.14"
|
requires-python = ">=3.14"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.7.3#subdirectory=gatelock",
|
"gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.8.1#subdirectory=gatelock",
|
||||||
"crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.1#subdirectory=crdt-sync",
|
"crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.1#subdirectory=crdt-sync",
|
||||||
"freedays @ git+https://github.com/kuhyx/utils@freedays-v0.2.0#subdirectory=freedays",
|
"freedays @ git+https://github.com/kuhyx/utils@freedays-v0.2.0#subdirectory=freedays",
|
||||||
"requests==2.34.2",
|
"requests==2.34.2",
|
||||||
|
|||||||
@ -5,7 +5,7 @@ codespell==2.4.3
|
|||||||
coverage==7.16.0
|
coverage==7.16.0
|
||||||
crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.1#subdirectory=crdt-sync
|
crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.1#subdirectory=crdt-sync
|
||||||
freedays @ git+https://github.com/kuhyx/utils@freedays-v0.2.0#subdirectory=freedays
|
freedays @ git+https://github.com/kuhyx/utils@freedays-v0.2.0#subdirectory=freedays
|
||||||
gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.7.3#subdirectory=gatelock
|
gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.8.1#subdirectory=gatelock
|
||||||
mcp==2.2.0
|
mcp==2.2.0
|
||||||
mypy==2.3.1
|
mypy==2.3.1
|
||||||
pre-commit==4.6.2
|
pre-commit==4.6.2
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user