From 04f1f74b85f515a2996b09ada58c99eb55c354c7 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 27 Dec 2020 18:43:34 +0100 Subject: [PATCH] LibGUI+WindowServer: Tweak hover shadows slightly Move the shadow 1 more pixel away from the unhovered icon location, making a total 2 pixel distance between the icon and the shadow. Also tweak the shadow color to be a darkened variant of the base color underneath the icon. --- Libraries/LibGUI/Button.cpp | 4 ++-- Services/WindowServer/Menu.cpp | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Libraries/LibGUI/Button.cpp b/Libraries/LibGUI/Button.cpp index 1aeb419a0b..3cd6667817 100644 --- a/Libraries/LibGUI/Button.cpp +++ b/Libraries/LibGUI/Button.cpp @@ -65,8 +65,8 @@ void Button::paint_event(PaintEvent& event) if (is_being_pressed() || is_checked()) painter.translate(1, 1); else if (m_icon && is_enabled() && is_hovered() && button_style() == Gfx::ButtonStyle::CoolBar) { - auto shadow_color = palette().threed_shadow1(); - painter.blit_filtered(icon_location, *m_icon, m_icon->rect(), [&shadow_color](auto) { + auto shadow_color = palette().button().darkened(0.7f); + painter.blit_filtered(icon_location.translated(1, 1), *m_icon, m_icon->rect(), [&shadow_color](auto) { return shadow_color; }); icon_location.move_by(-1, -1); diff --git a/Services/WindowServer/Menu.cpp b/Services/WindowServer/Menu.cpp index 1d4120c2d7..068ea71489 100644 --- a/Services/WindowServer/Menu.cpp +++ b/Services/WindowServer/Menu.cpp @@ -248,9 +248,8 @@ void Menu::draw() icon_rect.center_vertically_within(text_rect); if (&item == hovered_item() && item.is_enabled()) { - auto shadow_color = palette.threed_shadow1(); - shadow_color = palette.menu_selection().darkened(); - painter.blit_filtered(icon_rect.location(), *item.icon(), item.icon()->rect(), [&shadow_color](auto) { + auto shadow_color = palette.menu_selection().darkened(0.7f); + painter.blit_filtered(icon_rect.location().translated(1, 1), *item.icon(), item.icon()->rect(), [&shadow_color](auto) { return shadow_color; }); icon_rect.move_by(-1, -1);