Allow apps to return a command when context drawer is toggled
This commit is contained in:
parent
5b2ac941c3
commit
68c760e652
2 changed files with 6 additions and 0 deletions
|
|
@ -332,6 +332,7 @@ impl<T: Application> Cosmic<T> {
|
||||||
|
|
||||||
Message::ContextDrawer(show) => {
|
Message::ContextDrawer(show) => {
|
||||||
self.app.core_mut().window.show_context = show;
|
self.app.core_mut().window.show_context = show;
|
||||||
|
return self.app.on_context_drawer();
|
||||||
}
|
}
|
||||||
|
|
||||||
Message::Drag => return command::drag(None),
|
Message::Drag => return command::drag(None),
|
||||||
|
|
|
||||||
|
|
@ -440,6 +440,11 @@ where
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Called when context drawer is toggled
|
||||||
|
fn on_context_drawer(&mut self) -> iced::Command<Message<Self::Message>> {
|
||||||
|
iced::Command::none()
|
||||||
|
}
|
||||||
|
|
||||||
/// Called when the escape key is pressed.
|
/// Called when the escape key is pressed.
|
||||||
fn on_escape(&mut self) -> iced::Command<Message<Self::Message>> {
|
fn on_escape(&mut self) -> iced::Command<Message<Self::Message>> {
|
||||||
iced::Command::none()
|
iced::Command::none()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue