mirror of https://github.com/godotengine/godot
Merge pull request #75122 from KoBeWi/get_drug_data
Fix get_drag_data not overridable in some Controls
This commit is contained in:
commit
f3d1cc39a2
|
|
@ -638,6 +638,11 @@ HorizontalAlignment LineEdit::get_horizontal_alignment() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
Variant LineEdit::get_drag_data(const Point2 &p_point) {
|
Variant LineEdit::get_drag_data(const Point2 &p_point) {
|
||||||
|
Variant ret = Control::get_drag_data(p_point);
|
||||||
|
if (ret != Variant()) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
if (selection.drag_attempt && selection.enabled) {
|
if (selection.drag_attempt && selection.enabled) {
|
||||||
String t = text.substr(selection.begin, selection.end - selection.begin);
|
String t = text.substr(selection.begin, selection.end - selection.begin);
|
||||||
Label *l = memnew(Label);
|
Label *l = memnew(Label);
|
||||||
|
|
|
||||||
|
|
@ -4741,6 +4741,11 @@ void RichTextLabel::set_deselect_on_focus_loss_enabled(const bool p_enabled) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Variant RichTextLabel::get_drag_data(const Point2 &p_point) {
|
Variant RichTextLabel::get_drag_data(const Point2 &p_point) {
|
||||||
|
Variant ret = Control::get_drag_data(p_point);
|
||||||
|
if (ret != Variant()) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
if (selection.drag_attempt && selection.enabled) {
|
if (selection.drag_attempt && selection.enabled) {
|
||||||
String t = get_selected_text();
|
String t = get_selected_text();
|
||||||
Label *l = memnew(Label);
|
Label *l = memnew(Label);
|
||||||
|
|
|
||||||
|
|
@ -3035,6 +3035,11 @@ bool TextEdit::is_text_field() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
Variant TextEdit::get_drag_data(const Point2 &p_point) {
|
Variant TextEdit::get_drag_data(const Point2 &p_point) {
|
||||||
|
Variant ret = Control::get_drag_data(p_point);
|
||||||
|
if (ret != Variant()) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
if (has_selection() && selection_drag_attempt) {
|
if (has_selection() && selection_drag_attempt) {
|
||||||
String t = get_selected_text();
|
String t = get_selected_text();
|
||||||
Label *l = memnew(Label);
|
Label *l = memnew(Label);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue