diff --git a/assets/keymaps/default.json b/assets/keymaps/default.json index 9fbe89975fdb9d38d7681849fce54144b67b9148..2f13ee6d0378c17f62bdd1d01025ad9dafcfe913 100644 --- a/assets/keymaps/default.json +++ b/assets/keymaps/default.json @@ -238,7 +238,7 @@ "context": "ProjectSearchBar", "bindings": { "escape": "project_search::ToggleFocus", - "alt-tab": "project_search::CycleMode", + "alt-tab": "project_search::CycleMode" } }, { diff --git a/crates/ai/src/assistant.rs b/crates/ai/src/assistant.rs index 957c5e1c063aad3de12657448267d0f813f38887..fa81d6a40095a4d87e63641519e1f3a7e14edb54 100644 --- a/crates/ai/src/assistant.rs +++ b/crates/ai/src/assistant.rs @@ -158,7 +158,7 @@ impl AssistantPanel { }); let toolbar = cx.add_view(|cx| { - let mut toolbar = Toolbar::new(None); + let mut toolbar = Toolbar::new(); toolbar.set_can_navigate(false, cx); toolbar.add_item(cx.add_view(|cx| BufferSearchBar::new(cx)), cx); toolbar diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs index be1460f200d1b363157a7051b806185ff5ba7484..3a4c85b24cecfc26052e67020e4e4ad67f2476ca 100644 --- a/crates/workspace/src/pane.rs +++ b/crates/workspace/src/pane.rs @@ -308,7 +308,7 @@ impl Pane { pane: handle.clone(), next_timestamp, }))), - toolbar: cx.add_view(|_| Toolbar::new(Some(handle))), + toolbar: cx.add_view(|_| Toolbar::new()), tab_bar_context_menu: TabBarContextMenu { kind: TabBarContextMenuKind::New, handle: context_menu, diff --git a/crates/workspace/src/toolbar.rs b/crates/workspace/src/toolbar.rs index 1d6e8b7e4b97af18e54b07fa5685d26c72b626e6..a7c00cbe0fe20b3a845ea2998347ae0ae766c9b3 100644 --- a/crates/workspace/src/toolbar.rs +++ b/crates/workspace/src/toolbar.rs @@ -54,7 +54,6 @@ pub struct Toolbar { active_item: Option>, hidden: bool, can_navigate: bool, - pane: Option>, items: Vec<(Box, ToolbarItemLocation)>, } @@ -144,63 +143,10 @@ impl View for Toolbar { } } -#[allow(clippy::too_many_arguments)] -fn nav_button)>( - svg_path: &'static str, - style: theme::Interactive, - nav_button_height: f32, - tooltip_style: TooltipStyle, - enabled: bool, - spacing: f32, - on_click: F, - tooltip_action: A, - action_name: &str, - cx: &mut ViewContext, -) -> AnyElement { - MouseEventHandler::::new(0, cx, |state, _| { - let style = if enabled { - style.style_for(state) - } else { - style.disabled_style() - }; - Svg::new(svg_path) - .with_color(style.color) - .constrained() - .with_width(style.icon_width) - .aligned() - .contained() - .with_style(style.container) - .constrained() - .with_width(style.button_width) - .with_height(nav_button_height) - .aligned() - .top() - }) - .with_cursor_style(if enabled { - CursorStyle::PointingHand - } else { - CursorStyle::default() - }) - .on_click(MouseButton::Left, move |_, toolbar, cx| { - on_click(toolbar, cx) - }) - .with_tooltip::( - 0, - action_name.to_string(), - Some(Box::new(tooltip_action)), - tooltip_style, - cx, - ) - .contained() - .with_margin_right(spacing) - .into_any_named("nav button") -} - impl Toolbar { - pub fn new(pane: Option>) -> Self { + pub fn new() -> Self { Self { active_item: None, - pane, items: Default::default(), hidden: false, can_navigate: true, diff --git a/styles/src/style_tree/tab_bar.ts b/styles/src/style_tree/tab_bar.ts index f27ae4b2e6a16d4e70cbda2c7129e723bce67a7a..73b9e82d0c2796fea1a5ab28494093be930a9a2b 100644 --- a/styles/src/style_tree/tab_bar.ts +++ b/styles/src/style_tree/tab_bar.ts @@ -100,7 +100,7 @@ export default function tab_bar(): any { color: foreground(theme.highest, "on", "disabled"), }, }, - }); + }) const dragged_tab = { ...active_pane_active_tab, background: with_opacity(tab.background, 0.9), diff --git a/styles/src/style_tree/workspace.ts b/styles/src/style_tree/workspace.ts index 5aee3c987d34b75d25db5bc9ad69f4d2a0938f7b..c78b9b2909c68dcfa9d67bf73fb781ad5497c4e8 100644 --- a/styles/src/style_tree/workspace.ts +++ b/styles/src/style_tree/workspace.ts @@ -132,23 +132,6 @@ export default function workspace(): any { background: background(theme.highest), border: border(theme.highest, { bottom: true }), item_spacing: 8, - nav_button: interactive({ - base: { - color: foreground(theme.highest, "on"), - icon_width: 12, - button_width: 24, - corner_radius: 6, - }, - state: { - hovered: { - color: foreground(theme.highest, "on", "hovered"), - background: background(theme.highest, "on", "hovered"), - }, - disabled: { - color: foreground(theme.highest, "on", "disabled"), - }, - }, - }), padding: { left: 8, right: 8, top: 4, bottom: 4 }, }, breadcrumb_height: 24,