Allow specifying a custom height for stacking contexts
This commit is contained in:
parent
2055f05b09
commit
dfe2fd0386
6 changed files with 21 additions and 10 deletions
|
@ -16,6 +16,7 @@ pub struct Overlay {
|
|||
fit_mode: OverlayFitMode,
|
||||
position_mode: OverlayPositionMode,
|
||||
hoverable: bool,
|
||||
height: Option<usize>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
|
@ -82,6 +83,7 @@ impl Overlay {
|
|||
fit_mode: OverlayFitMode::None,
|
||||
position_mode: OverlayPositionMode::Window,
|
||||
hoverable: false,
|
||||
height: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -109,6 +111,11 @@ impl Overlay {
|
|||
self.hoverable = hoverable;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_height(mut self, height: usize) -> Self {
|
||||
self.height = Some(height);
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl Element for Overlay {
|
||||
|
@ -204,7 +211,7 @@ impl Element for Overlay {
|
|||
OverlayFitMode::None => {}
|
||||
}
|
||||
|
||||
cx.paint_stacking_context(None, |cx| {
|
||||
cx.paint_stacking_context(None, self.height, |cx| {
|
||||
if self.hoverable {
|
||||
enum OverlayHoverCapture {}
|
||||
// Block hovers in lower stacking contexts
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue