summaryrefslogtreecommitdiffstats
path: root/widget
diff options
context:
space:
mode:
authorLibravatar Bingus <shankern@protonmail.com>2023-12-06 14:52:53 -0800
committerLibravatar Bingus <shankern@protonmail.com>2023-12-06 14:52:53 -0800
commit07b0aed5d35013a17deea7ce7824c744decef568 (patch)
treebc738a00d6974586fb31cfaec26156bcc0bf4628 /widget
parentfc285d3e461626408c56bbc1605fcf0c974b2f69 (diff)
downloadiced-07b0aed5d35013a17deea7ce7824c744decef568.tar.gz
iced-07b0aed5d35013a17deea7ce7824c744decef568.tar.bz2
iced-07b0aed5d35013a17deea7ce7824c744decef568.zip
Added the ability to change the style of a TextEditor
Diffstat (limited to '')
-rw-r--r--widget/src/text_editor.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs
index 63d48868..a2a186f0 100644
--- a/widget/src/text_editor.rs
+++ b/widget/src/text_editor.rs
@@ -128,6 +128,15 @@ where
highlighter_format: to_format,
}
}
+
+ /// Sets the style of the [`TextEditor`].
+ pub fn style(
+ mut self,
+ style: impl Into<<Renderer::Theme as StyleSheet>::Style>,
+ ) -> Self {
+ self.style = style.into();
+ self
+ }
}
/// The content of a [`TextEditor`].