diff --git a/crates/copilot/src/sign_in.rs b/crates/copilot/src/sign_in.rs index 74f9828598492c92829ad66c6fd321ff395f2adc..04655633917ad0ba170e1ce3c607ca3f2e17aae0 100644 --- a/crates/copilot/src/sign_in.rs +++ b/crates/copilot/src/sign_in.rs @@ -3,7 +3,8 @@ use gpui::{ elements::*, geometry::rect::RectF, platform::{WindowBounds, WindowKind, WindowOptions}, - AppContext, ClipboardItem, Element, Entity, View, ViewContext, ViewHandle, + AnyViewHandle, AppContext, ClipboardItem, Element, ElementBox, Entity, View, ViewContext, + ViewHandle, }; use settings::Settings; use theme::ui::modal; @@ -28,9 +29,9 @@ pub fn init(cx: &mut AppContext) { if let Some(code_verification_handle) = code_verification.as_mut() { if cx.has_window(code_verification_handle.window_id()) { code_verification_handle.update(cx, |code_verification_view, cx| { - code_verification_view.set_status(status, cx) + code_verification_view.set_status(status, cx); + cx.activate_window(); }); - cx.activate_window(code_verification_handle.window_id()); } else { create_copilot_auth_window(cx, &status, &mut code_verification); } @@ -41,11 +42,11 @@ pub fn init(cx: &mut AppContext) { Status::Authorized | Status::Unauthorized => { if let Some(code_verification) = code_verification.as_ref() { code_verification.update(cx, |code_verification, cx| { - code_verification.set_status(status, cx) + code_verification.set_status(status, cx); + cx.activate_window(); }); cx.platform().activate(true); - cx.activate_window(code_verification.window_id()); } } _ => { @@ -96,8 +97,8 @@ impl CopilotCodeVerification { fn render_device_code( data: &PromptUserDeviceFlow, style: &theme::Copilot, - cx: &mut gpui::ViewContext, - ) -> ElementBox { + cx: &mut ViewContext, + ) -> ElementBox { let copied = cx .read_from_clipboard() .map(|item| item.text() == &data.user_code) @@ -105,7 +106,7 @@ impl CopilotCodeVerification { let device_code_style = &style.auth.prompting.device_code; - MouseEventHandler::::new(0, cx, |state, _cx| { + MouseEventHandler::::new(0, cx, |state, _cx| { Flex::row() .with_children([ Label::new(data.user_code.clone(), device_code_style.text.clone()) @@ -132,7 +133,7 @@ impl CopilotCodeVerification { }) .on_click(gpui::platform::MouseButton::Left, { let user_code = data.user_code.clone(); - move |_, cx| { + move |_, _, cx| { cx.platform() .write_to_clipboard(ClipboardItem::new(user_code.clone())); cx.notify(); @@ -145,8 +146,10 @@ impl CopilotCodeVerification { fn render_prompting_modal( data: &PromptUserDeviceFlow, style: &theme::Copilot, - cx: &mut gpui::ViewContext, - ) -> ElementBox { + cx: &mut ViewContext, + ) -> ElementBox { + enum ConnectButton {} + Flex::column() .with_children([ Flex::column() @@ -188,14 +191,14 @@ impl CopilotCodeVerification { .contained() .with_style(style.auth.prompting.hint.container.clone()) .boxed(), - theme::ui::cta_button_with_click( + theme::ui::cta_button_with_click::( "Connect to GitHub", style.auth.content_width, &style.auth.cta_button, cx, { let verification_uri = data.verification_uri.clone(); - move |_, cx| cx.platform().open_url(&verification_uri) + move |_, _, cx| cx.platform().open_url(&verification_uri) }, ) .boxed(), @@ -205,8 +208,10 @@ impl CopilotCodeVerification { } fn render_enabled_modal( style: &theme::Copilot, - cx: &mut gpui::ViewContext, - ) -> ElementBox { + cx: &mut ViewContext, + ) -> ElementBox { + enum DoneButton {} + let enabled_style = &style.auth.authorized; Flex::column() .with_children([ @@ -237,12 +242,12 @@ impl CopilotCodeVerification { .contained() .with_style(enabled_style.hint.container) .boxed(), - theme::ui::cta_button_with_click( + theme::ui::cta_button_with_click::( "Done", style.auth.content_width, &style.auth.cta_button, cx, - |_, cx| { + |_, _, cx| { let window_id = cx.window_id(); cx.remove_window(window_id) }, @@ -254,8 +259,8 @@ impl CopilotCodeVerification { } fn render_unauthorized_modal( style: &theme::Copilot, - cx: &mut gpui::ViewContext, - ) -> ElementBox { + cx: &mut ViewContext, + ) -> ElementBox { let unauthorized_style = &style.auth.not_authorized; Flex::column() @@ -298,12 +303,12 @@ impl CopilotCodeVerification { .contained() .with_style(unauthorized_style.warning.container) .boxed(), - theme::ui::cta_button_with_click( + theme::ui::cta_button_with_click::( "Subscribe on GitHub", style.auth.content_width, &style.auth.cta_button, cx, - |_, cx| { + |_, _, cx| { let window_id = cx.window_id(); cx.remove_window(window_id); cx.platform().open_url(COPILOT_SIGN_UP_URL) @@ -325,18 +330,20 @@ impl View for CopilotCodeVerification { "CopilotCodeVerification" } - fn focus_in(&mut self, _: gpui::AnyViewHandle, cx: &mut gpui::ViewContext) { + fn focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext) { cx.notify() } - fn focus_out(&mut self, _: gpui::AnyViewHandle, cx: &mut gpui::ViewContext) { + fn focus_out(&mut self, _: AnyViewHandle, cx: &mut ViewContext) { cx.notify() } - fn render(&mut self, cx: &mut gpui::ViewContext<'_, Self>) -> gpui::ElementBox { + fn render(&mut self, cx: &mut ViewContext) -> ElementBox { + enum ConnectModal {} + let style = cx.global::().theme.clone(); - modal("Connect Copilot to Zed", &style.copilot.modal, cx, |cx| { + modal::("Connect Copilot to Zed", &style.copilot.modal, cx, |cx| { Flex::column() .with_children([ theme::ui::icon(&style.copilot.auth.header).boxed(), diff --git a/crates/gpui/src/elements.rs b/crates/gpui/src/elements.rs index f1a5c8dffd26e79a25d13d740a1735769e45f350..ea00e155d0b58736038738e450ac37eaaebf380a 100644 --- a/crates/gpui/src/elements.rs +++ b/crates/gpui/src/elements.rs @@ -25,6 +25,8 @@ pub use self::{ keystroke_label::*, label::*, list::*, mouse_event_handler::*, overlay::*, resizable::*, stack::*, svg::*, text::*, tooltip::*, uniform_list::*, }; +pub use crate::window::ChildView; + use self::{clipped::Clipped, expanded::Expanded}; use crate::{ geometry::{ diff --git a/crates/workspace/src/dock.rs b/crates/workspace/src/dock.rs index 888c1d20218ef7f687e4a17329464deb9062671f..87c6031a464b3130fdcbff4a311d137492d2cbd5 100644 --- a/crates/workspace/src/dock.rs +++ b/crates/workspace/src/dock.rs @@ -315,7 +315,7 @@ impl Dock { theme: &Theme, anchor: DockAnchor, cx: &mut ViewContext, - ) -> Option { + ) -> Option> { let style = &theme.workspace.dock; self.position diff --git a/crates/workspace/src/dock/toggle_dock_button.rs b/crates/workspace/src/dock/toggle_dock_button.rs index 55cafbea014ed23a748316d8c537d14c6ae8b5f0..1db820ca1f62f908bc52bbe4b87af26565b36662 100644 --- a/crates/workspace/src/dock/toggle_dock_button.rs +++ b/crates/workspace/src/dock/toggle_dock_button.rs @@ -34,7 +34,7 @@ impl View for ToggleDockButton { "Dock Toggle" } - fn render(&mut self, cx: &mut gpui::ViewContext<'_, Self>) -> ElementBox { + fn render(&mut self, cx: &mut gpui::ViewContext) -> ElementBox { let workspace = self.workspace.upgrade(cx); if workspace.is_none() { diff --git a/crates/workspace/src/item.rs b/crates/workspace/src/item.rs index 76cf874de82077eb00b0618fc57a73de104b3ccc..f1b3f608e843c9d6ffc33da0361723bbf1bf9d3e 100644 --- a/crates/workspace/src/item.rs +++ b/crates/workspace/src/item.rs @@ -47,8 +47,12 @@ pub trait Item: View { fn tab_description<'a>(&'a self, _: usize, _: &'a AppContext) -> Option> { None } - fn tab_content(&self, detail: Option, style: &theme::Tab, cx: &AppContext) - -> ElementBox; + fn tab_content( + &self, + detail: Option, + style: &theme::Tab, + cx: &AppContext, + ) -> ElementBox; fn for_each_project_item(&self, _: &AppContext, _: &mut dyn FnMut(usize, &dyn project::Item)) {} fn is_singleton(&self, _cx: &AppContext) -> bool { false @@ -130,7 +134,7 @@ pub trait Item: View { ToolbarItemLocation::Hidden } - fn breadcrumbs(&self, _theme: &Theme, _cx: &AppContext) -> Option> { + fn breadcrumbs(&self, _theme: &Theme, _cx: &AppContext) -> Option>> { None } @@ -163,8 +167,12 @@ pub trait ItemHandle: 'static + fmt::Debug { handler: Box, ) -> gpui::Subscription; fn tab_description<'a>(&self, detail: usize, cx: &'a AppContext) -> Option>; - fn tab_content(&self, detail: Option, style: &theme::Tab, cx: &AppContext) - -> ElementBox; + fn tab_content( + &self, + detail: Option, + style: &theme::Tab, + cx: &AppContext, + ) -> ElementBox; fn project_path(&self, cx: &AppContext) -> Option; fn project_entry_ids(&self, cx: &AppContext) -> SmallVec<[ProjectEntryId; 3]>; fn project_item_model_ids(&self, cx: &AppContext) -> SmallVec<[usize; 3]>; @@ -213,7 +221,7 @@ pub trait ItemHandle: 'static + fmt::Debug { ) -> gpui::Subscription; fn to_searchable_item_handle(&self, cx: &AppContext) -> Option>; fn breadcrumb_location(&self, cx: &AppContext) -> ToolbarItemLocation; - fn breadcrumbs(&self, theme: &Theme, cx: &AppContext) -> Option>; + fn breadcrumbs(&self, theme: &Theme, cx: &AppContext) -> Option>>; fn serialized_item_kind(&self) -> Option<&'static str>; fn show_toolbar(&self, cx: &AppContext) -> bool; } @@ -257,7 +265,7 @@ impl ItemHandle for ViewHandle { detail: Option, style: &theme::Tab, cx: &AppContext, - ) -> ElementBox { + ) -> ElementBox { self.read(cx).tab_content(detail, style, cx) } @@ -583,7 +591,7 @@ impl ItemHandle for ViewHandle { self.read(cx).breadcrumb_location() } - fn breadcrumbs(&self, theme: &Theme, cx: &AppContext) -> Option> { + fn breadcrumbs(&self, theme: &Theme, cx: &AppContext) -> Option>> { self.read(cx).breadcrumbs(theme, cx) } @@ -899,7 +907,7 @@ pub(crate) mod test { "TestItem" } - fn render(&mut self, _: &mut ViewContext) -> ElementBox { + fn render(&mut self, _: &mut ViewContext) -> ElementBox { Empty::new().boxed() } } @@ -912,7 +920,12 @@ pub(crate) mod test { }) } - fn tab_content(&self, detail: Option, _: &theme::Tab, _: &AppContext) -> ElementBox { + fn tab_content( + &self, + detail: Option, + _: &theme::Tab, + _: &AppContext, + ) -> ElementBox { self.tab_detail.set(detail); Empty::new().boxed() } diff --git a/crates/workspace/src/notifications.rs b/crates/workspace/src/notifications.rs index 8932c969f8917612c17bbd159435f148b251feee..e071804186a72c6f4398ff3d96c2277a4c66e975 100644 --- a/crates/workspace/src/notifications.rs +++ b/crates/workspace/src/notifications.rs @@ -229,7 +229,7 @@ pub mod simple_message_notification { "MessageNotification" } - fn render(&mut self, cx: &mut gpui::ViewContext<'_, Self>) -> gpui::ElementBox { + fn render(&mut self, cx: &mut gpui::ViewContext) -> gpui::ElementBox { let theme = cx.global::().theme.clone(); let theme = &theme.simple_message_notification; diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs index 6015beddf73e77605e0b1ff9a1ad72cca6653a39..8c168e8ee28955682fc1aaca3f63d6be959eef57 100644 --- a/crates/workspace/src/pane.rs +++ b/crates/workspace/src/pane.rs @@ -1383,8 +1383,8 @@ impl Pane { detail: Option, hovered: bool, tab_style: &theme::Tab, - cx: &mut ViewContext, - ) -> ElementBox { + cx: &mut ViewContext, + ) -> ElementBox { let title = item.tab_content(detail, &tab_style, cx); let mut container = tab_style.container.clone(); if first { @@ -1404,7 +1404,7 @@ impl Pane { }; ConstrainedBox::new( - Canvas::new(move |bounds, _, cx| { + Canvas::new(move |scene, bounds, _, cx| { if let Some(color) = icon_color { let square = RectF::new(bounds.origin(), vec2f(diameter, diameter)); scene.push_quad(Quad { @@ -1475,7 +1475,11 @@ impl Pane { .boxed() } - fn render_tab_bar_buttons(&mut self, theme: &Theme, cx: &mut ViewContext) -> ElementBox { + fn render_tab_bar_buttons( + &mut self, + theme: &Theme, + cx: &mut ViewContext, + ) -> ElementBox { Flex::row() // New menu .with_child(render_tab_bar_button( @@ -1524,7 +1528,11 @@ impl Pane { .boxed() } - fn render_blank_pane(&mut self, theme: &Theme, _cx: &mut ViewContext) -> ElementBox { + fn render_blank_pane( + &mut self, + theme: &Theme, + _cx: &mut ViewContext, + ) -> ElementBox { let background = theme.workspace.background; Empty::new() .contained() @@ -1542,7 +1550,7 @@ impl View for Pane { "Pane" } - fn render(&mut self, cx: &mut ViewContext) -> ElementBox { + fn render(&mut self, cx: &mut ViewContext) -> ElementBox { let this = cx.handle(); enum MouseNavigationHandler {} @@ -1703,7 +1711,7 @@ fn render_tab_bar_button( cx: &mut ViewContext, action: A, context_menu: Option>, -) -> ElementBox { +) -> ElementBox { enum TabBarButton {} Stack::new() @@ -1837,10 +1845,11 @@ impl NavHistory { pub struct PaneBackdrop { child_view: usize, - child: ElementBox, + child: ElementBox, } + impl PaneBackdrop { - pub fn new(pane_item_view: usize, child: ElementBox) -> Self { + pub fn new(pane_item_view: usize, child: ElementBox) -> Self { PaneBackdrop { child, child_view: pane_item_view, @@ -1906,8 +1915,8 @@ impl Element for PaneBackdrop { _visible_bounds: RectF, _layout: &Self::LayoutState, _paint: &Self::PaintState, - view: &V, - cx: &gpui::ViewContext, + view: &Pane, + cx: &gpui::ViewContext, ) -> Option { self.child.rect_for_text_range(range_utf16, view, cx) } @@ -1917,8 +1926,8 @@ impl Element for PaneBackdrop { _bounds: RectF, _layout: &Self::LayoutState, _paint: &Self::PaintState, - view: &V, - cx: &gpui::ViewContext, + view: &Pane, + cx: &gpui::ViewContext, ) -> serde_json::Value { gpui::json::json!({ "type": "Pane Back Drop", diff --git a/crates/workspace/src/pane/dragged_item_receiver.rs b/crates/workspace/src/pane/dragged_item_receiver.rs index 86db11052993ac46051faa4f7398c369845e9d24..2b529ac4256ea6058b721dfaa4e41a89c5ae12c1 100644 --- a/crates/workspace/src/pane/dragged_item_receiver.rs +++ b/crates/workspace/src/pane/dragged_item_receiver.rs @@ -5,7 +5,7 @@ use gpui::{ geometry::{rect::RectF, vector::Vector2F}, platform::MouseButton, scene::MouseUp, - AppContext, Element, ElementBox, EventContext, MouseState, Quad, ViewContext, WeakViewHandle, + AppContext, Element, ElementBox, MouseState, Quad, ViewContext, WeakViewHandle, }; use project::ProjectEntryId; use settings::Settings; @@ -24,10 +24,10 @@ pub fn dragged_item_receiver( split_margin: Option, cx: &mut ViewContext, render_child: F, -) -> MouseEventHandler +) -> MouseEventHandler where Tag: 'static, - F: FnOnce(&mut MouseState, &mut ViewContext) -> ElementBox, + F: FnOnce(&mut MouseState, &mut ViewContext) -> ElementBox, { MouseEventHandler::::above(region_id, cx, |state, _, cx| { // Observing hovered will cause a render when the mouse enters regardless @@ -48,7 +48,7 @@ where Stack::new() .with_child(render_child(state, cx)) .with_children(drag_position.map(|drag_position| { - Canvas::new(move |bounds, _, cx| { + Canvas::new(move |scene, bounds, _, cx| { if bounds.contains_point(drag_position) { let overlay_region = split_margin .and_then(|split_margin| { @@ -58,7 +58,7 @@ where .map(|(dir, margin)| dir.along_edge(bounds, margin)) .unwrap_or(bounds); - cx.paint_stacking_context(None, None, |cx| { + scene.paint_stacking_context(None, None, |cx| { scene.push_quad(Quad { bounds: overlay_region, background: Some(overlay_color(cx)), @@ -102,7 +102,7 @@ pub fn handle_dropped_item( index: usize, allow_same_pane: bool, split_margin: Option, - cx: &mut ViewContext, + cx: &mut ViewContext, ) { enum Action { Move(WeakViewHandle, usize), diff --git a/crates/workspace/src/pane_group.rs b/crates/workspace/src/pane_group.rs index 286d3cebbef031fededcc4ab1d00d3a08f8903aa..048cb7150af1e5a03029e4bce5bb03b5feab8052 100644 --- a/crates/workspace/src/pane_group.rs +++ b/crates/workspace/src/pane_group.rs @@ -71,7 +71,7 @@ impl PaneGroup { active_call: Option<&ModelHandle>, active_pane: &ViewHandle, cx: &mut ViewContext, - ) -> ElementBox { + ) -> ElementBox { self.root.render( project, theme, @@ -132,7 +132,7 @@ impl Member { active_call: Option<&ModelHandle>, active_pane: &ViewHandle, cx: &mut ViewContext, - ) -> ElementBox { + ) -> ElementBox { enum FollowIntoExternalProject {} match self { @@ -367,7 +367,7 @@ impl PaneAxis { active_call: Option<&ModelHandle>, active_pane: &ViewHandle, cx: &mut ViewContext, - ) -> ElementBox { + ) -> ElementBox { let last_member_ix = self.members.len() - 1; Flex::new(self.axis) .with_children(self.members.iter().enumerate().map(|(ix, member)| { diff --git a/crates/workspace/src/shared_screen.rs b/crates/workspace/src/shared_screen.rs index cad832a56de88f914b4242ca13197de70763276a..26db3edb016daae69326c0f46e7a6afe3fb1eac0 100644 --- a/crates/workspace/src/shared_screen.rs +++ b/crates/workspace/src/shared_screen.rs @@ -64,12 +64,12 @@ impl View for SharedScreen { "SharedScreen" } - fn render(&mut self, cx: &mut ViewContext) -> ElementBox { + fn render(&mut self, cx: &mut ViewContext) -> ElementBox { enum Focus {} let frame = self.frame.clone(); MouseEventHandler::::new(0, cx, |_, cx| { - Canvas::new(move |bounds, _, cx| { + Canvas::new(move |scene, bounds, _, cx| { if let Some(frame) = frame.clone() { let size = constrain_size_preserving_aspect_ratio( bounds.size(), @@ -103,7 +103,7 @@ impl Item for SharedScreen { _: Option, style: &theme::Tab, _: &AppContext, - ) -> gpui::ElementBox { + ) -> gpui::ElementBox { Flex::row() .with_child( Svg::new("icons/disable_screen_sharing_12.svg") diff --git a/crates/workspace/src/sidebar.rs b/crates/workspace/src/sidebar.rs index 0a0d9339a3de510f67d5ca4a22a2507e717fb66a..e9b6250a09f0d5e65bdea284faa62dd9ba8d0a9b 100644 --- a/crates/workspace/src/sidebar.rs +++ b/crates/workspace/src/sidebar.rs @@ -188,7 +188,7 @@ impl View for Sidebar { "Sidebar" } - fn render(&mut self, cx: &mut ViewContext) -> ElementBox { + fn render(&mut self, cx: &mut ViewContext) -> ElementBox { if let Some(active_item) = self.active_item() { enum ResizeHandleTag {} let style = &cx.global::().theme.workspace.sidebar; @@ -225,7 +225,7 @@ impl View for SidebarButtons { "SidebarToggleButton" } - fn render(&mut self, cx: &mut ViewContext) -> ElementBox { + fn render(&mut self, cx: &mut ViewContext) -> ElementBox { let theme = &cx.global::().theme; let tooltip_style = theme.tooltip.clone(); let theme = &theme.workspace.status_bar.sidebar_buttons; diff --git a/crates/workspace/src/status_bar.rs b/crates/workspace/src/status_bar.rs index 3c35b986d783151319a51a4c20d99e3c9ba1b2ce..ca919808ee6b290bdcada7f41b072a6ea7d7171f 100644 --- a/crates/workspace/src/status_bar.rs +++ b/crates/workspace/src/status_bar.rs @@ -8,8 +8,8 @@ use gpui::{ vector::{vec2f, Vector2F}, }, json::{json, ToJson}, - AnyViewHandle, AppContext, DebugContext, ElementBox, Entity, LayoutContext, MeasurementContext, - PaintContext, SceneBuilder, SizeConstraint, Subscription, View, ViewContext, ViewHandle, + AnyViewHandle, AppContext, ElementBox, Entity, SceneBuilder, SizeConstraint, Subscription, + View, ViewContext, ViewHandle, }; use settings::Settings; @@ -42,7 +42,7 @@ impl View for StatusBar { "StatusBar" } - fn render(&mut self, cx: &mut ViewContext) -> ElementBox { + fn render(&mut self, cx: &mut ViewContext) -> ElementBox { let theme = &cx.global::().theme.workspace.status_bar; StatusBarElement { @@ -139,19 +139,19 @@ impl From<&dyn StatusItemViewHandle> for AnyViewHandle { } struct StatusBarElement { - left: ElementBox, - right: ElementBox, + left: ElementBox, + right: ElementBox, } -impl Element for StatusBarElement { +impl Element for StatusBarElement { type LayoutState = (); type PaintState = (); fn layout( &mut self, mut constraint: SizeConstraint, - view: &mut V, - cx: &mut ViewContext, + view: &mut StatusBar, + cx: &mut ViewContext, ) -> (Vector2F, Self::LayoutState) { let max_width = constraint.max.x(); constraint.min = vec2f(0., constraint.min.y()); @@ -173,8 +173,8 @@ impl Element for StatusBarElement { bounds: RectF, visible_bounds: RectF, _: &mut Self::LayoutState, - view: &mut V, - cx: &mut ViewContext, + view: &mut StatusBar, + cx: &mut ViewContext, ) -> Self::PaintState { let origin_y = bounds.upper_right().y(); let visible_bounds = bounds.intersection(visible_bounds).unwrap_or_default(); @@ -195,7 +195,8 @@ impl Element for StatusBarElement { _: RectF, _: &Self::LayoutState, _: &Self::PaintState, - _: &MeasurementContext, + _: &StatusBar, + _: &ViewContext, ) -> Option { None } @@ -205,7 +206,8 @@ impl Element for StatusBarElement { bounds: RectF, _: &Self::LayoutState, _: &Self::PaintState, - _: &DebugContext, + _: &StatusBar, + _: &ViewContext, ) -> serde_json::Value { json!({ "type": "StatusBarElement", diff --git a/crates/workspace/src/toolbar.rs b/crates/workspace/src/toolbar.rs index 2ef45c0411a9c1074c516d66acc1cb6b0cd53a59..814abd30d4f26f7aee9799aa425d5b9ae6647957 100644 --- a/crates/workspace/src/toolbar.rs +++ b/crates/workspace/src/toolbar.rs @@ -59,7 +59,7 @@ impl View for Toolbar { "Toolbar" } - fn render(&mut self, cx: &mut ViewContext) -> ElementBox { + fn render(&mut self, cx: &mut ViewContext) -> ElementBox { let theme = &cx.global::().theme.workspace.toolbar; let mut primary_left_items = Vec::new(); @@ -169,7 +169,7 @@ fn nav_button( tooltip_action: A, action_name: &str, cx: &mut ViewContext, -) -> ElementBox { +) -> ElementBox { MouseEventHandler::::new(0, cx, |state, _| { let style = if enabled { style.style_for(state, false) diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 3253f9db6aa033e4d6a73ba3fcc1ac8795f3f9be..d107279c4516d5e21abff616218de5970ecd20bc 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -2053,7 +2053,7 @@ impl Workspace { self.leader_state.followers.contains(&peer_id) } - fn render_titlebar(&self, theme: &Theme, cx: &mut ViewContext) -> ElementBox { + fn render_titlebar(&self, theme: &Theme, cx: &mut ViewContext) -> ElementBox { // TODO: There should be a better system in place for this // (https://github.com/zed-industries/zed/issues/1290) let is_fullscreen = cx.window_is_fullscreen(); @@ -2153,7 +2153,10 @@ impl Workspace { } } - fn render_disconnected_overlay(&self, cx: &mut ViewContext) -> Option { + fn render_disconnected_overlay( + &self, + cx: &mut ViewContext, + ) -> Option> { if self.project.read(cx).is_read_only() { enum DisconnectedOverlay {} Some( @@ -2181,7 +2184,7 @@ impl Workspace { &self, theme: &theme::Workspace, cx: &AppContext, - ) -> Option { + ) -> Option> { if self.notifications.is_empty() { None } else { @@ -2809,7 +2812,7 @@ impl View for Workspace { "Workspace" } - fn render(&mut self, cx: &mut ViewContext) -> ElementBox { + fn render(&mut self, cx: &mut ViewContext) -> ElementBox { let theme = cx.global::().theme.clone(); Stack::new() .with_child(