ui: fix panels margins

This commit is contained in:
ardocrat 2024-07-01 18:58:54 +03:00
parent 262cfdfca9
commit dafd2a1db3
3 changed files with 33 additions and 14 deletions

View file

@ -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| {

View file

@ -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| {

View file

@ -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 {