ui: remove functions to calculate network content margins
This commit is contained in:
parent
ff9fcd38f2
commit
e9a7feb7c3
1 changed files with 13 additions and 23 deletions
|
@ -47,8 +47,13 @@ impl NetworkContent {
|
||||||
egui::TopBottomPanel::bottom("network_tabs")
|
egui::TopBottomPanel::bottom("network_tabs")
|
||||||
.frame(egui::Frame {
|
.frame(egui::Frame {
|
||||||
fill: Colors::FILL,
|
fill: Colors::FILL,
|
||||||
inner_margin: Self::tabs_inner_margin(ui, frame),
|
inner_margin: Margin {
|
||||||
..Default::default()
|
left: View::get_left_inset() + 4.0,
|
||||||
|
right: View::far_right_inset_margin(ui, frame) + 4.0,
|
||||||
|
top: 4.0,
|
||||||
|
bottom: View::get_bottom_inset() + 4.0,
|
||||||
|
},
|
||||||
|
..Default::defaulDrawt()
|
||||||
})
|
})
|
||||||
.show_inside(ui, |ui| {
|
.show_inside(ui, |ui| {
|
||||||
self.tabs_ui(ui);
|
self.tabs_ui(ui);
|
||||||
|
@ -58,7 +63,12 @@ impl NetworkContent {
|
||||||
egui::CentralPanel::default()
|
egui::CentralPanel::default()
|
||||||
.frame(egui::Frame {
|
.frame(egui::Frame {
|
||||||
stroke: View::DEFAULT_STROKE,
|
stroke: View::DEFAULT_STROKE,
|
||||||
inner_margin: Self::content_inner_margin(ui, frame),
|
inner_margin: Margin {
|
||||||
|
left: View::get_left_inset() + 4.0,
|
||||||
|
right: View::far_right_inset_margin(ui, frame) + 4.0,
|
||||||
|
top: 3.0,
|
||||||
|
bottom: 4.0,
|
||||||
|
},
|
||||||
fill: Colors::WHITE,
|
fill: Colors::WHITE,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
})
|
})
|
||||||
|
@ -72,26 +82,6 @@ impl NetworkContent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Calculate tabs inner margin based on display insets (cutouts).
|
|
||||||
fn tabs_inner_margin(ui: &mut egui::Ui, frame: &mut eframe::Frame) -> Margin {
|
|
||||||
Margin {
|
|
||||||
left: View::get_left_inset() + 4.0,
|
|
||||||
right: View::far_right_inset_margin(ui, frame) + 4.0,
|
|
||||||
top: 4.0,
|
|
||||||
bottom: View::get_bottom_inset() + 4.0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Calculate content inner margin based on display insets (cutouts).
|
|
||||||
fn content_inner_margin(ui: &mut egui::Ui, frame: &mut eframe::Frame) -> Margin {
|
|
||||||
Margin {
|
|
||||||
left: View::get_left_inset() + 4.0,
|
|
||||||
right: View::far_right_inset_margin(ui, frame) + 4.0,
|
|
||||||
top: 3.0,
|
|
||||||
bottom: 4.0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Draw tab buttons in the bottom of the screen.
|
/// Draw tab buttons in the bottom of the screen.
|
||||||
fn tabs_ui(&mut self, ui: &mut egui::Ui) {
|
fn tabs_ui(&mut self, ui: &mut egui::Ui) {
|
||||||
ui.scope(|ui| {
|
ui.scope(|ui| {
|
||||||
|
|
Loading…
Reference in a new issue