Merge branch 'main' into theme-improvements

This commit is contained in:
Nate Butler 2022-07-19 20:12:02 -04:00
commit bcc554a3db
76 changed files with 4053 additions and 1557 deletions

View file

@ -7,8 +7,8 @@ use collections::HashMap;
use editor::{Anchor, Autoscroll, Editor};
use gpui::{
actions, elements::*, impl_actions, platform::CursorStyle, Action, AppContext, Entity,
MutableAppContext, RenderContext, Subscription, Task, View, ViewContext, ViewHandle,
WeakViewHandle,
MouseButton, MutableAppContext, RenderContext, Subscription, Task, View, ViewContext,
ViewHandle, WeakViewHandle,
};
use language::OffsetRangeExt;
use project::search::SearchQuery;
@ -285,7 +285,9 @@ impl BufferSearchBar {
.with_style(style.container)
.boxed()
})
.on_click(move |_, _, cx| cx.dispatch_any_action(option.to_toggle_action()))
.on_click(MouseButton::Left, move |_, cx| {
cx.dispatch_any_action(option.to_toggle_action())
})
.with_cursor_style(CursorStyle::PointingHand)
.with_tooltip::<Self, _>(
option as usize,
@ -330,9 +332,9 @@ impl BufferSearchBar {
.with_style(style.container)
.boxed()
})
.on_click({
.on_click(MouseButton::Left, {
let action = action.boxed_clone();
move |_, _, cx| cx.dispatch_any_action(action.boxed_clone())
move |_, cx| cx.dispatch_any_action(action.boxed_clone())
})
.with_cursor_style(CursorStyle::PointingHand)
.with_tooltip::<NavButton, _>(

View file

@ -4,11 +4,11 @@ use crate::{
ToggleWholeWord,
};
use collections::HashMap;
use editor::{Anchor, Autoscroll, Editor, MultiBuffer, SelectAll};
use editor::{Anchor, Autoscroll, Editor, MultiBuffer, SelectAll, MAX_TAB_TITLE_LEN};
use gpui::{
actions, elements::*, platform::CursorStyle, Action, AppContext, ElementBox, Entity,
ModelContext, ModelHandle, MutableAppContext, RenderContext, Subscription, Task, View,
ViewContext, ViewHandle, WeakModelHandle, WeakViewHandle,
ModelContext, ModelHandle, MouseButton, MutableAppContext, RenderContext, Subscription, Task,
View, ViewContext, ViewHandle, WeakModelHandle, WeakViewHandle,
};
use menu::Confirm;
use project::{search::SearchQuery, Project};
@ -26,8 +26,6 @@ use workspace::{
actions!(project_search, [Deploy, SearchInNew, ToggleFocus]);
const MAX_TAB_TITLE_LEN: usize = 24;
#[derive(Default)]
struct ActiveSearches(HashMap<WeakModelHandle<Project>, WeakViewHandle<ProjectSearchView>>);
@ -220,7 +218,12 @@ impl Item for ProjectSearchView {
.update(cx, |editor, cx| editor.deactivated(cx));
}
fn tab_content(&self, tab_theme: &theme::Tab, cx: &gpui::AppContext) -> ElementBox {
fn tab_content(
&self,
_detail: Option<usize>,
tab_theme: &theme::Tab,
cx: &gpui::AppContext,
) -> ElementBox {
let settings = cx.global::<Settings>();
let search_theme = &settings.theme.search;
Flex::row()
@ -732,9 +735,9 @@ impl ProjectSearchBar {
.with_style(style.container)
.boxed()
})
.on_click({
.on_click(MouseButton::Left, {
let action = action.boxed_clone();
move |_, _, cx| cx.dispatch_any_action(action.boxed_clone())
move |_, cx| cx.dispatch_any_action(action.boxed_clone())
})
.with_cursor_style(CursorStyle::PointingHand)
.with_tooltip::<NavButton, _>(
@ -767,7 +770,9 @@ impl ProjectSearchBar {
.with_style(style.container)
.boxed()
})
.on_click(move |_, _, cx| cx.dispatch_any_action(option.to_toggle_action()))
.on_click(MouseButton::Left, move |_, cx| {
cx.dispatch_any_action(option.to_toggle_action())
})
.with_cursor_style(CursorStyle::PointingHand)
.with_tooltip::<Self, _>(
option as usize,