Rename window::resizable to window::set_resizable

This commit is contained in:
Héctor Ramón Jiménez 2025-01-06 23:24:01 +01:00
parent 91fd6d395f
commit 82ac0e7bf9
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -278,10 +278,29 @@ pub fn resize<T>(id: Id, new_size: Size) -> Task<T> {
}
/// Set the window to be resizable or not.
pub fn resizable<T>(id: Id, resizable: bool) -> Task<T> {
pub fn set_resizable<T>(id: Id, resizable: bool) -> Task<T> {
task::effect(crate::Action::Window(Action::SetResizable(id, resizable)))
}
/// Set the inner maximum size of the window.
pub fn set_max_size<T>(id: Id, size: Option<Size>) -> Task<T> {
task::effect(crate::Action::Window(Action::SetMaxSize(id, size)))
}
/// Set the inner minimum size of the window.
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,
)))
}
/// Get the window's size in logical dimensions.
pub fn get_size(id: Id) -> Task<Size> {
task::oneshot(move |channel| {
@ -385,25 +404,6 @@ pub fn change_level<T>(id: Id, level: Level) -> Task<T> {
task::effect(crate::Action::Window(Action::ChangeLevel(id, level)))
}
/// Set the inner maximum size of the window.
pub fn set_max_size<T>(id: Id, size: Option<Size>) -> Task<T> {
task::effect(crate::Action::Window(Action::SetMaxSize(id, size)))
}
/// Set the inner minimum size of the window.
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