From dafd2a1db39d31a779d55d72425eee25bc687382 Mon Sep 17 00:00:00 2001 From: ardocrat Date: Mon, 1 Jul 2024 18:58:54 +0300 Subject: [PATCH] ui: fix panels margins --- src/gui/views/network/content.rs | 33 +++++++++++++++++++++++-- src/gui/views/root.rs | 12 +-------- src/gui/views/wallets/wallet/content.rs | 2 +- 3 files changed, 33 insertions(+), 14 deletions(-) diff --git a/src/gui/views/network/content.rs b/src/gui/views/network/content.rs index 9e7f2aa..1f6848e 100644 --- a/src/gui/views/network/content.rs +++ b/src/gui/views/network/content.rs @@ -53,7 +53,8 @@ impl NetworkContent { // Show integrated node tabs content. if !show_connections { - egui::TopBottomPanel::bottom("node_tabs_panel") + egui::TopBottomPanel::bottom("node_tabs_content") + .min_height(0.5) .resizable(false) .frame(egui::Frame { inner_margin: Margin { @@ -75,10 +76,24 @@ impl NetworkContent { } // Show current node tab content. - egui::SidePanel::right("node_tab_content_panel") + egui::SidePanel::right("node_tab_content") .resizable(false) .exact_width(ui.available_width()) .frame(egui::Frame { + outer_margin: if !show_connections { + Margin { + left: 0.0, + right: if !dual_panel { + -0.5 + } else { + 0.0 + }, + top: 0.0, + bottom: 0.0, + } + } else { + Margin::ZERO + }, ..Default::default() }) .show_animated_inside(ui, !show_connections, |ui| { @@ -102,6 +117,20 @@ impl NetworkContent { // Show connections content. egui::CentralPanel::default() .frame(egui::Frame { + outer_margin: if show_connections { + Margin { + left: 0.0, + right: if !dual_panel { + -0.5 + } else { + 0.0 + }, + top: 0.0, + bottom: 0.0, + } + } else { + Margin::ZERO + }, ..Default::default() }) .show_inside(ui, |ui| { diff --git a/src/gui/views/root.rs b/src/gui/views/root.rs index cc1261e..0e7701a 100644 --- a/src/gui/views/root.rs +++ b/src/gui/views/root.rs @@ -14,7 +14,7 @@ use std::sync::atomic::{AtomicBool, Ordering}; use egui::os::OperatingSystem; -use egui::{Align, Layout, Margin, RichText}; +use egui::{Align, Layout, RichText}; use lazy_static::lazy_static; use crate::gui::Colors; @@ -115,16 +115,6 @@ impl Root { .resizable(false) .exact_width(panel_width) .frame(egui::Frame { - outer_margin: Margin { - left: 0.0, - right: if dual_panel { - -0.5 - } else { - 0.0 - }, - top: 0.0, - bottom: 0.0, - }, ..Default::default() }) .show_animated_inside(ui, is_panel_open, |ui| { diff --git a/src/gui/views/wallets/wallet/content.rs b/src/gui/views/wallets/wallet/content.rs index d7d29c8..7d66dd5 100644 --- a/src/gui/views/wallets/wallet/content.rs +++ b/src/gui/views/wallets/wallet/content.rs @@ -132,7 +132,7 @@ impl WalletContent { // Show wallet tabs panel. let show_tabs = !Self::block_navigation_on_sync(wallet); - egui::TopBottomPanel::bottom("wallet_tabs") + egui::TopBottomPanel::bottom("wallet_tabs_content") .frame(egui::Frame { fill: Colors::fill(), inner_margin: Margin {