Remove on_click_out handler from context menu
Add 'delay_cancel()' method and on_down handler to relevant buttons
This commit is contained in:
parent
6ffa6afd20
commit
5366631173
6 changed files with 79 additions and 27 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue