From 588fb31fa5963ef29083a565a9abaa61f6a1173a Mon Sep 17 00:00:00 2001 From: ardocrat Date: Fri, 11 Aug 2023 04:23:06 +0300 Subject: [PATCH] ui: fix network content paddings and panel width --- src/gui/views/network/connections.rs | 6 ++++-- src/gui/views/network/content.rs | 2 +- src/gui/views/network/setup/node.rs | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gui/views/network/connections.rs b/src/gui/views/network/connections.rs index 06b97e3..5738374 100644 --- a/src/gui/views/network/connections.rs +++ b/src/gui/views/network/connections.rs @@ -84,6 +84,8 @@ impl ConnectionsContent { // Draw modal content for current ui container. self.current_modal_ui(ui, frame, cb); + ui.add_space(2.0); + // Show network type selection. let saved_chain_type = AppConfig::chain_type(); NodeSetup::chain_type_ui(ui); @@ -184,7 +186,7 @@ impl ConnectionsContent { cb: &dyn PlatformCallbacks) { // Setup layout size. let mut rect = ui.available_rect_before_wrap(); - rect.set_height(53.0); + rect.set_height(52.0); // Draw round background. let bg_rect = rect.clone(); @@ -306,7 +308,7 @@ impl ConnectionsContent { // Show error when specified URL is not valid. if self.ext_node_url_error { - ui.add_space(12.0); + ui.add_space(2.0); ui.label(RichText::new(t!("wallets.invalid_url")) .size(17.0) .color(Colors::RED)); diff --git a/src/gui/views/network/content.rs b/src/gui/views/network/content.rs index db79c12..6817a09 100644 --- a/src/gui/views/network/content.rs +++ b/src/gui/views/network/content.rs @@ -134,7 +134,7 @@ impl NetworkContent { let mut rect = ui.available_rect_before_wrap(); let mut width = ui.available_width(); if !Root::is_dual_panel_mode(frame) { - width = f32::min(width, Root::SIDE_PANEL_WIDTH * 1.3) + width = f32::min(width, Root::SIDE_PANEL_WIDTH * 1.4) } rect.set_width(width); diff --git a/src/gui/views/network/setup/node.rs b/src/gui/views/network/setup/node.rs index 00fbcda..8d21fcc 100644 --- a/src/gui/views/network/setup/node.rs +++ b/src/gui/views/network/setup/node.rs @@ -105,10 +105,11 @@ impl NodeSetup { View::sub_title(ui, format!("{} {}", COMPUTER_TOWER, t!("network_settings.server"))); View::horizontal_line(ui, Colors::STROKE); - ui.add_space(4.0); + ui.add_space(6.0); // Show chain type setup. Self::chain_type_ui(ui); + ui.add_space(2.0); // Show loading indicator or controls to stop/start/restart node. if Node::is_stopping() || Node::is_restarting() || Node::is_starting() { @@ -221,7 +222,6 @@ impl NodeSetup { /// Draw [`ChainTypes`] setup content. pub fn chain_type_ui(ui: &mut egui::Ui) { - ui.add_space(1.0); ui.vertical_centered(|ui| { ui.label(RichText::new(t!("network.type")).size(16.0).color(Colors::GRAY)); });