Checkpoint – Broken

This commit is contained in:
Nate Butler 2023-10-19 12:58:17 -04:00
parent b16d37953d
commit bca97f7186
33 changed files with 183 additions and 127 deletions

View file

@ -21,27 +21,22 @@ impl BufferSearch {
}
pub fn view(cx: &mut WindowContext) -> View<Self> {
let theme = theme(cx);
let color = ThemeColor::new(cx);
view(cx.entity(|cx| Self::new()), Self::render)
}
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element<ViewState = Self> {
let theme = theme(cx);
let color = ThemeColor::new(cx);
h_stack()
.bg(theme.highest.base.default.background)
.p_2()
.child(
h_stack()
.child(Input::new("Search (↑/↓ for previous/next query)"))
.child(
IconButton::<Self>::new(Icon::Replace)
.when(self.is_replace_open, |this| this.color(IconColor::Accent))
.on_click(|buffer_search, cx| {
buffer_search.toggle_replace(cx);
}),
),
)
h_stack().bg(color.toolbar_background).p_2().child(
h_stack().child(Input::new("Search")).child(
IconButton::<Self>::new(Icon::Replace)
.when(self.is_replace_open, |this| this.color(IconColor::Accent))
.on_click(|buffer_search, cx| {
buffer_search.toggle_replace(cx);
}),
),
)
}
}