From 951886f5c70a46e133cbe561d8e76e776ebbc5f3 Mon Sep 17 00:00:00 2001 From: ardocrat Date: Tue, 4 Jun 2024 16:48:44 +0300 Subject: [PATCH] ui: current wallet item background --- src/gui/colors.rs | 11 ----------- src/gui/views/wallets/content.rs | 8 ++++---- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/gui/colors.rs b/src/gui/colors.rs index 9bc53d7..17e3a64 100644 --- a/src/gui/colors.rs +++ b/src/gui/colors.rs @@ -72,9 +72,6 @@ const ITEM_STROKE_DARK: Color32 = Color32::from_gray(40); const ITEM_HOVER: Color32 = Color32::from_gray(205); const ITEM_HOVER_DARK: Color32 = Color32::from_gray(48); -const ITEM_CURRENT: Color32 = Color32::from_gray(233); -const ITEM_CURRENT_DARK: Color32 = Color32::from_gray(34); - /// Check if dark theme should be used. fn use_dark() -> bool { AppConfig::dark_theme().unwrap_or(false) @@ -238,12 +235,4 @@ impl Colors { ITEM_HOVER } } - - pub fn item_current() -> Color32 { - if use_dark() { - ITEM_CURRENT_DARK - } else { - ITEM_CURRENT - } - } } \ No newline at end of file diff --git a/src/gui/views/wallets/content.rs b/src/gui/views/wallets/content.rs index 2440875..b9d9773 100644 --- a/src/gui/views/wallets/content.rs +++ b/src/gui/views/wallets/content.rs @@ -376,12 +376,12 @@ impl WalletsContent { let mut rect = ui.available_rect_before_wrap(); rect.set_height(78.0); let rounding = View::item_rounding(0, 1, false); - let bg = if current { - Colors::item_current() + let (bg, stroke) = if current { + (Colors::fill_deep(), View::item_stroke()) } else { - Colors::fill() + (Colors::fill(), View::hover_stroke()) }; - ui.painter().rect(rect, rounding, bg, View::hover_stroke()); + ui.painter().rect(rect, rounding, bg, stroke); ui.allocate_ui_with_layout(rect.size(), Layout::right_to_left(Align::Center), |ui| { // Setup padding for item buttons.