This commit is contained in:
Nathan Sobo
2023-04-11 18:21:56 -06:00
parent 3de8fe0f87
commit e115baa60c
94 changed files with 1477 additions and 1310 deletions
+5 -10
View File
@@ -9,8 +9,7 @@ use gpui::{
elements::*,
impl_actions,
platform::{CursorStyle, MouseButton},
Action, AnyViewHandle, AppContext, Entity, RenderContext, Subscription, Task, View,
ViewContext, ViewHandle,
Action, AnyViewHandle, AppContext, Entity, Subscription, Task, View, ViewContext, ViewHandle,
};
use project::search::SearchQuery;
use serde::Deserialize;
@@ -92,7 +91,7 @@ impl View for BufferSearchBar {
}
}
fn render(&mut self, cx: &mut RenderContext<Self>) -> ElementBox {
fn render(&mut self, cx: &mut ViewContext<Self>) -> ElementBox {
let theme = cx.global::<Settings>().theme.clone();
let editor_container = if self.query_contains_error {
theme.search.invalid_editor
@@ -324,7 +323,7 @@ impl BufferSearchBar {
option_supported: bool,
icon: &'static str,
option: SearchOption,
cx: &mut RenderContext<Self>,
cx: &mut ViewContext<Self>,
) -> Option<ElementBox> {
if !option_supported {
return None;
@@ -364,7 +363,7 @@ impl BufferSearchBar {
&self,
icon: &'static str,
direction: Direction,
cx: &mut RenderContext<Self>,
cx: &mut ViewContext<Self>,
) -> ElementBox {
let action: Box<dyn Action>;
let tooltip;
@@ -408,11 +407,7 @@ impl BufferSearchBar {
.boxed()
}
fn render_close_button(
&self,
theme: &theme::Search,
cx: &mut RenderContext<Self>,
) -> ElementBox {
fn render_close_button(&self, theme: &theme::Search, cx: &mut ViewContext<Self>) -> ElementBox {
let action = Box::new(Dismiss);
let tooltip = "Dismiss Buffer Search";
let tooltip_style = cx.global::<Settings>().theme.tooltip.clone();
+6 -7
View File
@@ -12,9 +12,8 @@ use gpui::{
actions,
elements::*,
platform::{CursorStyle, MouseButton},
Action, AnyViewHandle, AppContext, Entity, ModelContext, ModelHandle, RenderContext,
Subscription, Task, View, ViewContext, ElementBox, ViewHandle, WeakModelHandle,
WeakViewHandle,
Action, AnyViewHandle, AppContext, ElementBox, Entity, ModelContext, ModelHandle, Subscription,
Task, View, ViewContext, ViewHandle, WeakModelHandle, WeakViewHandle,
};
use menu::Confirm;
use project::{search::SearchQuery, Project};
@@ -178,7 +177,7 @@ impl View for ProjectSearchView {
"ProjectSearchView"
}
fn render(&mut self, cx: &mut RenderContext<Self>) -> ElementBox {
fn render(&mut self, cx: &mut ViewContext<Self>) -> ElementBox {
let model = &self.model.read(cx);
if model.match_ranges.is_empty() {
enum Status {}
@@ -747,7 +746,7 @@ impl ProjectSearchBar {
&self,
icon: &'static str,
direction: Direction,
cx: &mut RenderContext<Self>,
cx: &mut ViewContext<Self>,
) -> ElementBox {
let action: Box<dyn Action>;
let tooltip;
@@ -795,7 +794,7 @@ impl ProjectSearchBar {
&self,
icon: &'static str,
option: SearchOption,
cx: &mut RenderContext<Self>,
cx: &mut ViewContext<Self>,
) -> ElementBox {
let tooltip_style = cx.global::<Settings>().theme.tooltip.clone();
let is_active = self.is_option_enabled(option, cx);
@@ -848,7 +847,7 @@ impl View for ProjectSearchBar {
"ProjectSearchBar"
}
fn render(&mut self, cx: &mut RenderContext<Self>) -> ElementBox {
fn render(&mut self, cx: &mut ViewContext<Self>) -> ElementBox {
if let Some(search) = self.active_project_search.as_ref() {
let search = search.read(cx);
let theme = cx.global::<Settings>().theme.clone();