From 07b0aed5d35013a17deea7ce7824c744decef568 Mon Sep 17 00:00:00 2001 From: Bingus Date: Wed, 6 Dec 2023 14:52:53 -0800 Subject: [PATCH] Added the ability to change the style of a TextEditor --- widget/src/text_editor.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index 63d488684b..a2a186f0f4 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<::Style>, + ) -> Self { + self.style = style.into(); + self + } } /// The content of a [`TextEditor`].