egui/crates
MStarha f408ccafbc
Fix `DragValue` expansion when editing (#5809)
* [x] I have followed the instructions in the PR template

This PR fixes an issue, where `DragValue` would expand when it enters
editing state. There were 3 contributing problems:
- A workaround introduced in #4276 caused the `DragValue` to report
incorrect outer size.
- The `DragValue` uses `TextEdit` internally and sets both `min_size`
and `desired_width` to the same value - desired width is used **before**
padding is applied - this is in contrast to `Button` (also used
internally by `DragValue`), which only uses `min_size`. This caused the
`DragValue` to expand horizontally by the size of button padding.
- The height of the `TextEdit` is (among other things) determined by the
height of the row, which was not present in `Button`. This caused a
small vertical expansion, when the contents (including padding) were
larger than the `min_size`.


![egui_drag_value_expansion](https://github.com/user-attachments/assets/b6fe9bd8-5755-4a43-8b61-a7e5b24e678d)
Here the dimensions set in code are:
- padding: 20 x 20 pt
- interact size: 80 x 30 pt

*Note: I do not know what's up with the tests. When I ran the check
script, they were failing because of 3 UI missmatches, so I updated the
snapshots. Now, the updated snapshots cause the same failure in CI, that
appeared locally before the update. Now the locally run tests fail with
`The platform you're compiling for is not supported by winit` and couple
more following errors coming from the same source (`winit 0.30.7`).*
2025-03-20 10:40:22 +01:00
..
ecolor Add color picker menu item example (#5755) 2025-03-19 09:33:17 +01:00
eframe Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00
egui Fix `DragValue` expansion when editing (#5809) 2025-03-20 10:40:22 +01:00
egui-wgpu Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00
egui-winit Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00
egui_demo_app Add `Ui::close` and `Response::should_close` (#5729) 2025-02-20 17:59:29 +01:00
egui_demo_lib Add color picker menu item example (#5755) 2025-03-19 09:33:17 +01:00
egui_extras refactor mime type support detection in image loader to allow for deferred handling and appended encoding info (#5686) 2025-03-18 11:51:00 +01:00
egui_glow Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00
egui_kittest Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00
egui_plot Move `egui_plot` to its own repo (#4828) 2024-07-15 18:45:19 +02:00
egui_web Fix typos (#2866) 2023-04-18 15:52:45 +02:00
emath Add `Popup` and `Tooltip`, unifying the previous behaviours (#5713) 2025-02-18 15:53:07 +01:00
epaint Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00
epaint_default_fonts Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00