From c7a3186d085bdd10fc723db8bb964b6317e45968 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 18 Sep 2023 20:17:27 -0600 Subject: [PATCH] Checkpoint --- crates/gpui/src/geometry.rs | 32 +++++++++---------- crates/gpui2/src/style.rs | 6 ++-- crates/gpui2_macros/src/styleable_helpers.rs | 28 +++++++++------- crates/storybook/src/ui/component/facepile.rs | 22 ++++++------- 4 files changed, 45 insertions(+), 43 deletions(-) diff --git a/crates/gpui/src/geometry.rs b/crates/gpui/src/geometry.rs index d1b8302ad4..40b0682787 100644 --- a/crates/gpui/src/geometry.rs +++ b/crates/gpui/src/geometry.rs @@ -194,8 +194,8 @@ where impl Size { pub fn zero() -> Self { Self { - width: pixels(0.), - height: pixels(0.), + width: pixels(0.).into(), + height: pixels(0.).into(), } } @@ -258,10 +258,10 @@ impl Edges { pub fn zero() -> Self { Self { - top: pixels(0.), - right: pixels(0.), - bottom: pixels(0.), - left: pixels(0.), + top: pixels(0.).into(), + right: pixels(0.).into(), + bottom: pixels(0.).into(), + left: pixels(0.).into(), } } @@ -281,10 +281,10 @@ impl Edges { impl Edges { pub fn zero() -> Self { Self { - top: pixels(0.), - right: pixels(0.), - bottom: pixels(0.), - left: pixels(0.), + top: pixels(0.).into(), + right: pixels(0.).into(), + bottom: pixels(0.).into(), + left: pixels(0.).into(), } } @@ -430,16 +430,16 @@ impl std::fmt::Debug for Length { } } -pub fn relative>(fraction: f32) -> T { - DefiniteLength::Relative(fraction).into() +pub fn relative(fraction: f32) -> DefiniteLength { + DefiniteLength::Relative(fraction) } -pub fn rems>(rems: f32) -> T { - AbsoluteLength::Rems(rems).into() +pub fn rems(rems: f32) -> AbsoluteLength { + AbsoluteLength::Rems(rems) } -pub fn pixels>(pixels: f32) -> T { - AbsoluteLength::Pixels(pixels).into() +pub fn pixels(pixels: f32) -> AbsoluteLength { + AbsoluteLength::Pixels(pixels) } pub fn auto() -> Length { diff --git a/crates/gpui2/src/style.rs b/crates/gpui2/src/style.rs index 688883416f..3e4acd57e7 100644 --- a/crates/gpui2/src/style.rs +++ b/crates/gpui2/src/style.rs @@ -328,8 +328,8 @@ pub trait StyleHelpers: Styleable