mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Merge pull request #110886 from fstxz/fix-line-edit-double-click
Fix LineEdit's placeholder text being selected when double clicking
This commit is contained in:
commit
1889f68007
1 changed files with 2 additions and 2 deletions
|
@ -480,12 +480,12 @@ void LineEdit::gui_input(const Ref<InputEvent> &p_event) {
|
|||
selection.creating = true;
|
||||
|
||||
} else {
|
||||
if (selecting_enabled) {
|
||||
if (selecting_enabled && !text.is_empty()) {
|
||||
const int triple_click_timeout = 600;
|
||||
const int triple_click_tolerance = 5;
|
||||
const bool is_triple_click = !b->is_double_click() && (OS::get_singleton()->get_ticks_msec() - last_dblclk) < triple_click_timeout && b->get_position().distance_to(last_dblclk_pos) < triple_click_tolerance;
|
||||
|
||||
if (is_triple_click && !text.is_empty()) {
|
||||
if (is_triple_click) {
|
||||
// Triple-click select all.
|
||||
selection.enabled = true;
|
||||
selection.begin = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue