Skip to content

Commit

Permalink
Fix spacing issue introduced in pop-os#614
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Sep 20, 2024
1 parent e56a94b commit ddb678c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ impl<App: Application> ApplicationExt for App {
.is_some_and(|i| i == self.main_window_id());

let content_row = crate::widget::row::with_children({
let mut widgets = Vec::with_capacity(3);
let mut widgets = Vec::with_capacity(4);

// Insert nav bar onto the left side of the window.
if let Some(nav) = self
Expand All @@ -664,6 +664,11 @@ impl<App: Application> ApplicationExt for App {
}

if self.nav_model().is_none() || core.show_content() {
// Manual spacing must be used due to state workarounds below
if !widgets.is_empty() {
widgets.push(horizontal_space(Length::Fixed(8.0)).into());
}

widgets.push(self.view().map(Message::App));

if let Some(context) = self.context_drawer() {
Expand All @@ -676,7 +681,8 @@ impl<App: Application> ApplicationExt for App {
Length::Shrink
} else {
//TODO: this width must be synced with the context drawer width
Length::Fixed(480.0)
// Manual spacing must be used due to state workarounds below
Length::Fixed(480.0 + 8.0)
}),
context.map(Message::App),
)
Expand All @@ -688,14 +694,13 @@ impl<App: Application> ApplicationExt for App {
}),
);
} else {
//TODO: this element is added to prevent state issues
//TODO: this element is added to workaround state issues
widgets.push(horizontal_space(Length::Shrink).into());
}
}

widgets
})
.spacing(8);
});
let content: Element<_> = if core.window.content_container {
content_row
.apply(crate::widget::container)
Expand Down

0 comments on commit ddb678c

Please sign in to comment.