feat: respect accent colors in more places in desktop

This commit is contained in:
2026-05-24 21:29:59 +02:00
parent c731f718e9
commit 96943116f8
12 changed files with 70 additions and 20 deletions
+19 -4
View File
@@ -5,6 +5,7 @@
*/
#include "desktop_internal.hpp"
#include <gui/mtk/theme.hpp>
static constexpr int LAUNCHER_W = 560;
static constexpr int LAUNCHER_SEARCH_H = 52;
@@ -17,8 +18,22 @@ static constexpr int LAUNCHER_SPECIAL_FOLDER_COUNT = 6;
static constexpr Color LAUNCHER_BORDER = Color::from_rgb(0xD4, 0xDB, 0xE4);
static constexpr Color LAUNCHER_FIELD_BG = Color::from_rgb(0xFF, 0xFF, 0xFF);
static constexpr Color LAUNCHER_SELECTED_BG = Color::from_rgb(0xDA, 0xE7, 0xFD);
static constexpr Color LAUNCHER_HOVER_BG = Color::from_rgb(0xEC, 0xF3, 0xFE);
static constexpr Color LAUNCHER_SELECTED_BG_DEFAULT = Color::from_rgb(0xDA, 0xE7, 0xFD);
static constexpr Color LAUNCHER_HOVER_BG_DEFAULT = Color::from_rgb(0xEC, 0xF3, 0xFE);
static Color launcher_selected_bg(Color accent) {
if (accent.r == colors::ACCENT.r && accent.g == colors::ACCENT.g
&& accent.b == colors::ACCENT.b)
return LAUNCHER_SELECTED_BG_DEFAULT;
return gui::mtk::mix(colors::WHITE, accent, 47);
}
static Color launcher_hover_bg(Color accent) {
if (accent.r == colors::ACCENT.r && accent.g == colors::ACCENT.g
&& accent.b == colors::ACCENT.b)
return LAUNCHER_HOVER_BG_DEFAULT;
return gui::mtk::mix(colors::WHITE, accent, 20);
}
static constexpr Color LAUNCHER_MUTED = Color::from_rgb(0x6F, 0x7B, 0x89);
static constexpr Color LAUNCHER_PLACEHOLDER = Color::from_rgb(0x98, 0xA1, 0xAD);
@@ -589,9 +604,9 @@ void desktop_draw_launcher(DesktopState* ds) {
bool selected = (result_idx == ds->launcher_selected);
bool hovered = row.contains(ds->mouse.x, ds->mouse.y);
if (selected) {
fill_rounded_rect(fb, row.x, row.y, row.w, row.h, 8, LAUNCHER_SELECTED_BG);
fill_rounded_rect(fb, row.x, row.y, row.w, row.h, 8, launcher_selected_bg(ds->settings.accent_color));
} else if (hovered) {
fill_rounded_rect(fb, row.x, row.y, row.w, row.h, 8, LAUNCHER_HOVER_BG);
fill_rounded_rect(fb, row.x, row.y, row.w, row.h, 8, launcher_hover_bg(ds->settings.accent_color));
}
if (i > 0) {