You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-13 13:31:48 +00:00
Allow to override drop data in LineEdit
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user