Store settings as a global via a gpui app_state
This commit is contained in:
parent
2103eec463
commit
48848de82c
25 changed files with 406 additions and 733 deletions
|
@ -6,7 +6,6 @@ use gpui::{
|
|||
RenderContext, View, ViewContext,
|
||||
};
|
||||
use language::{LanguageRegistry, LanguageServerBinaryStatus};
|
||||
use postage::watch;
|
||||
use project::{LanguageServerProgress, Project};
|
||||
use smallvec::SmallVec;
|
||||
use std::cmp::Reverse;
|
||||
|
@ -16,7 +15,6 @@ use std::sync::Arc;
|
|||
action!(DismissErrorMessage);
|
||||
|
||||
pub struct LspStatus {
|
||||
settings_rx: watch::Receiver<Settings>,
|
||||
checking_for_update: Vec<String>,
|
||||
downloading: Vec<String>,
|
||||
failed: Vec<String>,
|
||||
|
@ -31,7 +29,6 @@ impl LspStatus {
|
|||
pub fn new(
|
||||
project: &ModelHandle<Project>,
|
||||
languages: Arc<LanguageRegistry>,
|
||||
settings_rx: watch::Receiver<Settings>,
|
||||
cx: &mut ViewContext<Self>,
|
||||
) -> Self {
|
||||
let mut status_events = languages.language_server_binary_statuses();
|
||||
|
@ -72,7 +69,6 @@ impl LspStatus {
|
|||
cx.observe(project, |_, _, cx| cx.notify()).detach();
|
||||
|
||||
Self {
|
||||
settings_rx,
|
||||
checking_for_update: Default::default(),
|
||||
downloading: Default::default(),
|
||||
failed: Default::default(),
|
||||
|
@ -120,7 +116,7 @@ impl View for LspStatus {
|
|||
}
|
||||
|
||||
fn render(&mut self, cx: &mut RenderContext<Self>) -> ElementBox {
|
||||
let theme = &self.settings_rx.borrow().theme;
|
||||
let theme = &cx.app_state::<Settings>().theme;
|
||||
|
||||
let mut pending_work = self.pending_language_server_work(cx);
|
||||
if let Some((lang_server_name, progress_token, progress)) = pending_work.next() {
|
||||
|
@ -169,7 +165,8 @@ impl View for LspStatus {
|
|||
.boxed()
|
||||
} else if !self.failed.is_empty() {
|
||||
drop(pending_work);
|
||||
MouseEventHandler::new::<Self, _, _>(0, cx, |_, _| {
|
||||
MouseEventHandler::new::<Self, _, _>(0, cx, |_, cx| {
|
||||
let theme = &cx.app_state::<Settings>().theme;
|
||||
Label::new(
|
||||
format!(
|
||||
"Failed to download {} language server{}. Click to dismiss.",
|
||||
|
|
|
@ -10,7 +10,6 @@ use gpui::{
|
|||
AnyViewHandle, Entity, MutableAppContext, Quad, RenderContext, Task, View, ViewContext,
|
||||
ViewHandle, WeakViewHandle,
|
||||
};
|
||||
use postage::watch;
|
||||
use project::ProjectPath;
|
||||
use std::{
|
||||
any::{Any, TypeId},
|
||||
|
@ -100,7 +99,6 @@ pub enum Event {
|
|||
pub struct Pane {
|
||||
item_views: Vec<(usize, Box<dyn ItemViewHandle>)>,
|
||||
active_item_index: usize,
|
||||
settings: watch::Receiver<Settings>,
|
||||
nav_history: Rc<RefCell<NavHistory>>,
|
||||
toolbars: HashMap<TypeId, Box<dyn ToolbarHandle>>,
|
||||
active_toolbar_type: Option<TypeId>,
|
||||
|
@ -159,11 +157,10 @@ pub struct NavigationEntry {
|
|||
}
|
||||
|
||||
impl Pane {
|
||||
pub fn new(settings: watch::Receiver<Settings>) -> Self {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
item_views: Vec::new(),
|
||||
active_item_index: 0,
|
||||
settings,
|
||||
nav_history: Default::default(),
|
||||
toolbars: Default::default(),
|
||||
active_toolbar_type: Default::default(),
|
||||
|
@ -513,8 +510,7 @@ impl Pane {
|
|||
}
|
||||
|
||||
fn render_tabs(&self, cx: &mut RenderContext<Self>) -> ElementBox {
|
||||
let settings = self.settings.borrow();
|
||||
let theme = &settings.theme;
|
||||
let theme = cx.app_state::<Settings>().theme.clone();
|
||||
|
||||
enum Tabs {}
|
||||
let tabs = MouseEventHandler::new::<Tabs, _, _>(0, cx, |mouse_state, cx| {
|
||||
|
|
|
@ -5,7 +5,6 @@ use gpui::{
|
|||
font_cache::{FamilyId, FontCache},
|
||||
};
|
||||
use language::Language;
|
||||
use parking_lot::Mutex;
|
||||
use postage::{prelude::Stream, watch};
|
||||
use project::Fs;
|
||||
use schemars::{schema_for, JsonSchema};
|
||||
|
@ -66,8 +65,7 @@ impl SettingsFile {
|
|||
let path = path.into();
|
||||
let settings = Self::load(fs.clone(), &path).await.unwrap_or_default();
|
||||
let mut events = fs.watch(&path, Duration::from_millis(500)).await;
|
||||
let (mut tx, mut rx) = watch::channel_with(settings);
|
||||
rx.recv().await;
|
||||
let (mut tx, rx) = watch::channel_with(settings);
|
||||
executor
|
||||
.spawn(async move {
|
||||
while events.next().await.is_some() {
|
||||
|
@ -103,30 +101,26 @@ impl Settings {
|
|||
pub fn from_files(
|
||||
defaults: Self,
|
||||
sources: Vec<SettingsFile>,
|
||||
executor: Arc<executor::Background>,
|
||||
theme_registry: Arc<ThemeRegistry>,
|
||||
font_cache: Arc<FontCache>,
|
||||
) -> (Arc<Mutex<watch::Sender<Self>>>, watch::Receiver<Self>) {
|
||||
let (tx, mut rx) = watch::channel_with(defaults.clone());
|
||||
let tx = Arc::new(Mutex::new(tx));
|
||||
executor
|
||||
.spawn({
|
||||
let tx = tx.clone();
|
||||
async move {
|
||||
let mut stream =
|
||||
stream::select_all(sources.iter().map(|source| source.0.clone()));
|
||||
while stream.next().await.is_some() {
|
||||
let mut settings = defaults.clone();
|
||||
for source in &sources {
|
||||
settings.merge(&*source.0.borrow(), &theme_registry, &font_cache);
|
||||
}
|
||||
*tx.lock().borrow_mut() = settings;
|
||||
}
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
rx.try_recv().ok();
|
||||
(tx, rx)
|
||||
) -> impl futures::stream::Stream<Item = Self> {
|
||||
stream::select_all(sources.iter().enumerate().map(|(i, source)| {
|
||||
let mut rx = source.0.clone();
|
||||
// Consume the initial item from all of the constituent file watches but one.
|
||||
// This way, the stream will yield exactly one item for the files' initial
|
||||
// state, and won't return any more items until the files change.
|
||||
if i > 0 {
|
||||
rx.try_recv().ok();
|
||||
}
|
||||
rx
|
||||
}))
|
||||
.map(move |_| {
|
||||
let mut settings = defaults.clone();
|
||||
for source in &sources {
|
||||
settings.merge(&*source.0.borrow(), &theme_registry, &font_cache);
|
||||
}
|
||||
settings
|
||||
})
|
||||
}
|
||||
|
||||
pub fn new(
|
||||
|
@ -245,7 +239,6 @@ fn merge_option<T: Copy>(target: &mut Option<T>, value: Option<T>) {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use postage::prelude::Stream;
|
||||
use project::FakeFs;
|
||||
|
||||
#[gpui::test]
|
||||
|
@ -276,15 +269,14 @@ mod tests {
|
|||
let source2 = SettingsFile::new(fs.clone(), &executor, "/settings2.json".as_ref()).await;
|
||||
let source3 = SettingsFile::new(fs.clone(), &executor, "/settings3.json".as_ref()).await;
|
||||
|
||||
let (_, mut settings_rx) = Settings::from_files(
|
||||
let mut settings_rx = Settings::from_files(
|
||||
cx.read(Settings::test),
|
||||
vec![source1, source2, source3],
|
||||
cx.background(),
|
||||
ThemeRegistry::new((), cx.font_cache()),
|
||||
cx.font_cache(),
|
||||
);
|
||||
|
||||
let settings = settings_rx.recv().await.unwrap();
|
||||
let settings = settings_rx.next().await.unwrap();
|
||||
let md_settings = settings.language_overrides.get("Markdown").unwrap();
|
||||
assert_eq!(settings.soft_wrap, SoftWrap::EditorWidth);
|
||||
assert_eq!(settings.buffer_font_size, 24.0);
|
||||
|
@ -310,7 +302,7 @@ mod tests {
|
|||
.await
|
||||
.unwrap();
|
||||
|
||||
let settings = settings_rx.recv().await.unwrap();
|
||||
let settings = settings_rx.next().await.unwrap();
|
||||
let md_settings = settings.language_overrides.get("Markdown").unwrap();
|
||||
assert_eq!(settings.soft_wrap, SoftWrap::None);
|
||||
assert_eq!(settings.buffer_font_size, 24.0);
|
||||
|
@ -322,7 +314,7 @@ mod tests {
|
|||
.await
|
||||
.unwrap();
|
||||
|
||||
let settings = settings_rx.recv().await.unwrap();
|
||||
let settings = settings_rx.next().await.unwrap();
|
||||
assert_eq!(settings.tab_size, 4);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use super::Workspace;
|
||||
use crate::Settings;
|
||||
use gpui::{action, elements::*, platform::CursorStyle, AnyViewHandle, RenderContext};
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
use theme::Theme;
|
||||
|
||||
pub struct Sidebar {
|
||||
side: Side,
|
||||
|
@ -62,16 +62,16 @@ impl Sidebar {
|
|||
.map(|item| &item.view)
|
||||
}
|
||||
|
||||
fn theme<'a>(&self, settings: &'a Settings) -> &'a theme::Sidebar {
|
||||
fn theme<'a>(&self, theme: &'a Theme) -> &'a theme::Sidebar {
|
||||
match self.side {
|
||||
Side::Left => &settings.theme.workspace.left_sidebar,
|
||||
Side::Right => &settings.theme.workspace.right_sidebar,
|
||||
Side::Left => &theme.workspace.left_sidebar,
|
||||
Side::Right => &theme.workspace.right_sidebar,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn render(&self, settings: &Settings, cx: &mut RenderContext<Workspace>) -> ElementBox {
|
||||
pub fn render(&self, theme: &Theme, cx: &mut RenderContext<Workspace>) -> ElementBox {
|
||||
let side = self.side;
|
||||
let theme = self.theme(settings);
|
||||
let theme = self.theme(theme);
|
||||
|
||||
ConstrainedBox::new(
|
||||
Container::new(
|
||||
|
@ -119,13 +119,13 @@ impl Sidebar {
|
|||
|
||||
pub fn render_active_item(
|
||||
&self,
|
||||
settings: &Settings,
|
||||
theme: &Theme,
|
||||
cx: &mut RenderContext<Workspace>,
|
||||
) -> Option<ElementBox> {
|
||||
if let Some(active_item) = self.active_item() {
|
||||
let mut container = Flex::row();
|
||||
if matches!(self.side, Side::Right) {
|
||||
container.add_child(self.render_resize_handle(settings, cx));
|
||||
container.add_child(self.render_resize_handle(theme, cx));
|
||||
}
|
||||
|
||||
container.add_child(
|
||||
|
@ -142,7 +142,7 @@ impl Sidebar {
|
|||
.boxed(),
|
||||
);
|
||||
if matches!(self.side, Side::Left) {
|
||||
container.add_child(self.render_resize_handle(settings, cx));
|
||||
container.add_child(self.render_resize_handle(theme, cx));
|
||||
}
|
||||
Some(container.boxed())
|
||||
} else {
|
||||
|
@ -150,16 +150,12 @@ impl Sidebar {
|
|||
}
|
||||
}
|
||||
|
||||
fn render_resize_handle(
|
||||
&self,
|
||||
settings: &Settings,
|
||||
cx: &mut RenderContext<Workspace>,
|
||||
) -> ElementBox {
|
||||
fn render_resize_handle(&self, theme: &Theme, cx: &mut RenderContext<Workspace>) -> ElementBox {
|
||||
let width = self.width.clone();
|
||||
let side = self.side;
|
||||
MouseEventHandler::new::<Self, _, _>(side as usize, cx, |_, _| {
|
||||
Container::new(Empty::new().boxed())
|
||||
.with_style(self.theme(settings).resize_handle)
|
||||
.with_style(self.theme(theme).resize_handle)
|
||||
.boxed()
|
||||
})
|
||||
.with_padding(Padding {
|
||||
|
|
|
@ -3,7 +3,6 @@ use gpui::{
|
|||
elements::*, AnyViewHandle, ElementBox, Entity, MutableAppContext, RenderContext, Subscription,
|
||||
View, ViewContext, ViewHandle,
|
||||
};
|
||||
use postage::watch;
|
||||
|
||||
pub trait StatusItemView: View {
|
||||
fn set_active_pane_item(
|
||||
|
@ -27,7 +26,6 @@ pub struct StatusBar {
|
|||
right_items: Vec<Box<dyn StatusItemViewHandle>>,
|
||||
active_pane: ViewHandle<Pane>,
|
||||
_observe_active_pane: Subscription,
|
||||
settings: watch::Receiver<Settings>,
|
||||
}
|
||||
|
||||
impl Entity for StatusBar {
|
||||
|
@ -39,8 +37,8 @@ impl View for StatusBar {
|
|||
"StatusBar"
|
||||
}
|
||||
|
||||
fn render(&mut self, _: &mut RenderContext<Self>) -> ElementBox {
|
||||
let theme = &self.settings.borrow().theme.workspace.status_bar;
|
||||
fn render(&mut self, cx: &mut RenderContext<Self>) -> ElementBox {
|
||||
let theme = &cx.app_state::<Settings>().theme.workspace.status_bar;
|
||||
Flex::row()
|
||||
.with_children(self.left_items.iter().map(|i| {
|
||||
ChildView::new(i.as_ref())
|
||||
|
@ -66,18 +64,13 @@ impl View for StatusBar {
|
|||
}
|
||||
|
||||
impl StatusBar {
|
||||
pub fn new(
|
||||
active_pane: &ViewHandle<Pane>,
|
||||
settings: watch::Receiver<Settings>,
|
||||
cx: &mut ViewContext<Self>,
|
||||
) -> Self {
|
||||
pub fn new(active_pane: &ViewHandle<Pane>, cx: &mut ViewContext<Self>) -> Self {
|
||||
let mut this = Self {
|
||||
left_items: Default::default(),
|
||||
right_items: Default::default(),
|
||||
active_pane: active_pane.clone(),
|
||||
_observe_active_pane: cx
|
||||
.observe(active_pane, |this, _, cx| this.update_active_pane_item(cx)),
|
||||
settings,
|
||||
};
|
||||
this.update_active_pane_item(cx);
|
||||
this
|
||||
|
|
|
@ -26,8 +26,7 @@ use language::LanguageRegistry;
|
|||
use log::error;
|
||||
pub use pane::*;
|
||||
pub use pane_group::*;
|
||||
use parking_lot::Mutex;
|
||||
use postage::{prelude::Stream, watch};
|
||||
use postage::prelude::Stream;
|
||||
use project::{fs, Fs, Project, ProjectPath, Worktree};
|
||||
pub use settings::Settings;
|
||||
use sidebar::{Side, Sidebar, SidebarItemId, ToggleSidebarItem, ToggleSidebarItemFocus};
|
||||
|
@ -100,8 +99,6 @@ pub fn init(cx: &mut MutableAppContext) {
|
|||
}
|
||||
|
||||
pub struct AppState {
|
||||
pub settings_tx: Arc<Mutex<watch::Sender<Settings>>>,
|
||||
pub settings: watch::Receiver<Settings>,
|
||||
pub languages: Arc<LanguageRegistry>,
|
||||
pub themes: Arc<ThemeRegistry>,
|
||||
pub client: Arc<client::Client>,
|
||||
|
@ -495,7 +492,6 @@ pub struct WorkspaceParams {
|
|||
pub client: Arc<Client>,
|
||||
pub fs: Arc<dyn Fs>,
|
||||
pub languages: Arc<LanguageRegistry>,
|
||||
pub settings: watch::Receiver<Settings>,
|
||||
pub user_store: ModelHandle<UserStore>,
|
||||
pub channel_list: ModelHandle<ChannelList>,
|
||||
pub path_openers: Arc<[Box<dyn PathOpener>]>,
|
||||
|
@ -504,15 +500,15 @@ pub struct WorkspaceParams {
|
|||
impl WorkspaceParams {
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
pub fn test(cx: &mut MutableAppContext) -> Self {
|
||||
let settings = Settings::test(cx);
|
||||
cx.add_app_state(settings);
|
||||
|
||||
let fs = project::FakeFs::new(cx.background().clone());
|
||||
let languages = Arc::new(LanguageRegistry::test());
|
||||
let http_client = client::test::FakeHttpClient::new(|_| async move {
|
||||
Ok(client::http::ServerResponse::new(404))
|
||||
});
|
||||
let client = Client::new(http_client.clone());
|
||||
let theme =
|
||||
gpui::fonts::with_font_cache(cx.font_cache().clone(), || theme::Theme::default());
|
||||
let settings = Settings::new("Courier", cx.font_cache(), Arc::new(theme)).unwrap();
|
||||
let user_store = cx.add_model(|cx| UserStore::new(client.clone(), http_client, cx));
|
||||
let project = Project::local(
|
||||
client.clone(),
|
||||
|
@ -528,7 +524,6 @@ impl WorkspaceParams {
|
|||
client,
|
||||
fs,
|
||||
languages,
|
||||
settings: watch::channel_with(settings).1,
|
||||
user_store,
|
||||
path_openers: Arc::from([]),
|
||||
}
|
||||
|
@ -547,7 +542,6 @@ impl WorkspaceParams {
|
|||
client: app_state.client.clone(),
|
||||
fs: app_state.fs.clone(),
|
||||
languages: app_state.languages.clone(),
|
||||
settings: app_state.settings.clone(),
|
||||
user_store: app_state.user_store.clone(),
|
||||
channel_list: app_state.channel_list.clone(),
|
||||
path_openers: app_state.path_openers.clone(),
|
||||
|
@ -556,7 +550,6 @@ impl WorkspaceParams {
|
|||
}
|
||||
|
||||
pub struct Workspace {
|
||||
pub settings: watch::Receiver<Settings>,
|
||||
weak_self: WeakViewHandle<Self>,
|
||||
client: Arc<Client>,
|
||||
user_store: ModelHandle<client::UserStore>,
|
||||
|
@ -584,7 +577,7 @@ impl Workspace {
|
|||
})
|
||||
.detach();
|
||||
|
||||
let pane = cx.add_view(|_| Pane::new(params.settings.clone()));
|
||||
let pane = cx.add_view(|_| Pane::new());
|
||||
let pane_id = pane.id();
|
||||
cx.observe(&pane, move |me, _, cx| {
|
||||
let active_entry = me.active_project_path(cx);
|
||||
|
@ -598,7 +591,7 @@ impl Workspace {
|
|||
.detach();
|
||||
cx.focus(&pane);
|
||||
|
||||
let status_bar = cx.add_view(|cx| StatusBar::new(&pane, params.settings.clone(), cx));
|
||||
let status_bar = cx.add_view(|cx| StatusBar::new(&pane, cx));
|
||||
let mut current_user = params.user_store.read(cx).watch_current_user().clone();
|
||||
let mut connection_status = params.client.status().clone();
|
||||
let _observe_current_user = cx.spawn_weak(|this, mut cx| async move {
|
||||
|
@ -623,7 +616,6 @@ impl Workspace {
|
|||
panes: vec![pane.clone()],
|
||||
active_pane: pane.clone(),
|
||||
status_bar,
|
||||
settings: params.settings.clone(),
|
||||
client: params.client.clone(),
|
||||
user_store: params.user_store.clone(),
|
||||
fs: params.fs.clone(),
|
||||
|
@ -640,10 +632,6 @@ impl Workspace {
|
|||
self.weak_self.clone()
|
||||
}
|
||||
|
||||
pub fn settings(&self) -> watch::Receiver<Settings> {
|
||||
self.settings.clone()
|
||||
}
|
||||
|
||||
pub fn left_sidebar_mut(&mut self) -> &mut Sidebar {
|
||||
&mut self.left_sidebar
|
||||
}
|
||||
|
@ -953,7 +941,7 @@ impl Workspace {
|
|||
}
|
||||
|
||||
fn add_pane(&mut self, cx: &mut ViewContext<Self>) -> ViewHandle<Pane> {
|
||||
let pane = cx.add_view(|_| Pane::new(self.settings.clone()));
|
||||
let pane = cx.add_view(|_| Pane::new());
|
||||
let pane_id = pane.id();
|
||||
cx.observe(&pane, move |me, _, cx| {
|
||||
let active_entry = me.active_project_path(cx);
|
||||
|
@ -1128,8 +1116,8 @@ impl Workspace {
|
|||
});
|
||||
}
|
||||
|
||||
fn render_connection_status(&self) -> Option<ElementBox> {
|
||||
let theme = &self.settings.borrow().theme;
|
||||
fn render_connection_status(&self, cx: &mut RenderContext<Self>) -> Option<ElementBox> {
|
||||
let theme = &cx.app_state::<Settings>().theme;
|
||||
match &*self.client.status().borrow() {
|
||||
client::Status::ConnectionError
|
||||
| client::Status::ConnectionLost
|
||||
|
@ -1187,7 +1175,7 @@ impl Workspace {
|
|||
theme,
|
||||
cx,
|
||||
))
|
||||
.with_children(self.render_connection_status())
|
||||
.with_children(self.render_connection_status(cx))
|
||||
.boxed(),
|
||||
)
|
||||
.right()
|
||||
|
@ -1315,7 +1303,7 @@ impl Workspace {
|
|||
|
||||
fn render_disconnected_overlay(&self, cx: &AppContext) -> Option<ElementBox> {
|
||||
if self.project.read(cx).is_read_only() {
|
||||
let theme = &self.settings.borrow().theme;
|
||||
let theme = &cx.app_state::<Settings>().theme;
|
||||
Some(
|
||||
EventHandler::new(
|
||||
Label::new(
|
||||
|
@ -1346,8 +1334,7 @@ impl View for Workspace {
|
|||
}
|
||||
|
||||
fn render(&mut self, cx: &mut RenderContext<Self>) -> ElementBox {
|
||||
let settings = self.settings.borrow();
|
||||
let theme = &settings.theme;
|
||||
let theme = cx.app_state::<Settings>().theme.clone();
|
||||
Stack::new()
|
||||
.with_child(
|
||||
Flex::column()
|
||||
|
@ -1356,32 +1343,28 @@ impl View for Workspace {
|
|||
Stack::new()
|
||||
.with_child({
|
||||
let mut content = Flex::row();
|
||||
content.add_child(self.left_sidebar.render(&settings, cx));
|
||||
content.add_child(self.left_sidebar.render(&theme, cx));
|
||||
if let Some(element) =
|
||||
self.left_sidebar.render_active_item(&settings, cx)
|
||||
self.left_sidebar.render_active_item(&theme, cx)
|
||||
{
|
||||
content.add_child(Flexible::new(0.8, false, element).boxed());
|
||||
}
|
||||
content.add_child(
|
||||
Flex::column()
|
||||
.with_child(
|
||||
Flexible::new(
|
||||
1.,
|
||||
true,
|
||||
self.center.render(&settings.theme),
|
||||
)
|
||||
.boxed(),
|
||||
Flexible::new(1., true, self.center.render(&theme))
|
||||
.boxed(),
|
||||
)
|
||||
.with_child(ChildView::new(&self.status_bar).boxed())
|
||||
.flexible(1., true)
|
||||
.boxed(),
|
||||
);
|
||||
if let Some(element) =
|
||||
self.right_sidebar.render_active_item(&settings, cx)
|
||||
self.right_sidebar.render_active_item(&theme, cx)
|
||||
{
|
||||
content.add_child(Flexible::new(0.8, false, element).boxed());
|
||||
}
|
||||
content.add_child(self.right_sidebar.render(&settings, cx));
|
||||
content.add_child(self.right_sidebar.render(&theme, cx));
|
||||
content.boxed()
|
||||
})
|
||||
.with_children(self.modal.as_ref().map(|m| ChildView::new(m).boxed()))
|
||||
|
@ -1389,7 +1372,7 @@ impl View for Workspace {
|
|||
.boxed(),
|
||||
)
|
||||
.contained()
|
||||
.with_background_color(settings.theme.workspace.background)
|
||||
.with_background_color(theme.workspace.background)
|
||||
.boxed(),
|
||||
)
|
||||
.with_children(self.render_disconnected_overlay(cx))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue