summaryrefslogtreecommitdiffstats
path: root/widget/src/text_editor.rs
diff options
context:
space:
mode:
authorLibravatar Gigas002 <24297712+Gigas002@users.noreply.github.com>2024-04-16 00:08:17 +0900
committerLibravatar GitHub <noreply@github.com>2024-04-16 00:08:17 +0900
commit0ebe0629cef37aee5c48b9409fc36618a3a3e60d (patch)
tree909d9ecf28e7c491bae3afc81928c118517fa7a9 /widget/src/text_editor.rs
parent13bd106fc585034a7aba17b9c17589113274aaf5 (diff)
parent105b8bd5ad6ade1f203a0d8b0b93bd06f61f621a (diff)
downloadiced-0ebe0629cef37aee5c48b9409fc36618a3a3e60d.tar.gz
iced-0ebe0629cef37aee5c48b9409fc36618a3a3e60d.tar.bz2
iced-0ebe0629cef37aee5c48b9409fc36618a3a3e60d.zip
Merge branch 'iced-rs:master' into viewer_content_fit
Diffstat (limited to 'widget/src/text_editor.rs')
-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();