diff options
author | ConteZero <one@contezero.com> | 2021-10-12 09:43:50 +0200 |
---|---|---|
committer | ConteZero <one@contezero.com> | 2021-10-18 14:01:06 +0200 |
commit | 838c9d37b4a2fbceff07e859a52838473e00850e (patch) | |
tree | a2ae28f064ffb3722a6618b96856934dbae75078 /scene/gui/rich_text_label.cpp | |
parent | 0fd50ff21777e74258ba5a38e9c32b27cf0784b2 (diff) |
Added primary clipboard for Linux
Diffstat (limited to 'scene/gui/rich_text_label.cpp')
-rw-r--r-- | scene/gui/rich_text_label.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 4588966d88..c9cc822829 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -1596,12 +1596,16 @@ void RichTextLabel::gui_input(const Ref<InputEvent> &p_event) { selection.to_char = words[i + 1]; selection.active = true; + DisplayServer::get_singleton()->clipboard_set_primary(get_selected_text()); update(); break; } } } } else if (!b->is_pressed()) { + if (selection.enabled) { + DisplayServer::get_singleton()->clipboard_set_primary(get_selected_text()); + } selection.click_item = nullptr; if (!b->is_double_click() && !scroll_updated) { @@ -1719,6 +1723,7 @@ void RichTextLabel::gui_input(const Ref<InputEvent> &p_event) { swap = true; } else if (selection.from_char == selection.to_char) { selection.active = false; + update(); return; } } |