From 417e8a28cb18ddd2a729a96c9beb7f2f558c5402 Mon Sep 17 00:00:00 2001 From: ardocrat Date: Wed, 9 Aug 2023 04:17:45 +0300 Subject: [PATCH] ui: optimize connections colors --- .../network/{connections/content.rs => connections.rs} | 7 +++---- src/gui/views/network/content.rs | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) rename src/gui/views/network/{connections/content.rs => connections.rs} (98%) diff --git a/src/gui/views/network/connections/content.rs b/src/gui/views/network/connections.rs similarity index 98% rename from src/gui/views/network/connections/content.rs rename to src/gui/views/network/connections.rs index 807917e..35d282b 100644 --- a/src/gui/views/network/connections/content.rs +++ b/src/gui/views/network/connections.rs @@ -117,8 +117,7 @@ impl ConnectionsContent { let mut rect = ui.available_rect_before_wrap(); rect.set_height(78.0); let rounding = View::item_rounding(0, 1, false); - let bg_color = Colors::FILL_DARK; - ui.painter().rect(rect, rounding, bg_color, View::HOVER_STROKE); + ui.painter().rect(rect, rounding, Colors::FILL, View::ITEM_STROKE); ui.allocate_ui_with_layout(rect.size(), Layout::right_to_left(Align::Center), |ui| { // Setup padding for item buttons. @@ -189,7 +188,7 @@ impl ConnectionsContent { // Draw round background. let bg_rect = rect.clone(); let item_rounding = View::item_rounding(index, len, false); - ui.painter().rect(bg_rect, item_rounding, Colors::FILL_DARK, View::ITEM_STROKE); + ui.painter().rect(bg_rect, item_rounding, Colors::FILL, View::ITEM_STROKE); ui.vertical(|ui| { ui.allocate_ui_with_layout(rect.size(), Layout::right_to_left(Align::Center), |ui| { @@ -222,7 +221,7 @@ impl ConnectionsContent { // Draw connections URL. ui.add_space(4.0); let conn_text = format!("{} {}", COMPUTER_TOWER, conn.url); - View::ellipsize_text(ui, conn_text, 15.0, Colors::TEXT); + View::ellipsize_text(ui, conn_text, 15.0, Colors::TITLE); ui.add_space(1.0); // Setup connection status text. diff --git a/src/gui/views/network/content.rs b/src/gui/views/network/content.rs index 3937b40..c7ef916 100644 --- a/src/gui/views/network/content.rs +++ b/src/gui/views/network/content.rs @@ -83,7 +83,7 @@ impl NetworkContent { }, }, fill: if show_connections { - Colors::FILL + Colors::BUTTON } else { Colors::WHITE },