Allow specifying a custom height for stacking contexts
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -149,7 +149,7 @@ impl Element for Resizable {
|
||||
_child_size: &mut Self::LayoutState,
|
||||
cx: &mut crate::PaintContext,
|
||||
) -> Self::PaintState {
|
||||
cx.scene.push_stacking_context(None);
|
||||
cx.scene.push_stacking_context(None, None);
|
||||
|
||||
let handle_region = self.side.of_rect(bounds, self.handle_size);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user