mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 07:53:26 +00:00
Fix LineEdit's placeholder text being selected when double clicking
(cherry picked from commit 40d56c98bc
)
This commit is contained in:
parent
b70ddd29a0
commit
fb9d73438d
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