forked from zed-industries/zed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing tooltips for selected buttons (zed-industries#18435)
Reverts zed-industries#13857. Hiding tooltips for selected buttons prevents tooltips like "Close x dock" from showing up, see zed-industries#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 zed-industries#14938 Release Notes: - Fixed an issue where some tooltips would not show up
- Loading branch information
Showing
5 changed files
with
47 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,29 @@ | ||
use gpui::Render; | ||
use gpui::{Render, View}; | ||
use story::{Story, StoryItem, StorySection}; | ||
|
||
use ui::prelude::*; | ||
|
||
use crate::application_menu::ApplicationMenu; | ||
|
||
pub struct ApplicationMenuStory; | ||
pub struct ApplicationMenuStory { | ||
menu: View<ApplicationMenu>, | ||
} | ||
|
||
impl ApplicationMenuStory { | ||
pub fn new(cx: &mut WindowContext) -> Self { | ||
Self { | ||
menu: cx.new_view(ApplicationMenu::new), | ||
} | ||
} | ||
} | ||
|
||
impl Render for ApplicationMenuStory { | ||
fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement { | ||
Story::container() | ||
.child(Story::title_for::<ApplicationMenu>()) | ||
.child(StorySection::new().child(StoryItem::new( | ||
"Application Menu", | ||
h_flex().child(ApplicationMenu::new()), | ||
h_flex().child(self.menu.clone()), | ||
))) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters