srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/crates/wayland/src/decoration.rs
diff options
context:
space:
mode:
authorsrdusr <[email protected]>2025-11-20 17:10:00 +0200
committersrdusr <[email protected]>2025-11-20 17:10:00 +0200
commitae47a562bd423df856ec6c735d9e4c29a8e1e3c6 (patch)
tree6fa732650b8809d0c302017fbc72254c66bccc02 /crates/wayland/src/decoration.rs
parent04466601f4714dcbc1f3b0ef134febede6febb6a (diff)
downloadsrdwm-ae47a562bd423df856ec6c735d9e4c29a8e1e3c6.tar.gz
srdwm-ae47a562bd423df856ec6c735d9e4c29a8e1e3c6.zip
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).
Diffstat (limited to 'crates/wayland/src/decoration.rs')
-rw-r--r--crates/wayland/src/decoration.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/wayland/src/decoration.rs b/crates/wayland/src/decoration.rs
index ee3f34c..aa12a54 100644
--- a/crates/wayland/src/decoration.rs
+++ b/crates/wayland/src/decoration.rs
@@ -44,7 +44,7 @@ pub(crate) use color::{mix_rgb, rgb_to_bgra};
pub(crate) use corners::{round_bottom_corners, round_top_corners};
pub(crate) use font::{blit_glyph, find_system_font, FONT_PIXELS, TEXT_LEFT_PADDING};
pub use shadow::{shadow_bitmap, shadow_rect};
-pub(crate) use shadow::SHADOW_MAX_ALPHA;
+pub(crate) use shadow::{SHADOW_MAX_ALPHA, SHADOW_SIZE};
pub use titlebar::render_titlebar;
/// Default corner radius, in pixels, applied to a window at creation
@@ -389,7 +389,7 @@ pub(crate) fn render_desktop_icon(
/// canvas), so there's no premultiplication to get right here - straight
/// and premultiplied colour are identical at full opacity.
#[allow(clippy::too_many_arguments)]
-fn fill_rect(buf: &mut [u8], width: usize, height: usize, x0: i32, y0: i32, x1: i32, y1: i32, color: (u8, u8, u8), alpha: u8) {
+pub(crate) fn fill_rect(buf: &mut [u8], width: usize, height: usize, x0: i32, y0: i32, x1: i32, y1: i32, color: (u8, u8, u8), alpha: u8) {
let px = rgb_to_bgra(color, alpha);
for y in y0.max(0)..y1.min(height as i32) {
for x in x0.max(0)..x1.min(width as i32) {
@@ -410,7 +410,7 @@ fn fill_rect(buf: &mut [u8], width: usize, height: usize, x0: i32, y0: i32, x1:
/// partial-alpha pixel is a real, previously-hit correctness bug here, not
/// a style choice.
#[allow(clippy::too_many_arguments)]
-fn blit_glyph_on_transparent(buf: &mut [u8], width: usize, height: usize, glyph_x: i32, glyph_y: i32, metrics: &fontdue::Metrics, coverage: &[u8], color: (u8, u8, u8)) {
+pub(crate) fn blit_glyph_on_transparent(buf: &mut [u8], width: usize, height: usize, glyph_x: i32, glyph_y: i32, metrics: &fontdue::Metrics, coverage: &[u8], color: (u8, u8, u8)) {
for row in 0..metrics.height {
let y = glyph_y + row as i32;
if y < 0 || y as usize >= height {