Remove on_click_out handler from context menu

Add 'delay_cancel()' method and on_down handler to relevant buttons
This commit is contained in:
Mikayla Maki 2023-06-29 17:10:51 -07:00
parent 6ffa6afd20
commit 5366631173
No known key found for this signature in database
6 changed files with 79 additions and 27 deletions

View file

@ -102,6 +102,9 @@ impl View for CopilotButton {
}
})
.with_cursor_style(CursorStyle::PointingHand)
.on_down(MouseButton::Left, |_, this, cx| {
this.popup_menu.update(cx, |menu, _| menu.delay_cancel());
})
.on_click(MouseButton::Left, {
let status = status.clone();
move |_, this, cx| match status {
@ -186,7 +189,7 @@ impl CopilotButton {
}));
self.popup_menu.update(cx, |menu, cx| {
menu.show(
menu.toggle(
Default::default(),
AnchorCorner::BottomRight,
menu_options,
@ -266,7 +269,7 @@ impl CopilotButton {
menu_options.push(ContextMenuItem::action("Sign Out", SignOut));
self.popup_menu.update(cx, |menu, cx| {
menu.show(
menu.toggle(
Default::default(),
AnchorCorner::BottomRight,
menu_options,