wip: connect to github
This commit is contained in:
@@ -9,6 +9,7 @@ use crate::{api, app};
|
||||
pub struct Global {
|
||||
pub safe_area: gpui::Bounds<gpui::Pixels>,
|
||||
pub current_theme: theme::Theme,
|
||||
pub rng: rand::prelude::ThreadRng,
|
||||
}
|
||||
|
||||
pub struct Chrome {}
|
||||
@@ -50,10 +51,14 @@ impl gpui::Render for Chrome {
|
||||
|
||||
impl gpui::Global for Global {}
|
||||
|
||||
pub fn current_theme<'a, E>(cx: &'a gpui::Context<E>) -> &'a theme::Theme {
|
||||
pub fn current_theme(cx: &gpui::App) -> &theme::Theme {
|
||||
&cx.global::<Global>().current_theme
|
||||
}
|
||||
|
||||
pub fn rng(cx: &mut gpui::App) -> &mut rand::prelude::ThreadRng {
|
||||
&mut cx.global_mut::<Global>().rng
|
||||
}
|
||||
|
||||
pub fn query_store<'a, E>(cx: &'a gpui::Context<E>) -> &'a query::Store<api::QueryContext> {
|
||||
cx.global::<query::Store<api::QueryContext>>()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user