screen-locker/screen_locker/_credit.py
Krzysztof kuhy Rudnicki 97b7e85bb2 Show kuhy credit logo on lock, app and web
The shared kuhy_credit logo (kuhyx/utils, kuhy-credit-v0.3.1) now sits
bottom-right on every lock surface, the aux windows, the status window
and the heat-skip prompt; at the end of the workout app's Settings;
and in the web dashboard footer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 09:32:42 +01:00

36 lines
1.3 KiB
Python

"""kuhy's shared credit logo on screen-locker's Tk windows.
kuhy, 2026-11-21: the logo goes "everywhere in every single app, desktop
program", lockers too (``kuhy_credit`` README, kuhyx/utils). The widget is
the shared ``kuhy_credit.tk.KuhyCredit``; this module only fixes where it
sits so every window puts it in the same corner. A click on its panel opens
the site in a browser tab, which stays behind the fullscreen lock until the
lock closes.
"""
from __future__ import annotations
from typing import TYPE_CHECKING
from kuhy_credit.tk import KuhyCredit
if TYPE_CHECKING:
import tkinter as tk
from gatelock import LockConfig
def place_credit(parent: tk.Misc, config: LockConfig) -> KuhyCredit:
"""Place the logo in ``parent``'s bottom-right corner, above its siblings.
``parent`` must be the toplevel (a lock surface or a plain window), never
a content frame a flow clears and repaints. Call it after the window's
full-size viewport exists: siblings stack in creation order, so the logo
lands above it. (``KuhyCredit.lift`` is a Canvas item raise, not a
window raise, so it cannot do this.)
"""
pad = config.space("xl")
credit = KuhyCredit(parent, theme="dark", size=config.type_px("display"))
credit.place(relx=1, rely=1, x=-pad, y=-pad, anchor="se")
return credit