Add a minimum width to TextEdit to prevent them from being tiny
This commit is contained in:
parent
f940ae9edf
commit
d865852d24
1 changed files with 2 additions and 1 deletions
|
@ -458,7 +458,8 @@ impl<'t, S: TextBuffer> TextEdit<'t, S> {
|
|||
.or(ui.style().override_text_style)
|
||||
.unwrap_or_else(|| ui.style().body_text_style);
|
||||
let line_spacing = ui.fonts().row_height(text_style);
|
||||
let available_width = ui.available_width();
|
||||
const MIN_WIDTH: f32 = 24.0; // Never make a `TextEdit` more narrow than this.
|
||||
let available_width = ui.available_width().at_least(MIN_WIDTH);
|
||||
let desired_width = desired_width.unwrap_or_else(|| ui.spacing().text_edit_width);
|
||||
|
||||
let make_galley = |ui: &Ui, text: &str| {
|
||||
|
|
Loading…
Reference in a new issue