Dequalify WindowContext and ViewContext references (#22477)
Release Notes: - N/A
This commit is contained in:
parent
016b5d60e1
commit
a15360bcc8
25 changed files with 43 additions and 51 deletions
|
@ -56,7 +56,7 @@ impl FocusStory {
|
|||
}
|
||||
|
||||
impl Render for FocusStory {
|
||||
fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl IntoElement {
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
|
||||
let theme = cx.theme();
|
||||
let color_1 = theme.status().created;
|
||||
let color_2 = theme.status().modified;
|
||||
|
|
|
@ -45,7 +45,7 @@ impl PickerDelegate for Delegate {
|
|||
&self,
|
||||
ix: usize,
|
||||
selected: bool,
|
||||
_cx: &mut gpui::ViewContext<Picker<Self>>,
|
||||
_cx: &mut ViewContext<Picker<Self>>,
|
||||
) -> Option<Self::ListItem> {
|
||||
let candidate_ix = self.matches.get(ix)?;
|
||||
// TASK: Make StringMatchCandidate::string a SharedString
|
||||
|
@ -64,12 +64,12 @@ impl PickerDelegate for Delegate {
|
|||
self.selected_ix
|
||||
}
|
||||
|
||||
fn set_selected_index(&mut self, ix: usize, cx: &mut gpui::ViewContext<Picker<Self>>) {
|
||||
fn set_selected_index(&mut self, ix: usize, cx: &mut ViewContext<Picker<Self>>) {
|
||||
self.selected_ix = ix;
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
fn confirm(&mut self, secondary: bool, _cx: &mut gpui::ViewContext<Picker<Self>>) {
|
||||
fn confirm(&mut self, secondary: bool, _cx: &mut ViewContext<Picker<Self>>) {
|
||||
let candidate_ix = self.matches[self.selected_ix];
|
||||
let candidate = self.candidates[candidate_ix].string.clone();
|
||||
|
||||
|
@ -80,15 +80,11 @@ impl PickerDelegate for Delegate {
|
|||
}
|
||||
}
|
||||
|
||||
fn dismissed(&mut self, cx: &mut gpui::ViewContext<Picker<Self>>) {
|
||||
fn dismissed(&mut self, cx: &mut ViewContext<Picker<Self>>) {
|
||||
cx.quit();
|
||||
}
|
||||
|
||||
fn update_matches(
|
||||
&mut self,
|
||||
query: String,
|
||||
cx: &mut gpui::ViewContext<Picker<Self>>,
|
||||
) -> Task<()> {
|
||||
fn update_matches(&mut self, query: String, cx: &mut ViewContext<Picker<Self>>) -> Task<()> {
|
||||
let candidates = self.candidates.clone();
|
||||
self.matches = cx
|
||||
.background_executor()
|
||||
|
@ -194,7 +190,7 @@ impl PickerStory {
|
|||
}
|
||||
|
||||
impl Render for PickerStory {
|
||||
fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl IntoElement {
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
|
||||
div()
|
||||
.bg(cx.theme().styles.colors.background)
|
||||
.size_full()
|
||||
|
|
|
@ -11,7 +11,7 @@ impl ScrollStory {
|
|||
}
|
||||
|
||||
impl Render for ScrollStory {
|
||||
fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl IntoElement {
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
|
||||
let theme = cx.theme();
|
||||
let color_1 = theme.status().created;
|
||||
let color_2 = theme.status().modified;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use gpui::{
|
||||
div, green, red, HighlightStyle, InteractiveText, IntoElement, ParentElement, Render, Styled,
|
||||
StyledText, View, VisualContext, WindowContext,
|
||||
StyledText, View, ViewContext, VisualContext, WindowContext,
|
||||
};
|
||||
use indoc::indoc;
|
||||
use story::*;
|
||||
|
@ -14,7 +14,7 @@ impl TextStory {
|
|||
}
|
||||
|
||||
impl Render for TextStory {
|
||||
fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl IntoElement {
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
|
||||
Story::container()
|
||||
.child(Story::title("Text"))
|
||||
.children(vec![
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue