From f5f075e5cdff84a58c181c498653b7ab66c9531a Mon Sep 17 00:00:00 2001 From: JL710 <76447362+JL710@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:16:52 +0200 Subject: window resizable task --- runtime/src/window.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'runtime') diff --git a/runtime/src/window.rs b/runtime/src/window.rs index 598ee491..cdef70e3 100644 --- a/runtime/src/window.rs +++ b/runtime/src/window.rs @@ -164,6 +164,9 @@ pub enum Action { /// Set the maximum inner window size. SetMaxSize(Id, Option), + + /// Set the window to be resizable or not. + SetResizable(Id, bool), } /// Subscribes to the frames of the window of the running application. @@ -274,6 +277,11 @@ pub fn resize(id: Id, new_size: Size) -> Task { task::effect(crate::Action::Window(Action::Resize(id, new_size))) } +/// Set the window to be resizable or not. +pub fn resizable(id: Id, resizable: bool) -> Task { + task::effect(crate::Action::Window(Action::SetResizable(id, resizable))) +} + /// Get the window's size in logical dimensions. pub fn get_size(id: Id) -> Task { task::oneshot(move |channel| { -- cgit