mirror of
https://github.com/storytold/egui.git
synced 2026-11-30 10:16:24 +01:00
select all text when dragvalue gets focus (#2650)
This commit is contained in:
1 parent
21a59143a4
commit
d15f4ef992
1 file changed
+6
@@ -507,6 +507,12 @@ impl<'a> Widget for DragValue<'a> {
|
||||
mem.drag_value.edit_string = None;
|
||||
mem.request_focus(id);
|
||||
});
|
||||
let mut state = TextEdit::load_state(ui.ctx(), id).unwrap_or_default();
|
||||
state.set_ccursor_range(Some(text::CCursorRange::two(
|
||||
epaint::text::cursor::CCursor::default(),
|
||||
epaint::text::cursor::CCursor::new(value_text.chars().count()),
|
||||
)));
|
||||
state.store(ui.ctx(), response.id);
|
||||
} else if response.dragged() {
|
||||
ui.ctx().set_cursor_icon(CursorIcon::ResizeHorizontal);
|
||||
|
||||
|
||||
Reference in new issue
Block a user