From 8260b5f6a0805b1911ae0d44be99d403c14546ee Mon Sep 17 00:00:00 2001 From: reya <123083837+reyamir@users.noreply.github.com> Date: Tue, 17 Dec 2024 08:22:48 +0700 Subject: [PATCH] fix: wrong size variant in sizable trait (#493) --- crates/ui/src/styled.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/crates/ui/src/styled.rs b/crates/ui/src/styled.rs index b70955a9..f2e863e5 100644 --- a/crates/ui/src/styled.rs +++ b/crates/ui/src/styled.rs @@ -208,6 +208,7 @@ pub trait Disableable { } /// A trait for setting the size of an element. +/// Size::Medium is use by default. pub trait Sizable: Sized { /// Set the ui::Size of this element. /// @@ -215,17 +216,17 @@ pub trait Sizable: Sized { /// Or a `Pixels` to set a custom size: `px(30.)` fn with_size(self, size: impl Into) -> Self; - /// Set to Size::Small - fn small(self) -> Self { - self.with_size(Size::Small) - } - /// Set to Size::XSmall fn xsmall(self) -> Self { self.with_size(Size::XSmall) } - /// Set to Size::Medium + /// Set to Size::Small + fn small(self) -> Self { + self.with_size(Size::Small) + } + + /// Set to Size::Large fn large(self) -> Self { self.with_size(Size::Large) }