Merge pull request #953 from hecrj/fix/pane-grid-title-bar-overlay
Fix implementation of `Widget::overlay` for `pane_grid::TitleBar`
This commit is contained in:
commit
a6dbaf0f5f
1 changed files with 17 additions and 1 deletions
|
|
@ -248,6 +248,22 @@ where
|
||||||
&mut self,
|
&mut self,
|
||||||
layout: Layout<'_>,
|
layout: Layout<'_>,
|
||||||
) -> Option<overlay::Element<'_, Message, Renderer>> {
|
) -> Option<overlay::Element<'_, Message, Renderer>> {
|
||||||
self.content.overlay(layout)
|
let mut children = layout.children();
|
||||||
|
let padded = children.next()?;
|
||||||
|
|
||||||
|
let mut children = padded.children();
|
||||||
|
let title_layout = children.next()?;
|
||||||
|
|
||||||
|
let Self {
|
||||||
|
content, controls, ..
|
||||||
|
} = self;
|
||||||
|
|
||||||
|
content.overlay(title_layout).or_else(move || {
|
||||||
|
controls.as_mut().and_then(|controls| {
|
||||||
|
let controls_layout = children.next()?;
|
||||||
|
|
||||||
|
controls.overlay(controls_layout)
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue