Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Checkpoint
Antonio Scandurra18abb068b18a
diff --git a/crates/gpui3/src/elements/nested.rs b/crates/gpui3/src/elements/nested.rsindex 8800b26d9e5..360a0a319c4 100644--- a/crates/gpui3/src/elements/nested.rs+++ b/crates/gpui3/src/elements/nested.rs@@ -1,7 +1,7 @@use crate::{group_bounds, AnyElement, BorrowWindow, Bounds, DispatchPhase, Element, ElementId,- IdentifiedElement, IntoAnyElement, MouseDownEvent, MouseMoveEvent, MouseUpEvent, SharedString,- Style, StyleCascade, StyleRefinement, ViewContext,+ IdentifiedElement, IntoAnyElement, MouseDownEvent, MouseMoveEvent, MouseUpEvent, Overflow,+ ScrollState, SharedString, Style, StyleCascade, StyleRefinement, ViewContext,};use parking_lot::Mutex;use refineable::{CascadeSlot, Refineable};@@ -466,6 +466,55 @@ pub struct Div<V: 'static + Send + Sync, K: ElementKind>(ClickableElement<HoverableElement<LayoutNodeElement<V, K>>>,);+impl<V: 'static + Send + Sync, K: ElementKind> Div<V, K> {+ pub fn z_index(mut self, z_index: u32) -> Self {+ self.base_style().z_index = Some(z_index);+ self+ }++ pub fn overflow_hidden(mut self) -> Self {+ self.base_style().overflow.x = Some(Overflow::Hidden);+ self.base_style().overflow.y = Some(Overflow::Hidden);+ self+ }++ pub fn overflow_hidden_x(mut self) -> Self {+ self.base_style().overflow.x = Some(Overflow::Hidden);+ self+ }++ pub fn overflow_hidden_y(mut self) -> Self {+ self.base_style().overflow.y = Some(Overflow::Hidden);+ self+ }++ pub fn overflow_scroll(mut self, scroll_state: ScrollState) -> Self {+ // todo!("impl scrolling")+ // self.scroll_state = Some(scroll_state);+ self.base_style().overflow.x = Some(Overflow::Scroll);+ self.base_style().overflow.y = Some(Overflow::Scroll);+ self+ }++ pub fn overflow_x_scroll(mut self, scroll_state: ScrollState) -> Self {+ // todo!("impl scrolling")+ // self.scroll_state = Some(scroll_state);+ self.base_style().overflow.x = Some(Overflow::Scroll);+ self+ }++ pub fn overflow_y_scroll(mut self, scroll_state: ScrollState) -> Self {+ // todo!("impl scrolling")+ // self.scroll_state = Some(scroll_state);+ self.base_style().overflow.y = Some(Overflow::Scroll);+ self+ }++ fn base_style(&mut self) -> &mut StyleRefinement {+ self.style_cascade().base()+ }+}+impl<V: 'static + Send + Sync> Div<V, Anonymous> {pub fn id(self, id: impl Into<ElementId>) -> Div<V, Identified> {Div(self.0.replace_child(|hoverable| {