From 82ac0e7bf96d7c130108159a8b933ddfb39233fd Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 6 Jan 2025 23:24:01 +0100 Subject: Rename `window::resizable` to `window::set_resizable` --- runtime/src/window.rs | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'runtime') diff --git a/runtime/src/window.rs b/runtime/src/window.rs index 9be61315..ab805e52 100644 --- a/runtime/src/window.rs +++ b/runtime/src/window.rs @@ -278,10 +278,29 @@ pub fn resize(id: Id, new_size: Size) -> Task { } /// Set the window to be resizable or not. -pub fn resizable(id: Id, resizable: bool) -> Task { +pub fn set_resizable(id: Id, resizable: bool) -> Task { task::effect(crate::Action::Window(Action::SetResizable(id, resizable))) } +/// Set the inner maximum size of the window. +pub fn set_max_size(id: Id, size: Option) -> Task { + task::effect(crate::Action::Window(Action::SetMaxSize(id, size))) +} + +/// Set the inner minimum size of the window. +pub fn set_min_size(id: Id, size: Option) -> Task { + 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(id: Id, increments: Option) -> Task { + task::effect(crate::Action::Window(Action::SetResizeIncrements( + id, increments, + ))) +} + /// Get the window's size in logical dimensions. pub fn get_size(id: Id) -> Task { task::oneshot(move |channel| { @@ -385,25 +404,6 @@ pub fn change_level(id: Id, level: Level) -> Task { task::effect(crate::Action::Window(Action::ChangeLevel(id, level))) } -/// Set the inner maximum size of the window. -pub fn set_max_size(id: Id, size: Option) -> Task { - task::effect(crate::Action::Window(Action::SetMaxSize(id, size))) -} - -/// Set the inner minimum size of the window. -pub fn set_min_size(id: Id, size: Option) -> Task { - 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(id: Id, increments: Option) -> Task { - 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 -- cgit