summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-05-25 23:14:07 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-05-25 23:14:07 +0200
commita7fa7e40058188c95a790712e11b863a9f84cecb (patch)
tree988852e1e54e4af416332108983ee4ccf91e912a /core
parentb924e866308d60432729932afc4c642a00575c43 (diff)
downloadiced-a7fa7e40058188c95a790712e11b863a9f84cecb.tar.gz
iced-a7fa7e40058188c95a790712e11b863a9f84cecb.tar.bz2
iced-a7fa7e40058188c95a790712e11b863a9f84cecb.zip
Introduce `window::Level` enum
... and add `level` field to `window::Settings`
Diffstat (limited to 'core')
-rw-r--r--core/src/window.rs2
-rw-r--r--core/src/window/level.rs19
2 files changed, 21 insertions, 0 deletions
diff --git a/core/src/window.rs b/core/src/window.rs
index 81bd7e3d..a6dbdfb4 100644
--- a/core/src/window.rs
+++ b/core/src/window.rs
@@ -2,12 +2,14 @@
pub mod icon;
mod event;
+mod level;
mod mode;
mod redraw_request;
mod user_attention;
pub use event::Event;
pub use icon::Icon;
+pub use level::Level;
pub use mode::Mode;
pub use redraw_request::RedrawRequest;
pub use user_attention::UserAttention;
diff --git a/core/src/window/level.rs b/core/src/window/level.rs
new file mode 100644
index 00000000..3878ecac
--- /dev/null
+++ b/core/src/window/level.rs
@@ -0,0 +1,19 @@
+/// A window level groups windows with respect to their z-position.
+///
+/// The relative ordering between windows in different window levels is fixed.
+/// The z-order of a window within the same window level may change dynamically
+/// on user interaction.
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
+pub enum Level {
+ /// The default behavior.
+ #[default]
+ Normal,
+
+ /// The window will always be below normal windows.
+ ///
+ /// This is useful for a widget-based app.
+ AlwaysOnBottom,
+
+ /// The window will always be on top of normal windows.
+ AlwaysOnTop,
+}