spec.md 2.96 KB

Spec: Login Window ttk Widget Styling

Overview

Specification for ensuring LoginWindow ttk widgets (Frame, Label, etc.) have explicit background styling to render correctly on macOS.

MODIFIED Requirements

Requirement: LoginWindow Style Configuration Completeness

ID: login-style-001

The LoginWindow.setup_styles() method MUST configure background colors for all ttk widget types used in the LoginWindow, matching the pattern established in ImageGeneratorApp.setup_styles(). The style configuration SHALL include TFrame and TLabel background colors set to the bg_color variable (#ffffff).

Scenario: ttk.Frame renders with white background on macOS

Given the LoginWindow is displayed on macOS When the main_frame (ttk.Frame) is rendered Then the frame SHALL have a white (#ffffff) background And all content within the frame SHALL be visible against the white background And the frame SHALL not render as transparent or with system-default colors

Scenario: LoginWindow styling matches ImageGeneratorApp pattern

Given both LoginWindow and ImageGeneratorApp setup_styles() methods Then both MUST configure TFrame background color And both MUST configure TLabel background color And both MUST use the same bg_color value (#ffffff) And the styling approach SHALL be consistent across both classes

Scenario: All UI elements visible on macOS after style configuration

Given the LoginWindow is displayed on macOS with proper ttk style configuration Then the title label "登录" SHALL be visible And the username label "用户名" SHALL be visible And the username Entry field SHALL be visible with light gray background And the password label "密码" SHALL be visible And the password Entry field SHALL be visible with light gray background And the checkboxes SHALL remain visible And the login button SHALL be visible And all elements SHALL render on a white background

Requirement: ttk Widget Background Configuration

ID: login-style-002

The LoginWindow style configuration MUST include explicit background color settings for TFrame and TLabel widgets to prevent rendering issues on macOS with the clam theme.

Scenario: TFrame style is explicitly configured

Given the LoginWindow.setup_styles() method When the ttk.Style is configured Then style.configure('TFrame', background=bg_color) MUST be called And bg_color SHALL be '#ffffff' And this configuration SHALL occur before any ttk.Frame widgets are created

Scenario: TLabel style is explicitly configured for consistency

Given the LoginWindow.setup_styles() method When the ttk.Style is configured Then style.configure('TLabel', background=bg_color) MUST be called And bg_color SHALL be '#ffffff' And this configuration SHALL match the ImageGeneratorApp pattern

ADDED Requirements

None - this change modifies existing styling behavior

REMOVED Requirements

None - no requirements are being removed