summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/src/window.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/runtime/src/window.rs b/runtime/src/window.rs
index cdef70e3..e82d4505 100644
--- a/runtime/src/window.rs
+++ b/runtime/src/window.rs
@@ -167,6 +167,9 @@ pub enum Action {
/// Set the window to be resizable or not.
SetResizable(Id, bool),
+
+ /// Set the window size increment.
+ SetResizeIncrements(Id, Option<Size>),
}
/// Subscribes to the frames of the window of the running application.
@@ -400,6 +403,15 @@ pub fn set_min_size<T>(id: Id, size: Option<Size>) -> Task<T> {
task::effect(crate::Action::Window(Action::SetMinSize(id, size)))
}
+/// Set the window size increment.
+///
+/// This is usually used by apps such as terminal emulators that need "blocky" resizing.
+pub fn set_resize_increments<T>(id: Id, increments: Option<Size>) -> Task<T> {
+ task::effect(crate::Action::Window(Action::SetResizeIncrements(
+ id, increments,
+ )))
+}
+
/// Show the [system menu] at cursor position.
///
/// [system menu]: https://en.wikipedia.org/wiki/Common_menus_in_Microsoft_Windows#System_menu