core: layer deferred surfaces with draw priorities

This commit is contained in:
2026-11-13 03:38:44 +07:00
parent 306644e581
commit dad833f998
8 changed files with 58 additions and 36 deletions
+7
View File
@@ -6,6 +6,13 @@ pub use gpui_native_utils::{StyledExt, h_flex, v_flex};
/// A handler told to clean up after a dismissed surface.
pub type DismissHandler = std::rc::Rc<dyn Fn(&mut gpui::App)>;
/// Deferred draw priority of window-modal surfaces; default layer 0 stays for in-flow chrome like resize handles.
pub const DIALOG_LAYER: usize = 1;
/// Deferred draw priority of floating panels, so controls inside a dialog open above it.
pub const OVERLAY_LAYER: usize = 2;
/// Deferred draw priority of passive notifications, so they stay visible over dialogs.
pub const TOAST_LAYER: usize = 3;
/// A component that can be told which size to render at.
pub trait Sizable: Sized {
/// Sets the size.