search_bar.rs

 1use gpui::{ClickEvent, IntoElement, WindowContext};
 2use ui::prelude::*;
 3use ui::{Button, IconButton};
 4
 5use crate::mode::SearchMode;
 6
 7pub(super) fn render_nav_button(
 8    icon: ui::Icon,
 9    _active: bool,
10    on_click: impl Fn(&ClickEvent, &mut WindowContext) + 'static,
11) -> impl IntoElement {
12    // let tooltip_style = cx.theme().tooltip.clone();
13    // let cursor_style = if active {
14    //     CursorStyle::PointingHand
15    // } else {
16    //     CursorStyle::default()
17    // };
18    // enum NavButton {}
19    IconButton::new("search-nav-button", icon).on_click(on_click)
20}
21
22pub(crate) fn render_search_mode_button(
23    mode: SearchMode,
24    is_active: bool,
25    on_click: impl Fn(&ClickEvent, &mut WindowContext) + 'static,
26) -> Button {
27    Button::new(mode.label(), mode.label())
28        .selected(is_active)
29        .on_click(on_click)
30}