summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2023-02-17 13:39:58 +0100
committerLibravatar GitHub <noreply@github.com>2023-02-17 13:39:58 +0100
commitb9b0a9a1f400483f46ec053247c435ec7739f778 (patch)
tree9211457e4a8366b4c730cc0aea1ebd10bd0aee0b /native
parent871f59f3be640acc8ce2760108a73b8ada846df1 (diff)
parentdb65c6904d38fe37ad0c31a11242d55f5f773c94 (diff)
downloadiced-b9b0a9a1f400483f46ec053247c435ec7739f778.tar.gz
iced-b9b0a9a1f400483f46ec053247c435ec7739f778.tar.bz2
iced-b9b0a9a1f400483f46ec053247c435ec7739f778.zip
Merge pull request #1587 from Night-Hunter-NF/AlwaysOnTop
add always on top action
Diffstat (limited to 'native')
-rw-r--r--native/src/window/action.rs24
1 files changed, 20 insertions, 4 deletions
diff --git a/native/src/window/action.rs b/native/src/window/action.rs
index 168974bc..c6361449 100644
--- a/native/src/window/action.rs
+++ b/native/src/window/action.rs
@@ -70,6 +70,12 @@ pub enum Action<T> {
///
/// - **Web / Wayland:** Unsupported.
GainFocus,
+ /// Change whether or not the window will always be on top of other windows.
+ ///
+ /// ## Platform-specific
+ ///
+ /// - **Web / Wayland:** Unsupported.
+ ChangeAlwaysOnTop(bool),
}
impl<T> Action<T> {
@@ -85,8 +91,8 @@ impl<T> Action<T> {
Self::Close => Action::Close,
Self::Drag => Action::Drag,
Self::Resize { width, height } => Action::Resize { width, height },
- Self::Maximize(bool) => Action::Maximize(bool),
- Self::Minimize(bool) => Action::Minimize(bool),
+ Self::Maximize(maximized) => Action::Maximize(maximized),
+ Self::Minimize(minimized) => Action::Minimize(minimized),
Self::Move { x, y } => Action::Move { x, y },
Self::ChangeMode(mode) => Action::ChangeMode(mode),
Self::FetchMode(o) => Action::FetchMode(Box::new(move |s| f(o(s)))),
@@ -96,6 +102,9 @@ impl<T> Action<T> {
Action::RequestUserAttention(attention_type)
}
Self::GainFocus => Action::GainFocus,
+ Self::ChangeAlwaysOnTop(on_top) => {
+ Action::ChangeAlwaysOnTop(on_top)
+ }
}
}
}
@@ -109,8 +118,12 @@ impl<T> fmt::Debug for Action<T> {
f,
"Action::Resize {{ widget: {width}, height: {height} }}"
),
- Self::Maximize(value) => write!(f, "Action::Maximize({value})"),
- Self::Minimize(value) => write!(f, "Action::Minimize({value}"),
+ Self::Maximize(maximized) => {
+ write!(f, "Action::Maximize({maximized})")
+ }
+ Self::Minimize(minimized) => {
+ write!(f, "Action::Minimize({minimized}")
+ }
Self::Move { x, y } => {
write!(f, "Action::Move {{ x: {x}, y: {y} }}")
}
@@ -122,6 +135,9 @@ impl<T> fmt::Debug for Action<T> {
write!(f, "Action::RequestUserAttention")
}
Self::GainFocus => write!(f, "Action::GainFocus"),
+ Self::ChangeAlwaysOnTop(on_top) => {
+ write!(f, "Action::AlwaysOnTop({on_top})")
+ }
}
}
}