Titlebar project menu double click (#3784)
This addresses a bug where popover menus in the titlebar were rendered only after a 2nd click. The first click was creating the View which the second one then rendered. In addition to this, `PopoverMenu::menu` function argument can now return an `Option<View<T>>` instead of `View<T>` as the creation of the menu can fail (as it might in case of git popover). Release Notes: - N/A
This commit is contained in:
@@ -102,8 +102,10 @@ impl Render for CopilotButton {
|
||||
div().child(
|
||||
popover_menu("copilot")
|
||||
.menu(move |cx| match status {
|
||||
Status::Authorized => this.update(cx, |this, cx| this.build_copilot_menu(cx)),
|
||||
_ => this.update(cx, |this, cx| this.build_copilot_start_menu(cx)),
|
||||
Status::Authorized => {
|
||||
Some(this.update(cx, |this, cx| this.build_copilot_menu(cx)))
|
||||
}
|
||||
_ => Some(this.update(cx, |this, cx| this.build_copilot_start_menu(cx))),
|
||||
})
|
||||
.anchor(AnchorCorner::BottomRight)
|
||||
.trigger(
|
||||
|
||||
Reference in New Issue
Block a user