2026-11-14 04:25:51 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
# view/menus/main_menu_view.py
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
2026-11-14 04:25:51 +00:00
|
|
|
import tkinter as tk
|
|
|
|
|
|
2026-11-15 22:06:29 +00:00
|
|
|
from games.solitaire.base.solitaire_theme import get_game_icon_photo
|
2026-11-14 04:25:51 +00:00
|
|
|
from models.database import Database
|
|
|
|
|
from resources.code_res.game_constants import (
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
BG_COLOR,
|
|
|
|
|
CAT_LUCK,
|
|
|
|
|
CAT_ONLINE,
|
|
|
|
|
FONT_COLOR_BODY_DEFAULT,
|
|
|
|
|
FONT_COLOR_BODY_MUTED,
|
|
|
|
|
FONT_COLOR_HEADING_SUB,
|
|
|
|
|
FONT_COLOR_STATUS_LOSS,
|
|
|
|
|
FONT_COLOR_TITLE_MAIN,
|
|
|
|
|
FONT_SIZE_BODY,
|
|
|
|
|
FONT_SIZE_HEADING,
|
|
|
|
|
FONT_SIZE_SMALL_MIN,
|
|
|
|
|
FONT_SIZE_TITLE_LG,
|
|
|
|
|
GAME_CATEGORIES,
|
|
|
|
|
SUBTLE_BORDER,
|
|
|
|
|
UI_ACCENT_AMETHYST,
|
2026-11-14 04:25:51 +00:00
|
|
|
)
|
|
|
|
|
from resources.code_res.i18n import t
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
from view.widgets.goth_dropdown import GothDropdown
|
2026-11-14 04:25:51 +00:00
|
|
|
from view.widgets.image_button import ImageButton
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MainMenuView:
|
|
|
|
|
def __init__(self, root_view):
|
|
|
|
|
self.root = root_view
|
|
|
|
|
self.ctrl = root_view.ctrl
|
|
|
|
|
self.assets = root_view.assets
|
|
|
|
|
self.sounds = root_view.ctrl.sounds
|
|
|
|
|
self.selected_category: str = CAT_LUCK
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
|
|
|
|
|
self._photo_refs: list = []
|
|
|
|
|
self._profile: dict = {}
|
|
|
|
|
self._available_games: list[dict] = []
|
|
|
|
|
self._devils_resume_only: bool = False
|
2026-11-14 04:25:51 +00:00
|
|
|
|
|
|
|
|
def show(
|
|
|
|
|
self,
|
|
|
|
|
profile: dict,
|
|
|
|
|
available_games: list[dict],
|
|
|
|
|
devils_resume_only: bool = False,
|
|
|
|
|
category: str | None = None,
|
|
|
|
|
):
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
GothDropdown.close_any_open_popup()
|
2026-11-14 04:25:51 +00:00
|
|
|
self.root.clear_window(apply_global_bg=True)
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
self._photo_refs.clear()
|
|
|
|
|
|
|
|
|
|
self._profile = profile
|
|
|
|
|
self._available_games = available_games
|
|
|
|
|
self._devils_resume_only = devils_resume_only
|
2026-11-14 04:25:51 +00:00
|
|
|
|
|
|
|
|
valid_cats = {c[0] for c in GAME_CATEGORIES}
|
|
|
|
|
if category in valid_cats:
|
|
|
|
|
self.selected_category = category
|
|
|
|
|
Database.save_setting("last_menu_category", category)
|
|
|
|
|
else:
|
|
|
|
|
saved_cat = Database.load_setting("last_menu_category", CAT_LUCK)
|
|
|
|
|
self.selected_category = saved_cat if saved_cat in valid_cats else CAT_LUCK
|
|
|
|
|
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
cv = self.root.bg_widget
|
|
|
|
|
if not isinstance(cv, tk.Canvas):
|
|
|
|
|
cv = tk.Canvas(self.root, bg=BG_COLOR, highlightthickness=0, bd=0)
|
|
|
|
|
cv.place(relx=0, rely=0, relwidth=1, relheight=1)
|
|
|
|
|
|
|
|
|
|
self._cv = cv
|
|
|
|
|
self._build_floating_buttons(cv)
|
|
|
|
|
cv.bind("<Configure>", self._on_canvas_layout, add="+")
|
|
|
|
|
|
|
|
|
|
self.root.update_idletasks()
|
|
|
|
|
w = max(800, cv.winfo_width())
|
|
|
|
|
h = max(600, cv.winfo_height())
|
|
|
|
|
self._draw_scene(w, h)
|
|
|
|
|
|
|
|
|
|
def _build_floating_buttons(self, cv: tk.Canvas):
|
|
|
|
|
btn_norm = self.assets.raw_btn_default
|
|
|
|
|
btn_purp = self.assets.raw_btn_purple
|
|
|
|
|
btn_fire = self.assets.raw_btn_fire or btn_purp
|
|
|
|
|
|
|
|
|
|
self._top_left_btns: list[tuple[ImageButton, int]] = []
|
|
|
|
|
if not self._devils_resume_only:
|
|
|
|
|
b_prof = ImageButton(
|
|
|
|
|
cv, t("btn_switch_profile"), btn_norm, btn_purp,
|
|
|
|
|
self.ctrl.logout_to_login, sound_mgr=self.sounds, width=124, height=34, style="amethyst"
|
|
|
|
|
)
|
|
|
|
|
self._top_left_btns.append((b_prof, b_prof.pixel_width))
|
|
|
|
|
|
|
|
|
|
b_stats = ImageButton(
|
|
|
|
|
cv, t("btn_stats"), btn_norm, btn_purp,
|
|
|
|
|
self.ctrl.show_statistics, sound_mgr=self.sounds, width=96, height=34, style="amethyst"
|
|
|
|
|
)
|
|
|
|
|
self._top_left_btns.append((b_stats, b_stats.pixel_width))
|
|
|
|
|
|
2026-11-22 03:26:44 +00:00
|
|
|
b_settings = ImageButton(
|
|
|
|
|
cv,
|
|
|
|
|
t("btn_settings"),
|
|
|
|
|
btn_norm,
|
|
|
|
|
btn_purp,
|
|
|
|
|
lambda: self.ctrl.show_settings(
|
|
|
|
|
on_back=lambda: self.show(
|
|
|
|
|
self.ctrl.active_profile or self._profile,
|
|
|
|
|
self._available_games,
|
|
|
|
|
devils_resume_only=self._devils_resume_only,
|
|
|
|
|
category=self.selected_category,
|
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
sound_mgr=self.sounds,
|
|
|
|
|
width=118,
|
|
|
|
|
height=34,
|
|
|
|
|
style="amethyst",
|
2026-11-14 04:25:51 +00:00
|
|
|
)
|
2026-11-22 03:26:44 +00:00
|
|
|
self._top_left_btns.append((b_settings, b_settings.pixel_width))
|
2026-11-14 04:25:51 +00:00
|
|
|
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
self._cat_btns: list[tuple[ImageButton, int]] = []
|
|
|
|
|
if not self._devils_resume_only:
|
|
|
|
|
for cat_id, title_key, _desc_key in GAME_CATEGORIES:
|
|
|
|
|
is_sel = (cat_id == self.selected_category)
|
|
|
|
|
pil_n = btn_fire if is_sel else btn_norm
|
|
|
|
|
pil_h = btn_fire if is_sel else btn_purp
|
|
|
|
|
b_style = "fire" if is_sel else "amethyst"
|
|
|
|
|
|
|
|
|
|
b_cat = ImageButton(
|
|
|
|
|
cv,
|
|
|
|
|
t(title_key),
|
|
|
|
|
pil_n,
|
|
|
|
|
pil_h,
|
|
|
|
|
lambda cid=cat_id: self.show(
|
|
|
|
|
self._profile, self._available_games, devils_resume_only=False, category=cid
|
|
|
|
|
),
|
|
|
|
|
sound_mgr=self.sounds,
|
|
|
|
|
width=142,
|
|
|
|
|
height=38,
|
|
|
|
|
style=b_style,
|
|
|
|
|
)
|
|
|
|
|
self._cat_btns.append((b_cat, b_cat.pixel_width))
|
|
|
|
|
|
|
|
|
|
def _on_canvas_layout(self, event):
|
|
|
|
|
if event.widget != self._cv:
|
|
|
|
|
return
|
|
|
|
|
w, h = max(1, event.width), max(1, event.height)
|
|
|
|
|
if w >= 100 and h >= 100:
|
|
|
|
|
self._draw_scene(w, h)
|
|
|
|
|
|
|
|
|
|
def _draw_scene(self, w: int, h: int):
|
|
|
|
|
cv = self._cv
|
|
|
|
|
cv.delete("ui_fg")
|
|
|
|
|
self._photo_refs.clear()
|
|
|
|
|
|
|
|
|
|
compact = (h < 800)
|
|
|
|
|
pad_x = max(112, int(w * 0.105))
|
|
|
|
|
top_y = max(72, int(h * 0.125))
|
|
|
|
|
|
|
|
|
|
# 1. Linke Menü-Buttons sauber innerhalb des Rahmens
|
|
|
|
|
cur_x = pad_x
|
|
|
|
|
for btn_wgt, bw in self._top_left_btns:
|
|
|
|
|
cv.create_window(cur_x, top_y, window=btn_wgt, anchor="w", tags=("ui_fg",))
|
|
|
|
|
cur_x += bw + 6
|
|
|
|
|
|
|
|
|
|
# 2. Seelen-Anzeige rechts oben
|
|
|
|
|
soul_photo = self.assets.get_goth_text_photo(
|
|
|
|
|
t("main_acc_soul_only", self._profile["name"]),
|
|
|
|
|
size_px=FONT_SIZE_BODY + 1,
|
|
|
|
|
color=FONT_COLOR_TITLE_MAIN,
|
|
|
|
|
align="center",
|
|
|
|
|
)
|
|
|
|
|
self._photo_refs.append(soul_photo)
|
|
|
|
|
soul_box_w = max(150, soul_photo.width() + 36)
|
|
|
|
|
soul_box_h = max(40, soul_photo.height() + 14)
|
|
|
|
|
soul_cx = w - pad_x - soul_box_w // 2
|
|
|
|
|
|
|
|
|
|
soul_frame = self.assets.get_box_photo("box_gold_small", (soul_box_w, soul_box_h))
|
|
|
|
|
if soul_frame:
|
|
|
|
|
self._photo_refs.append(soul_frame)
|
|
|
|
|
cv.create_image(soul_cx, top_y, image=soul_frame, anchor="center", tags=("ui_fg",))
|
|
|
|
|
cv.create_image(soul_cx, top_y, image=soul_photo, anchor="center", tags=("ui_fg",))
|
|
|
|
|
|
|
|
|
|
# 3. Titel-Banner klar rechts neben dem mittleren Rahmen-Ornament zentrieren!
|
|
|
|
|
# Das mittlere Dornen-Ornament von background_horizontal.jpg reicht bis ca. 56% der Breite;
|
|
|
|
|
# wir setzen das Banner daher gezielt mittig zwischen Ornament-Ende und Seelen-Box (~66% Breite).
|
|
|
|
|
banner_w = 230 if compact else 265
|
|
|
|
|
header_banner = self.assets.get_proportional_photo("title_main_header", self.assets.raw_title, banner_w)
|
|
|
|
|
ornament_right_edge = max(cur_x + 16, int(w * 0.565))
|
|
|
|
|
right_free = soul_cx - soul_box_w // 2 - 14
|
|
|
|
|
|
|
|
|
|
if header_banner and (right_free - ornament_right_edge) >= header_banner.width():
|
|
|
|
|
self._photo_refs.append(header_banner)
|
|
|
|
|
banner_cx = (ornament_right_edge + right_free) // 2
|
|
|
|
|
cv.create_image(banner_cx, top_y, image=header_banner, anchor="center", tags=("ui_fg",))
|
|
|
|
|
elif header_banner and (right_free - (cur_x + 12)) >= 170:
|
|
|
|
|
# Kompakt-Fallback für sehr schmale Fenster (< 1050px)
|
|
|
|
|
smaller = self.assets.get_proportional_photo("title_main_header_sm", self.assets.raw_title, 200)
|
|
|
|
|
if smaller:
|
|
|
|
|
self._photo_refs.append(smaller)
|
|
|
|
|
banner_cx = max(cur_x + 12 + smaller.width() // 2, right_free - smaller.width() // 2 - 8)
|
|
|
|
|
cv.create_image(banner_cx, top_y, image=smaller, anchor="center", tags=("ui_fg",))
|
|
|
|
|
elif not header_banner:
|
|
|
|
|
hdr_txt = self.assets.get_goth_text_photo(t("header_title"), FONT_SIZE_TITLE_LG - 4, FONT_COLOR_TITLE_MAIN)
|
|
|
|
|
self._photo_refs.append(hdr_txt)
|
|
|
|
|
cv.create_image((ornament_right_edge + right_free) // 2, top_y, image=hdr_txt, anchor="center", tags=("ui_fg",))
|
|
|
|
|
|
|
|
|
|
sep_y = top_y + (44 if compact else 52)
|
|
|
|
|
cv.create_line(pad_x, sep_y, w - pad_x, sep_y, fill=SUBTLE_BORDER, width=1, tags=("ui_fg",))
|
|
|
|
|
|
|
|
|
|
# 4. Devil's Deal Sperr-Ansicht
|
|
|
|
|
if self._devils_resume_only:
|
|
|
|
|
cy = (sep_y + h) // 2
|
|
|
|
|
pakt_frame = self.assets.get_box_photo("box_big", (600, 360))
|
|
|
|
|
if pakt_frame:
|
|
|
|
|
self._photo_refs.append(pakt_frame)
|
|
|
|
|
cv.create_image(w // 2, cy, image=pakt_frame, anchor="center", tags=("ui_fg",))
|
|
|
|
|
|
|
|
|
|
t_pakt = self.assets.get_goth_text_photo(
|
|
|
|
|
t("devils_deal_resume_title"), FONT_SIZE_TITLE_LG, FONT_COLOR_STATUS_LOSS
|
2026-11-14 21:47:38 +00:00
|
|
|
)
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
d_pakt = self.assets.get_goth_text_photo(
|
|
|
|
|
t("devils_deal_resume_desc"), FONT_SIZE_BODY, FONT_COLOR_BODY_DEFAULT, max_width=500
|
2026-11-14 04:25:51 +00:00
|
|
|
)
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
self._photo_refs.extend([t_pakt, d_pakt])
|
|
|
|
|
cv.create_image(w // 2, cy - 118, image=t_pakt, anchor="center", tags=("ui_fg",))
|
|
|
|
|
cv.create_image(w // 2, cy - 66, image=d_pakt, anchor="center", tags=("ui_fg",))
|
2026-11-14 04:25:51 +00:00
|
|
|
|
2026-11-15 22:06:29 +00:00
|
|
|
locked_folder = self.ctrl.get_locked_devils_game_folder() or ""
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
self._draw_framed_game_tile(
|
|
|
|
|
cv, w // 2, cy + 62,
|
|
|
|
|
tile_idx=0,
|
|
|
|
|
game_title=t("devils_deal_resume_card"),
|
|
|
|
|
rank_subtitle="",
|
|
|
|
|
on_click=self.ctrl.resume_devils_deal,
|
2026-11-15 22:06:29 +00:00
|
|
|
game_folder=locked_folder,
|
|
|
|
|
is_online=True,
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
compact=True,
|
2026-11-14 04:25:51 +00:00
|
|
|
)
|
|
|
|
|
return
|
|
|
|
|
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
# 5. Flache 4-Kategorien-Leiste
|
|
|
|
|
cat_y = sep_y + (28 if compact else 34)
|
|
|
|
|
total_tabs_w = sum(bw for _, bw in self._cat_btns) + max(0, len(self._cat_btns) - 1) * 10
|
|
|
|
|
tab_x = (w - total_tabs_w) // 2
|
|
|
|
|
for btn_wgt, bw in self._cat_btns:
|
|
|
|
|
cv.create_window(tab_x + bw // 2, cat_y, window=btn_wgt, anchor="center", tags=("ui_fg",))
|
|
|
|
|
tab_x += bw + 10
|
2026-11-14 04:25:51 +00:00
|
|
|
|
|
|
|
|
active_cat_title = ""
|
|
|
|
|
active_cat_desc = ""
|
|
|
|
|
for cat_id, title_key, desc_key in GAME_CATEGORIES:
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
if cat_id == self.selected_category:
|
|
|
|
|
active_cat_title = t(title_key)
|
2026-11-14 04:25:51 +00:00
|
|
|
active_cat_desc = t(desc_key)
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
break
|
2026-11-14 04:25:51 +00:00
|
|
|
|
|
|
|
|
is_online_tab = (self.selected_category == CAT_ONLINE)
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
desc_y = cat_y + (32 if compact else 38)
|
|
|
|
|
desc_photo = self.assets.get_goth_text_photo(
|
|
|
|
|
active_cat_desc,
|
|
|
|
|
size_px=FONT_SIZE_BODY,
|
|
|
|
|
color=FONT_COLOR_STATUS_LOSS if is_online_tab else FONT_COLOR_BODY_MUTED,
|
|
|
|
|
max_width=min(880, w - 2 * pad_x),
|
|
|
|
|
align="center",
|
|
|
|
|
)
|
|
|
|
|
self._photo_refs.append(desc_photo)
|
|
|
|
|
cv.create_image(w // 2, desc_y, image=desc_photo, anchor="center", tags=("ui_fg",))
|
2026-11-14 04:25:51 +00:00
|
|
|
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
# 6. Gerahmte Spiel-Kacheln mit Lupeneffekt beim Hover
|
|
|
|
|
filtered_games = [
|
|
|
|
|
g for g in self._available_games if g.get("category", CAT_LUCK) == self.selected_category
|
|
|
|
|
]
|
2026-11-14 04:25:51 +00:00
|
|
|
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
area_top = desc_y + 28
|
|
|
|
|
area_bot = h - max(56, int(h * 0.085))
|
|
|
|
|
mid_y = (area_top + area_bot) // 2
|
2026-11-14 04:25:51 +00:00
|
|
|
|
|
|
|
|
if not filtered_games:
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
empty_txt = self.assets.get_goth_text_photo(
|
|
|
|
|
t("no_games_in_category", active_cat_title),
|
|
|
|
|
size_px=FONT_SIZE_HEADING - 2,
|
|
|
|
|
color=FONT_COLOR_STATUS_LOSS if is_online_tab else FONT_COLOR_BODY_MUTED,
|
|
|
|
|
max_width=620,
|
2026-11-14 04:25:51 +00:00
|
|
|
)
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
self._photo_refs.append(empty_txt)
|
|
|
|
|
eb_w, eb_h = empty_txt.width() + 68, empty_txt.height() + 44
|
|
|
|
|
eb_frame = self.assets.get_box_photo("box_purple", (eb_w, eb_h))
|
|
|
|
|
if eb_frame:
|
|
|
|
|
self._photo_refs.append(eb_frame)
|
|
|
|
|
cv.create_image(w // 2, mid_y, image=eb_frame, anchor="center", tags=("ui_fg",))
|
|
|
|
|
cv.create_image(w // 2, mid_y, image=empty_txt, anchor="center", tags=("ui_fg",))
|
|
|
|
|
return
|
2026-11-14 04:25:51 +00:00
|
|
|
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
cols = min(4, len(filtered_games))
|
|
|
|
|
rows = (len(filtered_games) + cols - 1) // cols
|
|
|
|
|
tight = compact or rows > 1
|
|
|
|
|
|
|
|
|
|
col_step = min(248, max(195, (w - 2 * pad_x) // max(1, cols)))
|
|
|
|
|
row_step = 236 if tight else 268
|
|
|
|
|
start_y = mid_y - ((rows - 1) * row_step) // 2
|
|
|
|
|
|
|
|
|
|
for idx, game in enumerate(filtered_games):
|
|
|
|
|
r, c = idx // 4, idx % 4
|
|
|
|
|
in_row = min(4, len(filtered_games) - r * 4)
|
|
|
|
|
cx = (w // 2) - ((in_row - 1) * col_step) // 2 + c * col_step
|
|
|
|
|
cy = start_y + r * row_step
|
|
|
|
|
|
|
|
|
|
prog = game.get("progress")
|
|
|
|
|
sub_txt = t("menu_card_rank_sub", prog["title"], prog["level"]) if prog else ""
|
|
|
|
|
|
|
|
|
|
self._draw_framed_game_tile(
|
|
|
|
|
cv, cx, cy,
|
|
|
|
|
tile_idx=idx,
|
|
|
|
|
game_title=game["title"],
|
|
|
|
|
rank_subtitle=sub_txt,
|
|
|
|
|
on_click=lambda g=game: self.ctrl.launch_game(g),
|
|
|
|
|
game_folder=game.get("folder", ""),
|
|
|
|
|
is_online=is_online_tab,
|
|
|
|
|
compact=tight,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
def _draw_framed_game_tile(
|
2026-11-15 22:06:29 +00:00
|
|
|
self,
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
cv: tk.Canvas,
|
|
|
|
|
cx: int,
|
|
|
|
|
cy: int,
|
|
|
|
|
tile_idx: int,
|
2026-11-15 22:06:29 +00:00
|
|
|
game_title: str,
|
|
|
|
|
rank_subtitle: str,
|
|
|
|
|
on_click,
|
|
|
|
|
game_folder: str = "",
|
|
|
|
|
is_online: bool = False,
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
compact: bool = False,
|
|
|
|
|
):
|
|
|
|
|
"""
|
|
|
|
|
Zeichnet eine Spiel-Auswahlkachel mit transparentem Zierrahmen (ohne Trennlinie)
|
|
|
|
|
und echtem Lupeneffekt beim Hover (Rahmen + Icon + Titel + Rang wachsen synchron!).
|
|
|
|
|
"""
|
|
|
|
|
hit_tag = f"tile_hit_{tile_idx}"
|
|
|
|
|
tags = ("ui_fg", hit_tag)
|
2026-11-14 04:25:51 +00:00
|
|
|
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
# Normal- vs. Lupen-Maße (ca. +9% Vergrößerung beim Hover)
|
|
|
|
|
card_w_n = 186 if compact else 204
|
|
|
|
|
card_h_n = 216 if compact else 242
|
|
|
|
|
card_w_h = card_w_n + 16
|
|
|
|
|
card_h_h = card_h_n + 18
|
2026-11-14 04:25:51 +00:00
|
|
|
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
frame_norm = self.assets.get_box_photo("box_purple", (card_w_n, card_h_n))
|
|
|
|
|
frame_hov = self.assets.get_box_photo("box_gold_small", (card_w_h, card_h_h))
|
|
|
|
|
if frame_norm:
|
|
|
|
|
self._photo_refs.append(frame_norm)
|
|
|
|
|
if frame_hov:
|
|
|
|
|
self._photo_refs.append(frame_hov)
|
|
|
|
|
|
|
|
|
|
base_px = 92 if compact else 104
|
|
|
|
|
hover_px = base_px + 12
|
|
|
|
|
|
|
|
|
|
icon_norm = get_game_icon_photo(self.assets.res, game_folder, size_px=base_px) if game_folder else None
|
|
|
|
|
icon_hov = get_game_icon_photo(self.assets.res, game_folder, size_px=hover_px) if game_folder else None
|
|
|
|
|
|
|
|
|
|
title_px_n = (FONT_SIZE_HEADING - 3) if compact else (FONT_SIZE_HEADING - 1)
|
|
|
|
|
title_px_h = title_px_n + 3
|
|
|
|
|
title_norm = self.assets.get_goth_text_photo(
|
|
|
|
|
game_title, size_px=title_px_n, color=FONT_COLOR_BODY_DEFAULT, max_width=card_w_n - 26
|
2026-11-14 04:25:51 +00:00
|
|
|
)
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
title_hov = self.assets.get_goth_text_photo(
|
|
|
|
|
game_title, size_px=title_px_h, color=FONT_COLOR_TITLE_MAIN, max_width=card_w_h - 24
|
2026-11-14 04:25:51 +00:00
|
|
|
)
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
self._photo_refs.extend([title_norm, title_hov])
|
2026-11-15 22:06:29 +00:00
|
|
|
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
# Vertikale Positionen (Normal vs. leicht aufgefächert im Lupen-Zustand, ohne Trennlinie!)
|
|
|
|
|
if rank_subtitle:
|
|
|
|
|
icon_y_n = cy - (38 if compact else 44)
|
|
|
|
|
icon_y_h = icon_y_n - 3
|
|
|
|
|
title_y_n = icon_y_n + (base_px // 2) + (20 if compact else 23)
|
|
|
|
|
title_y_h = icon_y_h + (hover_px // 2) + (21 if compact else 24)
|
|
|
|
|
sub_y_n = title_y_n + (32 if compact else 36)
|
|
|
|
|
sub_y_h = title_y_h + (35 if compact else 39)
|
2026-11-15 22:06:29 +00:00
|
|
|
else:
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
icon_y_n = cy - 20
|
|
|
|
|
icon_y_h = icon_y_n - 3
|
|
|
|
|
title_y_n = icon_y_n + (base_px // 2) + 24
|
|
|
|
|
title_y_h = icon_y_h + (hover_px // 2) + 25
|
|
|
|
|
sub_y_n = sub_y_h = cy
|
2026-11-15 22:06:29 +00:00
|
|
|
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
frame_item = None
|
|
|
|
|
if frame_norm is not None:
|
|
|
|
|
frame_item = cv.create_image(cx, cy, image=frame_norm, anchor="center", tags=tags)
|
|
|
|
|
|
|
|
|
|
img_item = None
|
|
|
|
|
if icon_norm is not None:
|
|
|
|
|
self._photo_refs.append(icon_norm)
|
|
|
|
|
if icon_hov is not None:
|
|
|
|
|
self._photo_refs.append(icon_hov)
|
|
|
|
|
img_item = cv.create_image(cx, icon_y_n, image=icon_norm, anchor="center", tags=tags)
|
|
|
|
|
else:
|
|
|
|
|
sym_col = FONT_COLOR_STATUS_LOSS if is_online else UI_ACCENT_AMETHYST
|
|
|
|
|
sym_n = self.assets.get_goth_text_photo("*", size_px=FONT_SIZE_TITLE_LG - 4, color=sym_col)
|
|
|
|
|
sym_h = self.assets.get_goth_text_photo("*", size_px=FONT_SIZE_TITLE_LG + 2, color=FONT_COLOR_TITLE_MAIN)
|
|
|
|
|
self._photo_refs.extend([sym_n, sym_h])
|
|
|
|
|
icon_norm, icon_hov = sym_n, sym_h
|
|
|
|
|
img_item = cv.create_image(cx, icon_y_n, image=icon_norm, anchor="center", tags=tags)
|
|
|
|
|
|
|
|
|
|
title_item = cv.create_image(cx, title_y_n, image=title_norm, anchor="center", tags=tags)
|
|
|
|
|
|
|
|
|
|
sub_item = None
|
|
|
|
|
sub_norm = None
|
|
|
|
|
sub_hov = None
|
|
|
|
|
if rank_subtitle:
|
|
|
|
|
sub_col = FONT_COLOR_STATUS_LOSS if is_online else FONT_COLOR_HEADING_SUB
|
|
|
|
|
sub_px_n = FONT_SIZE_SMALL_MIN
|
|
|
|
|
sub_px_h = FONT_SIZE_SMALL_MIN + 2
|
|
|
|
|
sub_norm = self.assets.get_goth_text_photo(
|
|
|
|
|
rank_subtitle, size_px=sub_px_n, color=sub_col, max_width=card_w_n - 26
|
2026-11-14 04:25:51 +00:00
|
|
|
)
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
sub_hov = self.assets.get_goth_text_photo(
|
|
|
|
|
rank_subtitle, size_px=sub_px_h, color="#ffffff", max_width=card_w_h - 24
|
|
|
|
|
)
|
|
|
|
|
self._photo_refs.extend([sub_norm, sub_hov])
|
|
|
|
|
sub_item = cv.create_image(cx, sub_y_n, image=sub_norm, anchor="center", tags=tags)
|
2026-11-14 04:25:51 +00:00
|
|
|
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
# Unsichtbare Hitbox über die volle vergrößerte Kachelfläche (verhindert Hover-Flackern am Rand)
|
|
|
|
|
hit_id = cv.create_rectangle(
|
|
|
|
|
cx - card_w_h // 2, cy - card_h_h // 2,
|
|
|
|
|
cx + card_w_h // 2, cy + card_h_h // 2,
|
|
|
|
|
fill="", outline="", width=0, tags=tags,
|
|
|
|
|
)
|
|
|
|
|
cv.tag_raise(hit_id)
|
2026-11-15 22:06:29 +00:00
|
|
|
|
2026-11-14 04:25:51 +00:00
|
|
|
def _on_enter(_e):
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
cv.configure(cursor="hand2")
|
|
|
|
|
if frame_item and frame_hov:
|
|
|
|
|
cv.itemconfigure(frame_item, image=frame_hov)
|
|
|
|
|
if img_item and icon_hov:
|
|
|
|
|
cv.coords(img_item, cx, icon_y_h)
|
|
|
|
|
cv.itemconfigure(img_item, image=icon_hov)
|
|
|
|
|
cv.coords(title_item, cx, title_y_h)
|
|
|
|
|
cv.itemconfigure(title_item, image=title_hov)
|
|
|
|
|
if sub_item and sub_hov:
|
|
|
|
|
cv.coords(sub_item, cx, sub_y_h)
|
|
|
|
|
cv.itemconfigure(sub_item, image=sub_hov)
|
2026-11-14 04:25:51 +00:00
|
|
|
|
|
|
|
|
def _on_leave(_e):
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
cv.configure(cursor="")
|
|
|
|
|
if frame_item and frame_norm:
|
|
|
|
|
cv.itemconfigure(frame_item, image=frame_norm)
|
|
|
|
|
if img_item and icon_norm:
|
|
|
|
|
cv.coords(img_item, cx, icon_y_n)
|
|
|
|
|
cv.itemconfigure(img_item, image=icon_norm)
|
|
|
|
|
cv.coords(title_item, cx, title_y_n)
|
|
|
|
|
cv.itemconfigure(title_item, image=title_norm)
|
|
|
|
|
if sub_item and sub_norm:
|
|
|
|
|
cv.coords(sub_item, cx, sub_y_n)
|
|
|
|
|
cv.itemconfigure(sub_item, image=sub_norm)
|
2026-11-14 04:25:51 +00:00
|
|
|
|
feat(ui): overhaul menus, stats & dialogs to custom canvas-based Gothic UI
- Add ui_typography.py and update game_constants.py for Old London typography and new image assets
- Upgrade AssetManager with downscaled 9-slice box rendering and PIL Old London text engine
- Convert ResizingBG to full-window Canvas with automatic horizontal/vertical background switching
- Add GothEntry and two-part GothDropdown with proportional arrow cap, mousewheel scrolling, and scroll indicators
- Update ImageButton with 3-slice side caps, frame-aware auto-width, and automatic icon stripping
- Refactor GothTopbar, LoginView, MainMenuView (hover zoom), StatisticsView, StatsBoardWidget, BotSetupWidget, and AudioSettingsDialog
- Migrate Blackjack, Poker, FreeCell, Klondike, and Spider menu/stats views plus BlackjackResultDialog to frameless canvas layouts
- Fix Crostini shelf icon matching via exact X11 WM_CLASS and absolute pixmap path
2026-11-17 21:31:02 +00:00
|
|
|
cv.tag_bind(hit_tag, "<Enter>", _on_enter)
|
|
|
|
|
cv.tag_bind(hit_tag, "<Leave>", _on_leave)
|
|
|
|
|
cv.tag_bind(hit_tag, "<Button-1>", lambda _e: (self.sounds.play("click"), on_click()))
|