feat(app): set_context_title and set_header_title methods for ApplicationExt and Core
This commit is contained in:
parent
d620531e7e
commit
a04c74f240
2 changed files with 20 additions and 0 deletions
|
|
@ -109,6 +109,16 @@ impl Core {
|
||||||
self.is_condensed_update();
|
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.
|
/// Whether to show or hide the main window's content.
|
||||||
pub(crate) fn show_content(&self) -> bool {
|
pub(crate) fn show_content(&self) -> bool {
|
||||||
!self.is_condensed || !self.nav_bar.toggled_condensed
|
!self.is_condensed || !self.nav_bar.toggled_condensed
|
||||||
|
|
|
||||||
|
|
@ -229,6 +229,16 @@ pub trait ApplicationExt: Application {
|
||||||
/// Get the title of the main window.
|
/// Get the title of the main window.
|
||||||
fn title(&self) -> &str;
|
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.
|
/// Set the title of the main window.
|
||||||
fn set_title(&mut self, title: String) -> iced::Command<Message<Self::Message>>;
|
fn set_title(&mut self, title: String) -> iced::Command<Message<Self::Message>>;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue