summaryrefslogtreecommitdiffstats
path: root/scene/gui/line_edit.cpp
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2020-12-13 20:16:56 +0100
committerkobewi <kobewi4e@gmail.com>2020-12-13 20:16:56 +0100
commita3a31591b53da6a79f37760d0e7ee34d6d4e4ee6 (patch)
tree62362ddfed0a61955ebcbb82dece170bdb072119 /scene/gui/line_edit.cpp
parent06314c1b0e8100546a53cf2786fa244c5d19af6f (diff)
downloadredot-engine-a3a31591b53da6a79f37760d0e7ee34d6d4e4ee6.tar.gz
Allow to override drop data in LineEdit
Diffstat (limited to 'scene/gui/line_edit.cpp')
-rw-r--r--scene/gui/line_edit.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 9f8b944f4c..5936ebb880 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -635,10 +635,17 @@ Variant LineEdit::get_drag_data(const Point2 &p_point) {
}
bool LineEdit::can_drop_data(const Point2 &p_point, const Variant &p_data) const {
+ bool drop_override = Control::can_drop_data(p_point, p_data); // In case user wants to drop custom data.
+ if (drop_override) {
+ return drop_override;
+ }
+
return p_data.get_type() == Variant::STRING;
}
void LineEdit::drop_data(const Point2 &p_point, const Variant &p_data) {
+ Control::drop_data(p_point, p_data);
+
if (p_data.get_type() == Variant::STRING) {
set_cursor_at_pixel_pos(p_point.x);
int selected = selection.end - selection.begin;