From ae47a562bd423df856ec6c735d9e4c29a8e1e3c6 Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Thu, 20 Nov 2025 17:10:00 +0200 Subject: Redesign the native lock screen: clock/avatar header, on-screen keyboard, wrong-password shake The native lock UI was a flat bordered rectangle with three left-aligned text lines and no shadow, clock, or identity marker - reported directly as looking unfinished. Splits the redesign across a new transparent-canvas header (time, date, circular avatar, username) above a redesigned, centered password box with a real drop shadow and a dimmed placeholder prompt, plus a genuine on-screen QWERTY-shaped keyboard with working Shift/Backspace/Return/Space and real click hit-testing shared with the render path via one `lock_stack_layout` function, and a damped-sine shake on a failed attempt. LockConfig gains show_clock/show_keyboard/avatar_bg, each independently srd.set-able and documented in a new theme.lock.* section in DEFAULTS.md. native_lock_render_elements now takes one NativeLockFrame struct instead of positional buffer arguments now that it composites five optional layers instead of two. Full workspace build/test/clippy clean (152 wayland tests, +6 new). --- crates/core/src/lock_config.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'crates/core/src') diff --git a/crates/core/src/lock_config.rs b/crates/core/src/lock_config.rs index 7edeeb5..92ba0d0 100644 --- a/crates/core/src/lock_config.rs +++ b/crates/core/src/lock_config.rs @@ -34,6 +34,25 @@ pub struct LockConfig { pub show_caps_lock: bool, pub show_failed_attempts: bool, pub fail_message: String, + /// A large time+date readout above the password box, plus a circular + /// initial-letter avatar and the username - the set of things every + /// mainstream lock screen (GNOME, macOS, Windows) shows and this one + /// didn't, reported live as the box on its own "looks ugly/AI-like". + /// `true` by default; `false` reduces the lock screen to just the + /// password box, the previous look, for anyone who'd rather not have + /// the time visible on a locked screen. + pub show_clock: bool, + /// An on-screen keyboard below the password box, for a session with no + /// physical keyboard reachable (a touchscreen device, primarily) -- + /// see `native_lock.rs`'s own `render_keyboard`/`keyboard_hit_test`. + /// `true` by default; a real physical keyboard still works identically + /// either way, so this only ever adds a second input method, never + /// removes the first. + pub show_keyboard: bool, + /// The avatar circle's fill colour - defaults to `box_border` (the + /// same accent every other lock-screen element already uses) rather + /// than a third independent colour to keep track of. + pub avatar_bg: (u8, u8, u8), } impl Default for LockConfig { @@ -49,6 +68,9 @@ impl Default for LockConfig { show_caps_lock: true, show_failed_attempts: true, fail_message: "Wrong password".to_string(), + show_clock: true, + show_keyboard: true, + avatar_bg: (0x88, 0xc0, 0xd0), // Nord blue, matches box_border } } } -- cgit v1.2.3