Pass KeyBindings to TextTooltips

This commit is contained in:
Marshall Bowers 2023-11-14 13:36:03 -05:00
parent aa1471948f
commit 90d7033fd0
3 changed files with 25 additions and 19 deletions

View file

@ -69,7 +69,7 @@ use std::{
};
use theme2::ActiveTheme;
pub use toolbar::{ToolbarItemLocation, ToolbarItemView};
use ui::{h_stack, Button, ButtonVariant, Label, LabelColor, TextTooltip};
use ui::{h_stack, Button, ButtonVariant, KeyBinding, Label, LabelColor, TextTooltip};
use util::ResultExt;
use uuid::Uuid;
use workspace_settings::{AutosaveSetting, WorkspaceSettings};
@ -2502,9 +2502,17 @@ impl Workspace {
.color(Some(LabelColor::Muted)),
)
.tooltip(move |_, cx| {
// todo!() Replace with real action.
#[gpui::action]
struct NoAction {}
cx.build_view(|cx| {
TextTooltip::new("Recent Branches")
.keybinding("⌘B")
.key_binding(KeyBinding::new(gpui::KeyBinding::new(
"cmd-b",
NoAction {},
None,
)))
.meta("Only local branches shown")
})
}),