From ca8aaf9b8daa3d8b925165fb912af425438d4e79 Mon Sep 17 00:00:00 2001 From: JL710 <76447362+JL710@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:51:44 +0200 Subject: add Task and Action for changing a window title --- 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 0ebdba2f..b5c6ee50 100644 --- a/runtime/src/window.rs +++ b/runtime/src/window.rs @@ -73,6 +73,9 @@ pub enum Action { /// Get the current [`Mode`] of the window. GetMode(Id, oneshot::Sender), + /// Change the title of the window. + ChangeTitle(Id, String), + /// Toggle the window to maximized or back ToggleMaximize(Id), @@ -368,6 +371,11 @@ pub fn change_level(id: Id, level: Level) -> Task { task::effect(crate::Action::Window(Action::ChangeLevel(id, level))) } +/// Changes the title of the window. +pub fn change_title(id: Id, title: String) -> Task { + task::effect(crate::Action::Window(Action::ChangeTitle(id, title))) +} + /// Show the [system menu] at cursor position. /// /// [system menu]: https://en.wikipedia.org/wiki/Common_menus_in_Microsoft_Windows#System_menu -- cgit