diff --git a/.vscode/settings.json b/.vscode/settings.json index 681dc12fe15..3e5c2433925 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -33,4 +33,5 @@ "--all-features", ], "rust-analyzer.showUnlinkedFileNotification": false, + "workbench.colorTheme": "CodeSandbox Black", } diff --git a/crates/egui/src/menu.rs b/crates/egui/src/menu.rs index 8faf8e77ceb..064ca828a56 100644 --- a/crates/egui/src/menu.rs +++ b/crates/egui/src/menu.rs @@ -698,7 +698,9 @@ impl MenuState { // We don't close the submenu if the pointer is on its way to hover it. // ensure to repaint once even when pointer is not moving ui.ctx().request_repaint(); - } else if !open && button.hovered() { + } else if !open + && (button.hovered() || self.hovering_current_submenu(&pointer) || button.clicked()) + { // TODO(emilk): open menu to the left if there isn't enough space to the right let mut pos = button.rect.right_top(); pos.x = self.rect.right() + ui.spacing().menu_spacing;