|
@ -11,8 +11,10 @@ pub enum Order { |
|
|
/// Normal moveable windows that you reorder by click
|
|
|
/// Normal moveable windows that you reorder by click
|
|
|
Middle, |
|
|
Middle, |
|
|
/// Popups, menus etc that should always be painted on top of windows
|
|
|
/// Popups, menus etc that should always be painted on top of windows
|
|
|
Foreground, |
|
|
|
|
|
/// Foreground objects can also have tooltips
|
|
|
/// Foreground objects can also have tooltips
|
|
|
|
|
|
Foreground, |
|
|
|
|
|
/// Things floating on top of everything else, like tooltips.
|
|
|
|
|
|
/// You cannot interact with these.
|
|
|
Tooltip, |
|
|
Tooltip, |
|
|
/// Debug layer, always painted last / on top
|
|
|
/// Debug layer, always painted last / on top
|
|
|
Debug, |
|
|
Debug, |
|
@ -26,6 +28,13 @@ impl Order { |
|
|
Self::Tooltip, |
|
|
Self::Tooltip, |
|
|
Self::Debug, |
|
|
Self::Debug, |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
pub fn allow_interaction(&self) -> bool { |
|
|
|
|
|
match self { |
|
|
|
|
|
Self::Background | Self::Middle | Self::Foreground | Self::Debug => true, |
|
|
|
|
|
Self::Tooltip => false, |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// An identifier for a paint layer.
|
|
|
/// An identifier for a paint layer.
|
|
@ -38,6 +47,10 @@ pub struct LayerId { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
impl LayerId { |
|
|
impl LayerId { |
|
|
|
|
|
pub fn new(order: Order, id: Id) -> Self { |
|
|
|
|
|
Self { order, id } |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
pub fn debug() -> Self { |
|
|
pub fn debug() -> Self { |
|
|
Self { |
|
|
Self { |
|
|
order: Order::Debug, |
|
|
order: Order::Debug, |
|
@ -51,6 +64,10 @@ impl LayerId { |
|
|
id: Id::background(), |
|
|
id: Id::background(), |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn allow_interaction(&self) -> bool { |
|
|
|
|
|
self.order.allow_interaction() |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// A unique identifier of a specific `PaintCmd` in a `PaintList`.
|
|
|
/// A unique identifier of a specific `PaintCmd` in a `PaintList`.
|
|
|