WIP
This commit is contained in:
parent
83070a19c4
commit
868301bedb
26 changed files with 194 additions and 175 deletions
|
@ -3,7 +3,7 @@ use std::path::Path;
|
|||
use fuzzy::StringMatch;
|
||||
use gpui::{
|
||||
elements::{Label, LabelStyle},
|
||||
Element, ElementBox,
|
||||
Element, ElementBox, View,
|
||||
};
|
||||
use workspace::WorkspaceLocation;
|
||||
|
||||
|
@ -42,7 +42,7 @@ impl HighlightedText {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn render(self, style: impl Into<LabelStyle>) -> ElementBox {
|
||||
pub fn render<V: View>(self, style: impl Into<LabelStyle>) -> ElementBox<V> {
|
||||
Label::new(self.text, style)
|
||||
.with_highlights(self.highlight_positions)
|
||||
.boxed()
|
||||
|
|
|
@ -101,7 +101,7 @@ impl View for RecentProjectsView {
|
|||
"RecentProjectsView"
|
||||
}
|
||||
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> ElementBox {
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> ElementBox<Self> {
|
||||
ChildView::new(&self.picker, cx).boxed()
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ impl PickerDelegate for RecentProjectsView {
|
|||
mouse_state: &mut gpui::MouseState,
|
||||
selected: bool,
|
||||
cx: &gpui::AppContext,
|
||||
) -> ElementBox {
|
||||
) -> ElementBox<Picker<Self>> {
|
||||
let settings = cx.global::<Settings>();
|
||||
let string_match = &self.matches[ix];
|
||||
let style = settings.theme.picker.item.style_for(mouse_state, selected);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue