We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f392f4a + 7c7e94c commit 295aae4Copy full SHA for 295aae4
1 file changed
widget/src/text_editor.rs
@@ -109,6 +109,12 @@ where
109
self
110
}
111
112
+ /// Sets the width of the [`TextEditor`].
113
+ pub fn width(mut self, width: impl Into<Pixels>) -> Self {
114
+ self.width = Length::from(width.into());
115
+ self
116
+ }
117
+
118
/// Sets the message that should be produced when some action is performed in
119
/// the [`TextEditor`].
120
///
@@ -498,7 +504,7 @@ where
498
504
state.highlighter_settings = self.highlighter_settings.clone();
499
505
500
506
501
- let limits = limits.height(self.height);
507
+ let limits = limits.width(self.width).height(self.height);
502
508
503
509
internal.editor.update(
510
limits.shrink(self.padding).max(),
0 commit comments