2026-11-14 04:25:51 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
# view/widgets/image_button.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-21 01:20:50 +00:00
|
|
|
from typing import Callable
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
from PIL import ImageTk
|
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
|
|
|
|
2026-11-21 01:20:50 +00:00
|
|
|
from models.database import Database
|
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 resources.code_res.game_constants import (
|
2026-11-21 01:20:50 +00:00
|
|
|
ACCENT_GOTH,
|
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,
|
|
|
|
|
BTN_AMETHYST_TEXT_ACTIVE,
|
|
|
|
|
BTN_AMETHYST_TEXT_DISABLED,
|
|
|
|
|
BTN_AMETHYST_TEXT_HOVER,
|
|
|
|
|
BTN_AMETHYST_TEXT_NORMAL,
|
|
|
|
|
BTN_FIRE_TEXT_ACTIVE,
|
|
|
|
|
BTN_FIRE_TEXT_DISABLED,
|
|
|
|
|
BTN_FIRE_TEXT_HOVER,
|
|
|
|
|
BTN_FIRE_TEXT_NORMAL,
|
2026-11-21 01:20:50 +00:00
|
|
|
FG_COLOR,
|
|
|
|
|
MODAL_BG,
|
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
|
|
|
)
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
from view.widgets.button_art_compositor import ButtonArtCompositor
|
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
|
|
|
|
2026-11-21 01:20:50 +00:00
|
|
|
SETTING_BUTTON_HOVER_HELP = "show_button_hover_help"
|
|
|
|
|
_HOVER_HELP_ENABLED_CACHE: bool | None = None
|
|
|
|
|
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
# Kompatibilitäts-Exporte für goth_dropdown.py & assets_manager.py
|
|
|
|
|
_get_old_london = ButtonArtCompositor.get_old_london
|
|
|
|
|
_clean_outer_black_matte = ButtonArtCompositor.clean_outer_black_matte
|
|
|
|
|
_trim_button_art = ButtonArtCompositor.trim_button_art
|
2026-11-21 01:20:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def is_button_hover_help_enabled() -> bool:
|
|
|
|
|
global _HOVER_HELP_ENABLED_CACHE
|
|
|
|
|
if _HOVER_HELP_ENABLED_CACHE is None:
|
|
|
|
|
try:
|
|
|
|
|
raw = Database.load_setting(SETTING_BUTTON_HOVER_HELP, default="1")
|
|
|
|
|
_HOVER_HELP_ENABLED_CACHE = str(raw).strip() not in ("0", "false", "False", "off")
|
|
|
|
|
except Exception:
|
|
|
|
|
_HOVER_HELP_ENABLED_CACHE = True
|
|
|
|
|
return _HOVER_HELP_ENABLED_CACHE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def set_button_hover_help_enabled(enabled: bool, persist: bool = True):
|
|
|
|
|
global _HOVER_HELP_ENABLED_CACHE
|
|
|
|
|
_HOVER_HELP_ENABLED_CACHE = bool(enabled)
|
|
|
|
|
if not _HOVER_HELP_ENABLED_CACHE:
|
|
|
|
|
ImageButton.close_active_hover_tip()
|
|
|
|
|
if persist:
|
|
|
|
|
try:
|
|
|
|
|
Database.save_setting(SETTING_BUTTON_HOVER_HELP, "1" if _HOVER_HELP_ENABLED_CACHE else "0")
|
|
|
|
|
except Exception:
|
|
|
|
|
pass
|
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
|
|
|
|
|
|
|
|
|
2026-11-14 04:25:51 +00:00
|
|
|
class ImageButton(tk.Label):
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
"""Gothic UI Button (Amethyst & Fire) mit State-Caching und optionalem Hover-Hilfetext."""
|
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
|
|
|
|
2026-11-21 01:20:50 +00:00
|
|
|
_active_tip: tk.Toplevel | None = None
|
|
|
|
|
_active_tip_owner: "ImageButton | None" = None
|
|
|
|
|
|
2026-11-14 04:25:51 +00:00
|
|
|
def __init__(
|
|
|
|
|
self,
|
|
|
|
|
parent,
|
|
|
|
|
text: str,
|
|
|
|
|
pil_normal,
|
|
|
|
|
pil_hover,
|
|
|
|
|
command,
|
|
|
|
|
sound_mgr=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
|
|
|
width: int = 150,
|
|
|
|
|
height: int = 36,
|
|
|
|
|
font=None,
|
2026-11-14 04:25:51 +00:00
|
|
|
enabled: bool = 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
|
|
|
style: str | None = None,
|
|
|
|
|
auto_expand: bool = True,
|
2026-11-21 01:20:50 +00:00
|
|
|
hover_text: str | Callable[[], str] | None = None,
|
2026-11-14 04:25:51 +00:00
|
|
|
):
|
|
|
|
|
try:
|
|
|
|
|
parent_bg = parent.cget("bg")
|
|
|
|
|
except Exception:
|
|
|
|
|
parent_bg = BG_COLOR
|
|
|
|
|
|
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._requested_width = max(56, int(width))
|
|
|
|
|
self._height = max(28, int(height))
|
|
|
|
|
self._auto_expand = bool(auto_expand)
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
self._text = ButtonArtCompositor.prepare_label_text(str(text 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._pil_normal = pil_normal
|
|
|
|
|
self._pil_hover = pil_hover or pil_normal
|
2026-11-14 04:25:51 +00:00
|
|
|
self._sound_mgr = sound_mgr
|
|
|
|
|
self._user_cmd = command
|
|
|
|
|
self._enabled = bool(enabled)
|
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._hovered = False
|
2026-11-21 01:20:50 +00:00
|
|
|
self._hover_text = hover_text
|
|
|
|
|
self._hover_after_id: str | None = None
|
2026-11-14 04:25:51 +00:00
|
|
|
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
self._style = style if style in ("fire", "amethyst") else self._detect_style(parent, pil_normal, pil_hover)
|
|
|
|
|
self._font_px = ButtonArtCompositor.resolve_font_px(font, self._height)
|
|
|
|
|
self._width = ButtonArtCompositor.compute_framed_width(
|
|
|
|
|
self._text, self._requested_width, self._height, self._font_px, self._auto_expand
|
|
|
|
|
)
|
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._rebuild_state_photos()
|
|
|
|
|
|
2026-11-21 01:20:50 +00:00
|
|
|
init_photo = self._ensure_normal() if self._enabled else self._ensure_disabled()
|
2026-11-14 04:25:51 +00:00
|
|
|
super().__init__(
|
|
|
|
|
parent,
|
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
|
|
|
text="" if init_photo is not None else self._text,
|
|
|
|
|
image=init_photo if init_photo is not None else "",
|
2026-11-14 04:25:51 +00:00
|
|
|
bg=parent_bg,
|
|
|
|
|
bd=0,
|
|
|
|
|
padx=0,
|
|
|
|
|
pady=0,
|
|
|
|
|
highlightthickness=0,
|
|
|
|
|
cursor="hand2" if self._enabled else "arrow",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
self.bind("<Enter>", self._on_enter)
|
|
|
|
|
self.bind("<Leave>", self._on_leave)
|
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.bind("<ButtonPress-1>", self._on_press)
|
|
|
|
|
self.bind("<ButtonRelease-1>", self._on_release)
|
2026-11-21 01:20:50 +00:00
|
|
|
self.bind("<Destroy>", self._on_destroy)
|
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
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def pixel_width(self) -> int:
|
|
|
|
|
return self._width
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def pixel_height(self) -> int:
|
|
|
|
|
return self._height
|
|
|
|
|
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
@staticmethod
|
|
|
|
|
def _detect_style(parent, pil_normal, pil_hover) -> str:
|
|
|
|
|
try:
|
|
|
|
|
assets = getattr(parent.winfo_toplevel(), "assets", None)
|
|
|
|
|
if assets is not None and getattr(assets, "raw_btn_fire", None) is not None:
|
|
|
|
|
if pil_normal is assets.raw_btn_fire or pil_hover is assets.raw_btn_fire:
|
|
|
|
|
return "fire"
|
|
|
|
|
except Exception:
|
|
|
|
|
pass
|
|
|
|
|
return "amethyst"
|
|
|
|
|
|
2026-11-21 01:20:50 +00:00
|
|
|
def set_hover_text(self, hover_text: str | Callable[[], str] | None):
|
|
|
|
|
self._hover_text = hover_text
|
|
|
|
|
if not hover_text and ImageButton._active_tip_owner is self:
|
|
|
|
|
ImageButton.close_active_hover_tip()
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def close_active_hover_tip(cls):
|
|
|
|
|
if cls._active_tip is not None:
|
|
|
|
|
try:
|
|
|
|
|
if cls._active_tip.winfo_exists():
|
|
|
|
|
cls._active_tip.destroy()
|
|
|
|
|
except Exception:
|
|
|
|
|
pass
|
|
|
|
|
cls._active_tip = None
|
|
|
|
|
cls._active_tip_owner = None
|
|
|
|
|
|
|
|
|
|
def _cancel_hover_timer(self):
|
|
|
|
|
if self._hover_after_id is not None:
|
|
|
|
|
try:
|
|
|
|
|
self.after_cancel(self._hover_after_id)
|
|
|
|
|
except Exception:
|
|
|
|
|
pass
|
|
|
|
|
self._hover_after_id = None
|
|
|
|
|
|
|
|
|
|
def _resolve_hover_string(self) -> str:
|
|
|
|
|
if self._hover_text is None:
|
|
|
|
|
return ""
|
|
|
|
|
try:
|
|
|
|
|
raw = self._hover_text() if callable(self._hover_text) else str(self._hover_text)
|
|
|
|
|
return (raw or "").strip()
|
|
|
|
|
except Exception:
|
|
|
|
|
return ""
|
|
|
|
|
|
|
|
|
|
def _show_hover_tooltip(self):
|
|
|
|
|
self._hover_after_id = None
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
if not self._hovered or not self.winfo_exists() or not is_button_hover_help_enabled():
|
2026-11-21 01:20:50 +00:00
|
|
|
return
|
|
|
|
|
msg = self._resolve_hover_string()
|
|
|
|
|
if not msg:
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
ImageButton.close_active_hover_tip()
|
|
|
|
|
tip = tk.Toplevel(self)
|
|
|
|
|
tip.wm_overrideredirect(True)
|
|
|
|
|
try:
|
|
|
|
|
tip.wm_attributes("-topmost", True)
|
|
|
|
|
except Exception:
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
border_frame = tk.Frame(tip, bg=ACCENT_GOTH, padx=1, pady=1)
|
|
|
|
|
border_frame.pack(fill="both", expand=True)
|
|
|
|
|
inner_frame = tk.Frame(border_frame, bg=MODAL_BG, padx=12, pady=8)
|
|
|
|
|
inner_frame.pack(fill="both", expand=True)
|
|
|
|
|
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
tk.Label(
|
|
|
|
|
inner_frame, text=msg, font=("Helvetica", 9),
|
|
|
|
|
fg=FG_COLOR, bg=MODAL_BG, justify="left", wraplength=340,
|
|
|
|
|
).pack()
|
2026-11-21 01:20:50 +00:00
|
|
|
|
|
|
|
|
tip.update_idletasks()
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
tw, th = tip.winfo_reqwidth(), tip.winfo_reqheight()
|
|
|
|
|
sw, sh = self.winfo_screenwidth(), self.winfo_screenheight()
|
|
|
|
|
bx, by = self.winfo_rootx(), self.winfo_rooty()
|
2026-11-21 01:20:50 +00:00
|
|
|
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
rx = max(12, min(sw - tw - 12, bx + (self._width - tw) // 2))
|
2026-11-21 01:20:50 +00:00
|
|
|
ry = by - th - 10
|
|
|
|
|
if ry < 14:
|
|
|
|
|
ry = by + self._height + 10
|
|
|
|
|
ry = max(12, min(sh - th - 16, ry))
|
|
|
|
|
|
|
|
|
|
tip.wm_geometry(f"+{rx}+{ry}")
|
|
|
|
|
ImageButton._active_tip = tip
|
|
|
|
|
ImageButton._active_tip_owner = 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
|
|
|
def _palette(self) -> tuple[str, str, str, str]:
|
|
|
|
|
if self._style == "fire":
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
return (BTN_FIRE_TEXT_NORMAL, BTN_FIRE_TEXT_HOVER, BTN_FIRE_TEXT_ACTIVE, BTN_FIRE_TEXT_DISABLED)
|
|
|
|
|
return (BTN_AMETHYST_TEXT_NORMAL, BTN_AMETHYST_TEXT_HOVER, BTN_AMETHYST_TEXT_ACTIVE, BTN_AMETHYST_TEXT_DISABLED)
|
|
|
|
|
|
|
|
|
|
def _compose(self, base_pil, color: str, dim: bool = False, bright: bool = False) -> ImageTk.PhotoImage | None:
|
|
|
|
|
return ButtonArtCompositor.compose_photo(
|
|
|
|
|
base_pil, self._width, self._height, self._text, self._font_px, color, dim, bright
|
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
|
|
|
)
|
|
|
|
|
|
2026-11-19 21:47:35 +00:00
|
|
|
def _rebuild_state_photos(self):
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
c_norm, _, _, c_dis = self._palette()
|
|
|
|
|
self._photo_normal = self._compose(self._pil_normal, c_norm) if self._enabled else None
|
|
|
|
|
self._photo_disabled = None if self._enabled else self._compose(self._pil_normal, c_dis, dim=True)
|
2026-11-19 21:47:35 +00:00
|
|
|
self._photo_hover = None
|
|
|
|
|
self._photo_active = None
|
|
|
|
|
|
|
|
|
|
def _ensure_normal(self) -> ImageTk.PhotoImage | None:
|
|
|
|
|
if self._photo_normal is None:
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
self._photo_normal = self._compose(self._pil_normal, self._palette()[0])
|
2026-11-19 21:47:35 +00:00
|
|
|
return self._photo_normal
|
|
|
|
|
|
|
|
|
|
def _ensure_hover(self) -> ImageTk.PhotoImage | None:
|
|
|
|
|
if self._photo_hover is None:
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
self._photo_hover = self._compose(self._pil_hover, self._palette()[1])
|
2026-11-19 21:47:35 +00:00
|
|
|
return self._photo_hover
|
|
|
|
|
|
|
|
|
|
def _ensure_active(self) -> ImageTk.PhotoImage | None:
|
|
|
|
|
if self._photo_active is None:
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
self._photo_active = self._compose(self._pil_hover, self._palette()[2], bright=True)
|
2026-11-19 21:47:35 +00:00
|
|
|
return self._photo_active
|
|
|
|
|
|
|
|
|
|
def _ensure_disabled(self) -> ImageTk.PhotoImage | None:
|
|
|
|
|
if self._photo_disabled is None:
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
self._photo_disabled = self._compose(self._pil_normal, self._palette()[3], dim=True)
|
2026-11-19 21:47:35 +00:00
|
|
|
return self._photo_disabled
|
|
|
|
|
|
2026-11-21 01:20:50 +00:00
|
|
|
def set_text(self, new_text: str):
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
self._text = ButtonArtCompositor.prepare_label_text(str(new_text or ""))
|
|
|
|
|
self._width = ButtonArtCompositor.compute_framed_width(
|
|
|
|
|
self._text, self._requested_width, self._height, self._font_px, self._auto_expand
|
|
|
|
|
)
|
2026-11-21 01:20:50 +00:00
|
|
|
self._rebuild_state_photos()
|
|
|
|
|
self.set_enabled(self._enabled)
|
|
|
|
|
|
2026-11-19 21:47:35 +00:00
|
|
|
def set_enabled(self, enabled: bool):
|
|
|
|
|
self._enabled = bool(enabled)
|
|
|
|
|
if not self._enabled:
|
|
|
|
|
self._hovered = False
|
2026-11-21 01:20:50 +00:00
|
|
|
self._cancel_hover_timer()
|
|
|
|
|
if ImageButton._active_tip_owner is self:
|
|
|
|
|
ImageButton.close_active_hover_tip()
|
2026-11-19 21:47:35 +00:00
|
|
|
ph = self._ensure_disabled()
|
|
|
|
|
self.configure(image=ph if ph else "", cursor="arrow")
|
|
|
|
|
else:
|
|
|
|
|
ph = self._ensure_hover() if self._hovered else self._ensure_normal()
|
|
|
|
|
self.configure(image=ph if ph else "", cursor="hand2")
|
|
|
|
|
|
|
|
|
|
def _on_enter(self, _event):
|
|
|
|
|
self._hovered = True
|
2026-11-21 01:20:50 +00:00
|
|
|
if self._enabled:
|
|
|
|
|
ph = self._ensure_hover()
|
|
|
|
|
if ph:
|
|
|
|
|
self.configure(image=ph)
|
|
|
|
|
if self._hover_text is not None and is_button_hover_help_enabled():
|
|
|
|
|
self._cancel_hover_timer()
|
|
|
|
|
self._hover_after_id = self.after(220, self._show_hover_tooltip)
|
2026-11-19 21:47:35 +00:00
|
|
|
|
|
|
|
|
def _on_leave(self, _event):
|
|
|
|
|
self._hovered = False
|
2026-11-21 01:20:50 +00:00
|
|
|
self._cancel_hover_timer()
|
|
|
|
|
if ImageButton._active_tip_owner is self:
|
|
|
|
|
ImageButton.close_active_hover_tip()
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
if self._enabled:
|
|
|
|
|
ph = self._ensure_normal()
|
|
|
|
|
if ph:
|
|
|
|
|
self.configure(image=ph)
|
2026-11-19 21:47:35 +00:00
|
|
|
|
|
|
|
|
def _on_press(self, _event):
|
2026-11-21 01:20:50 +00:00
|
|
|
self._cancel_hover_timer()
|
|
|
|
|
if ImageButton._active_tip_owner is self:
|
|
|
|
|
ImageButton.close_active_hover_tip()
|
refactor(arch,ui,stats): modularize codebase (<500 LOC/file), unify stats hub & refine win FX
Großes Architektur-, Deduplizierungs- & UI-Release:
- Strikte Modularisierung (<500 Zeilen pro Datei, 1 Klasse pro Modul, pyscn Health Score 97/100).
- Gemeinsame Basis-Klassen extrahiert: SolitaireMenuBase, SolitaireTableController, SolitaireSessionGuard, SolitaireCanvasInput, SolitaireOutcomeFlow, LuckPouchMenuBase, CasinoArenaBase & CasinoResultDialogBase.
- UnifiedStatsView: kategorisierter Statistik-Hub (Glück, Solitaire, Bayerische Spiele, Gesellschaft) ohne Äpfel-mit-Birnen-Gesamtansicht.
- PokerResultDialog auf das Gothic-Canvas-Rahmendesign gehoben.
- EndgameFxOverlay: Feuerwerksraketen entfernt, direkter Spawn von Fledermaus- und Kürbis-Explosionen.
2026-11-22 22:07:57 +00:00
|
|
|
if self._enabled:
|
|
|
|
|
ph = self._ensure_active()
|
|
|
|
|
if ph:
|
|
|
|
|
self.configure(image=ph)
|
2026-11-19 21:47:35 +00:00
|
|
|
|
|
|
|
|
def _on_release(self, event):
|
|
|
|
|
if not self._enabled:
|
|
|
|
|
return
|
|
|
|
|
inside = (0 <= event.x < self._width) and (0 <= event.y < self._height)
|
|
|
|
|
self._hovered = inside
|
|
|
|
|
ph = self._ensure_hover() if inside else self._ensure_normal()
|
|
|
|
|
if ph:
|
|
|
|
|
self.configure(image=ph)
|
|
|
|
|
if inside:
|
|
|
|
|
if self._sound_mgr:
|
|
|
|
|
self._sound_mgr.play("click")
|
|
|
|
|
if self._user_cmd:
|
|
|
|
|
self._user_cmd()
|
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
|
|
|
|
2026-11-21 01:20:50 +00:00
|
|
|
def _on_destroy(self, event=None):
|
|
|
|
|
if event is not None and event.widget is not self:
|
2026-11-14 04:25:51 +00:00
|
|
|
return
|
2026-11-21 01:20:50 +00:00
|
|
|
self._cancel_hover_timer()
|
|
|
|
|
if ImageButton._active_tip_owner is self:
|
|
|
|
|
ImageButton.close_active_hover_tip()
|