unleash the sizes

This commit is contained in:
2025-09-25 21:30:26 -04:00
parent 06cfeaac6b
commit 5f2dffc189
5 changed files with 24 additions and 24 deletions

View File

@@ -70,7 +70,7 @@ impl<const LEN: usize, Wa: WidgetArrLike<LEN, Tag>, Tag> StackBuilder<LEN, Wa, T
}
}
pub fn stack_size(mut self, size: StackSize) -> Self {
pub fn size(mut self, size: StackSize) -> Self {
self.size = size;
self
}

View File

@@ -12,7 +12,7 @@ pub struct Text {
}
impl Text {
pub fn font_size(mut self, size: impl UiNum) -> Self {
pub fn size(mut self, size: impl UiNum) -> Self {
self.attrs.font_size = size.to_f32();
self.attrs.line_height = self.attrs.font_size * 1.1;
self
@@ -97,7 +97,7 @@ pub struct TextBuilder {
}
impl TextBuilder {
pub fn font_size(mut self, size: impl UiNum) -> Self {
pub fn size(mut self, size: impl UiNum) -> Self {
self.attrs.font_size = size.to_f32();
self.attrs.line_height = self.attrs.font_size * 1.1;
self

View File

@@ -92,7 +92,7 @@ pub struct TextEditBuilder {
}
impl TextEditBuilder {
pub fn font_size(mut self, size: impl UiNum) -> Self {
pub fn size(mut self, size: impl UiNum) -> Self {
self.attrs.font_size = size.to_f32();
self.attrs.line_height = self.attrs.font_size * 1.1;
self

View File

@@ -6,7 +6,7 @@ pub trait CoreWidget<W, Tag> {
fn align(self, align: Align) -> impl WidgetFn<Aligned>;
fn center(self) -> impl WidgetFn<Aligned>;
fn label(self, label: impl Into<String>) -> impl WidgetIdFn<W>;
fn size(self, size: impl Into<Vec2>) -> impl WidgetFn<Sized>;
fn sized(self, size: impl Into<Vec2>) -> impl WidgetFn<Sized>;
}
impl<W: WidgetLike<Tag>, Tag> CoreWidget<W::Widget, Tag> for W {
@@ -36,7 +36,7 @@ impl<W: WidgetLike<Tag>, Tag> CoreWidget<W::Widget, Tag> for W {
}
}
fn size(self, size: impl Into<Vec2>) -> impl WidgetFn<Sized> {
fn sized(self, size: impl Into<Vec2>) -> impl WidgetFn<Sized> {
move |ui| Sized {
inner: self.add(ui).any(),
size: size.into(),