Browse Source

Add a minimum width to TextEdit to prevent them from being tiny

pull/649/head
Emil Ernerfeldt 3 years ago
parent
commit
d865852d24
  1. 3
      egui/src/widgets/text_edit.rs

3
egui/src/widgets/text_edit.rs

@ -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…
Cancel
Save