mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Fix LineEdit's placeholder text being selected when double clicking
This commit is contained in:
parent
6e4e8072e1
commit
40d56c98bc
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;
|
selection.creating = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (selecting_enabled) {
|
if (selecting_enabled && !text.is_empty()) {
|
||||||
const int triple_click_timeout = 600;
|
const int triple_click_timeout = 600;
|
||||||
const int triple_click_tolerance = 5;
|
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;
|
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.
|
// Triple-click select all.
|
||||||
selection.enabled = true;
|
selection.enabled = true;
|
||||||
selection.begin = 0;
|
selection.begin = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue