-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an option to drag'n'drop selected text in TextEdit
#62221
Conversation
TextEdit
Please amend your commit message to follow the preferred format, "Verb + more descriptive statement about what changed". See the updated PR title for example. 🙃 |
007682d
to
b50d21b
Compare
scene/gui/text_edit.cpp
Outdated
void TextEdit::set_drag_and_drop_selection_enabled(const bool p_enabled) { | ||
drag_and_drop_selection_enabled = p_enabled; | ||
} | ||
|
||
bool TextEdit::is_drag_and_drop_selection_enabled() const { | ||
return drag_and_drop_selection_enabled; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.h
and .c
content should follow the same order, so this should be under delete_selection
below, same with the other changes. Including moving drag_and_drop_selection_enabled
under selection.
Nitpick:
Would move it under is_deselect_on_focus_loss_enabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
b50d21b
to
3a9d4a9
Compare
doc/classes/TextEdit.xml
Outdated
@@ -956,6 +956,9 @@ | |||
<member name="deselect_on_focus_loss_enabled" type="bool" setter="set_deselect_on_focus_loss_enabled" getter="is_deselect_on_focus_loss_enabled" default="true"> | |||
If [code]true[/code], the selected text will be deselected when focus is lost. | |||
</member> | |||
<member name="drag_and_drop_selection" type="bool" setter="set_drag_and_drop_selection_enabled" getter="is_drag_and_drop_selection_enabled" default="true"> | |||
If [code]true[/code] allow drag and drop of selected text. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If [code]true[/code] allow drag and drop of selected text. | |
If [code]true[/code], allow drag and drop of selected text. |
scene/gui/text_edit.cpp
Outdated
@@ -5405,6 +5416,7 @@ void TextEdit::_bind_methods() { | |||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shortcut_keys_enabled"), "set_shortcut_keys_enabled", "is_shortcut_keys_enabled"); | |||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "selecting_enabled"), "set_selecting_enabled", "is_selecting_enabled"); | |||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "deselect_on_focus_loss_enabled"), "set_deselect_on_focus_loss_enabled", "is_deselect_on_focus_loss_enabled"); | |||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "drag_and_drop_selection"), "set_drag_and_drop_selection_enabled", "is_drag_and_drop_selection_enabled"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "drag_and_drop_selection"), "set_drag_and_drop_selection_enabled", "is_drag_and_drop_selection_enabled"); | |
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "drag_and_drop_selection_enabled"), "set_drag_and_drop_selection_enabled", "is_drag_and_drop_selection_enabled"); |
To be consistent with other bool properties in the same class.
3a9d4a9
to
5d56efc
Compare
Thanks! |
Cherry-picked for 3.5. |
Should solve godotengine/godot-proposals#4629