fix: apply content padding only when content_container is true
This commit is contained in:
parent
127ce17b85
commit
d34fd5dc2b
1 changed files with 7 additions and 2 deletions
|
|
@ -702,6 +702,11 @@ impl<App: Application> ApplicationExt for App {
|
||||||
let focused = core
|
let focused = core
|
||||||
.focused_window()
|
.focused_window()
|
||||||
.is_some_and(|i| Some(i) == self.core().main_window_id());
|
.is_some_and(|i| Some(i) == self.core().main_window_id());
|
||||||
|
let main_content_padding = if core.window.content_container {
|
||||||
|
[0, 8, 8, 8]
|
||||||
|
} else {
|
||||||
|
[0, 0, 0, 0]
|
||||||
|
};
|
||||||
|
|
||||||
let content_row = crate::widget::row::with_children({
|
let content_row = crate::widget::row::with_children({
|
||||||
let mut widgets = Vec::with_capacity(4);
|
let mut widgets = Vec::with_capacity(4);
|
||||||
|
|
@ -745,13 +750,13 @@ impl<App: Application> ApplicationExt for App {
|
||||||
} else {
|
} else {
|
||||||
//TODO: container and padding are temporary, until
|
//TODO: container and padding are temporary, until
|
||||||
//the `resize_border` is moved to not cover window content
|
//the `resize_border` is moved to not cover window content
|
||||||
widgets.push(container(main_content).padding([0, 8, 8, 8]).into());
|
widgets.push(container(main_content).padding(main_content_padding).into());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//TODO: hide content when out of space
|
//TODO: hide content when out of space
|
||||||
//TODO: container and padding are temporary, until
|
//TODO: container and padding are temporary, until
|
||||||
//the `resize_border` is moved to not cover window content
|
//the `resize_border` is moved to not cover window content
|
||||||
widgets.push(container(main_content).padding([0, 8, 8, 8]).into());
|
widgets.push(container(main_content).padding(main_content_padding).into());
|
||||||
if let Some(context) = self.context_drawer() {
|
if let Some(context) = self.context_drawer() {
|
||||||
widgets.push(
|
widgets.push(
|
||||||
crate::widget::ContextDrawer::new_inner(
|
crate::widget::ContextDrawer::new_inner(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue