mirror of
https://github.com/emilk/egui.git
synced 2026-06-28 07:23:13 -04:00
Add a minimum width to TextEdit to prevent them from being tiny
This commit is contained in:
@@ -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| {
|
||||
|
||||
Reference in New Issue
Block a user