From 08bbc1cf9569fb31668760a256642bcbfc66e9f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vuka=C5=A1in=20Vojinovi=C4=87?= <150025636+git-f0x@users.noreply.github.com> Date: Tue, 2 Jul 2024 20:26:14 +0200 Subject: [PATCH] feat(app-list): accent colored dot when focused --- cosmic-app-list/src/app.rs | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/cosmic-app-list/src/app.rs b/cosmic-app-list/src/app.rs index 1c191ccb..262826ed 100755 --- a/cosmic-app-list/src/app.rs +++ b/cosmic-app-list/src/app.rs @@ -184,9 +184,11 @@ impl DockItem { .style(::Style::Custom(Box::new( move |theme| container::Appearance { text_color: Some(Color::TRANSPARENT), - background: Some(Background::Color( - theme.cosmic().on_bg_color().into(), - )), + background: if is_focused { + Some(Background::Color(theme.cosmic().accent_color().into())) + } else { + Some(Background::Color(theme.cosmic().on_bg_color().into())) + }, border: Border { radius: dot_border_radius.into(), width: 0.0, @@ -208,9 +210,13 @@ impl DockItem { .style(::Style::Custom(Box::new( move |theme| container::Appearance { text_color: Some(Color::TRANSPARENT), - background: Some(Background::Color( - theme.cosmic().on_bg_color().into(), - )), + background: if is_focused { + Some(Background::Color( + theme.cosmic().accent_color().into(), + )) + } else { + Some(Background::Color(theme.cosmic().on_bg_color().into())) + }, border: Border { radius: dot_border_radius.into(), width: 0.0, @@ -230,9 +236,13 @@ impl DockItem { .style(::Style::Custom(Box::new( move |theme| container::Appearance { text_color: Some(Color::TRANSPARENT), - background: Some(Background::Color( - theme.cosmic().on_bg_color().into(), - )), + background: if is_focused { + Some(Background::Color( + theme.cosmic().accent_color().into(), + )) + } else { + Some(Background::Color(theme.cosmic().on_bg_color().into())) + }, border: Border { radius: dot_border_radius.into(), width: 0.0,