Fix missing tooltips for selected buttons (#18435)

Reverts #13857. Hiding tooltips for selected buttons prevents tooltips
like "Close x dock" from showing up, see #14938 for an example.
The intention of the original PR was to hide the "Show application menu"
tooltip, while the context menu is open.
In order to fix this without breaking other UI elements, we track the
state of the context menu using `PopoverMenuHandle` now, which allows us
to prevent the tooltip from showing up while the context menu is open.

Closes #14938

Release Notes:

- Fixed an issue where some tooltips would not show up
This commit is contained in:
Bennet Bo Fenner 2024-09-27 14:16:14 +02:00 committed by GitHub
parent 1c5d9c221a
commit 73ff8c0f1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 47 additions and 25 deletions

View file

@ -46,7 +46,9 @@ pub enum ComponentStory {
impl ComponentStory {
pub fn story(&self, cx: &mut WindowContext) -> AnyView {
match self {
Self::ApplicationMenu => cx.new_view(|_| title_bar::ApplicationMenuStory).into(),
Self::ApplicationMenu => cx
.new_view(|cx| title_bar::ApplicationMenuStory::new(cx))
.into(),
Self::AutoHeightEditor => AutoHeightEditorStory::new(cx).into(),
Self::Avatar => cx.new_view(|_| ui::AvatarStory).into(),
Self::Button => cx.new_view(|_| ui::ButtonStory).into(),