mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
Properly respect min_size in TextEdit
This commit is contained in:
@@ -478,7 +478,8 @@ impl TextEdit<'_> {
|
||||
let desired_width = desired_width
|
||||
.unwrap_or_else(|| ui.spacing().text_edit_width)
|
||||
.at_least(min_size.x);
|
||||
let allocate_width = desired_width.at_most(available_width);
|
||||
// `min_size` overrides available width
|
||||
let allocate_width = desired_width.at_most(available_width).at_least(min_size.x);
|
||||
|
||||
let font_id_clone = font_id.clone();
|
||||
let mut default_layouter = move |ui: &Ui, text: &dyn TextBuffer, wrap_width: f32| {
|
||||
@@ -695,7 +696,7 @@ impl TextEdit<'_> {
|
||||
let custom_frame = frame.is_some();
|
||||
let frame = frame.unwrap_or_else(|| Frame::new().inner_margin(margin));
|
||||
|
||||
let min_height = min_inner_height + frame.total_margin().sum().y;
|
||||
let min_height = (min_inner_height + frame.total_margin().sum().y).at_least(min_size.y);
|
||||
|
||||
// This wrap mode only affects the hint_text
|
||||
let wrap_mode = if multiline {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:75e5610bd64f6beda7abb005344eff1f5ee23220272077d3b6ee5345baa616aa
|
||||
size 9095
|
||||
oid sha256:2e19af6fe25539c5624a27e20fe78f8d9076bb0c11decf916ecc6434e321b87e
|
||||
size 9054
|
||||
|
||||
Reference in New Issue
Block a user