diff --git a/src/app/core.rs b/src/app/core.rs index 8655be8f..f23217c9 100644 --- a/src/app/core.rs +++ b/src/app/core.rs @@ -109,6 +109,16 @@ impl Core { self.is_condensed_update(); } + /// Set context drawer header title + pub fn set_context_title(&mut self, title: String) { + self.window.context_title = title; + } + + /// Set header bar title + pub fn set_header_title(&mut self, title: String) { + self.window.header_title = title; + } + /// Whether to show or hide the main window's content. pub(crate) fn show_content(&self) -> bool { !self.is_condensed || !self.nav_bar.toggled_condensed diff --git a/src/app/mod.rs b/src/app/mod.rs index b4af3177..c2481297 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -229,6 +229,16 @@ pub trait ApplicationExt: Application { /// Get the title of the main window. fn title(&self) -> &str; + /// Set the context drawer title. + fn set_context_title(&mut self, title: String) { + self.core_mut().set_context_title(title); + } + + /// Set the header bar title. + fn set_header_title(&mut self, title: String) { + self.core_mut().set_header_title(title); + } + /// Set the title of the main window. fn set_title(&mut self, title: String) -> iced::Command>;