summaryrefslogtreecommitdiffstats
path: root/widget/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-04-02 10:12:07 +0200
committerLibravatar GitHub <noreply@github.com>2024-04-02 10:12:07 +0200
commitb17f8904821e25b26cc5a85cc42b47790472848c (patch)
tree38f912fe948595b189b0fa4a65009914b4780680 /widget/src
parent99a904112ca111f2ab0e60e30b6c369741b1653b (diff)
parent385a4490fb6a344873ba5154275a33acc011d080 (diff)
downloadiced-b17f8904821e25b26cc5a85cc42b47790472848c.tar.gz
iced-b17f8904821e25b26cc5a85cc42b47790472848c.tar.bz2
iced-b17f8904821e25b26cc5a85cc42b47790472848c.zip
Merge pull request #2358 from bungoboingo/text-editor-font-size
Some text_editor QoL
Diffstat (limited to 'widget/src')
-rw-r--r--widget/src/text_editor.rs15
1 files changed, 15 insertions, 0 deletions
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<Pixels>) -> 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<text::LineHeight>,
+ ) -> Self {
+ self.line_height = line_height.into();
+ self
+ }
+
/// Sets the [`Padding`] of the [`TextEditor`].
pub fn padding(mut self, padding: impl Into<Padding>) -> Self {
self.padding = padding.into();