use the set_show_context function, and mention it in the doc

This commit is contained in:
wiiznokes 2024-11-11 21:10:52 +01:00
parent 98aed56e6a
commit 1198be359b
2 changed files with 2 additions and 2 deletions

View file

@ -110,8 +110,7 @@ impl cosmic::Application for App {
fn update(&mut self, message: Self::Message) -> Task<Self::Message> {
match message {
Message::ToggleAbout => {
self.core.window.show_context = !self.core.window.show_context;
self.core.set_show_context(self.core.window.show_context);
self.set_show_context(!self.core.window.show_context);
self.show_about = !self.show_about;
}
Message::Open(url) => match open::that_detached(url) {

View file

@ -454,6 +454,7 @@ where
fn init(core: Core, flags: Self::Flags) -> (Self, Task<Self::Message>);
/// Displays a context drawer on the side of the application window when `Some`.
/// Use the [`ApplicationExt::set_show_context`] function for this to take effect.
fn context_drawer(&self) -> Option<ContextDrawer<Self::Message>> {
None
}