From 385a4490fb6a344873ba5154275a33acc011d080 Mon Sep 17 00:00:00 2001 From: Bingus Date: Fri, 29 Mar 2024 16:58:11 -0700 Subject: Expose line_height & text_size fields for the text_editor widget --- widget/src/text_editor.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index a00df3c7..92cdb251 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -110,6 +110,21 @@ where self } + /// Sets the text size of the [`TextEditor`]. + pub fn size(mut self, size: impl Into) -> Self { + self.text_size = Some(size.into()); + self + } + + /// Sets the [`text::LineHeight`] of the [`TextEditor`]. + pub fn line_height( + mut self, + line_height: impl Into, + ) -> Self { + self.line_height = line_height.into(); + self + } + /// Sets the [`Padding`] of the [`TextEditor`]. pub fn padding(mut self, padding: impl Into) -> Self { self.padding = padding.into(); -- cgit