Rename app_state to global in gpui

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2022-03-17 14:33:01 +01:00
parent 84bacc556f
commit 44d997c00c
24 changed files with 91 additions and 89 deletions

View file

@ -72,7 +72,7 @@ impl View for ProjectDiagnosticsEditor {
fn render(&mut self, cx: &mut RenderContext<Self>) -> ElementBox {
if self.path_states.is_empty() {
let theme = &cx.app_state::<Settings>().theme.project_diagnostics;
let theme = &cx.global::<Settings>().theme.project_diagnostics;
Label::new(
"No problems in workspace".to_string(),
theme.empty_message.clone(),
@ -441,7 +441,7 @@ impl workspace::Item for ProjectDiagnosticsEditor {
render_summary(
&self.summary,
&style.label.text,
&cx.app_state::<Settings>().theme.project_diagnostics,
&cx.global::<Settings>().theme.project_diagnostics,
)
}
@ -535,7 +535,7 @@ impl workspace::Item for ProjectDiagnosticsEditor {
fn diagnostic_header_renderer(diagnostic: Diagnostic) -> RenderBlock {
let (message, highlights) = highlight_diagnostic_message(&diagnostic.message);
Arc::new(move |cx| {
let settings = cx.app_state::<Settings>();
let settings = cx.global::<Settings>();
let theme = &settings.theme.editor;
let style = &theme.diagnostic_header;
let font_size = (style.text_scale_factor * settings.buffer_font_size).round();

View file

@ -49,7 +49,7 @@ impl View for DiagnosticSummary {
let in_progress = self.in_progress;
MouseEventHandler::new::<Tag, _, _>(0, cx, |_, cx| {
let theme = &cx.app_state::<Settings>().theme.project_diagnostics;
let theme = &cx.global::<Settings>().theme.project_diagnostics;
if in_progress {
Label::new(
"Checking... ".to_string(),