From 1198be359b3094a1398d5647301c89c9839d0f5b Mon Sep 17 00:00:00 2001 From: wiiznokes <78230769+wiiznokes@users.noreply.github.com> Date: Mon, 11 Nov 2024 21:10:52 +0100 Subject: [PATCH] use the set_show_context function, and mention it in the doc --- examples/about/src/main.rs | 3 +-- src/app/mod.rs | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/about/src/main.rs b/examples/about/src/main.rs index 4fb8c6c9..fb1a692c 100644 --- a/examples/about/src/main.rs +++ b/examples/about/src/main.rs @@ -110,8 +110,7 @@ impl cosmic::Application for App { fn update(&mut self, message: Self::Message) -> Task { 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) { diff --git a/src/app/mod.rs b/src/app/mod.rs index 17497c20..9d175a63 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -454,6 +454,7 @@ where fn init(core: Core, flags: Self::Flags) -> (Self, Task); /// 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> { None }