From 46451f2a8b2f5462c2acba95f49bce813ad14372 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 6 Sep 2023 14:31:44 -0600 Subject: [PATCH] Render borders in gpui2 divs --- crates/gpui2/src/elements/div.rs | 1 + crates/gpui2/src/style.rs | 9 +++ crates/gpui2_macros/src/styleable_helpers.rs | 85 +++++++++++++++++--- crates/storybook/src/collab_panel.rs | 6 +- 4 files changed, 90 insertions(+), 11 deletions(-) diff --git a/crates/gpui2/src/elements/div.rs b/crates/gpui2/src/elements/div.rs index baf816ab77771e52cc71329d837b520dc2c71b51..081b4f65a3ae1f09e303877688eb66d898355ca1 100644 --- a/crates/gpui2/src/elements/div.rs +++ b/crates/gpui2/src/elements/div.rs @@ -73,6 +73,7 @@ impl Element for Div { for child in &mut self.children { child.paint(view, layout.bounds.origin(), cx); } + style.paint_foreground(layout.bounds, cx); if pop_text_style { cx.pop_text_style(); } diff --git a/crates/gpui2/src/style.rs b/crates/gpui2/src/style.rs index 90b8cdf49b02356e4f31a7c311733106835f58d1..5ec08123929ac3d376ac6deb5ecdf8c7f013de6a 100644 --- a/crates/gpui2/src/style.rs +++ b/crates/gpui2/src/style.rs @@ -477,6 +477,15 @@ pub trait StyleHelpers: Styleable