Skip to content
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

Merged
merged 1 commit into from
Jun 26, 2022

Conversation

ConteZero
Copy link
Contributor

@ConteZero ConteZero requested review from a team as code owners June 19, 2022 15:02
@YeldhamDev YeldhamDev added this to the 4.0 milestone Jun 19, 2022
@YuriSizov YuriSizov changed the title Drag and drop option Add an option to drag'n'drop selected text in TextEdit Jun 19, 2022
@YuriSizov
Copy link
Contributor

YuriSizov commented Jun 19, 2022

Please amend your commit message to follow the preferred format, "Verb + more descriptive statement about what changed". See the updated PR title for example. 🙃

editor/code_editor.cpp Show resolved Hide resolved
Comment on lines +4461 to +4468
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;
}

Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If [code]true[/code] allow drag and drop of selected text.
If [code]true[/code], allow drag and drop of selected text.

@@ -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");
Copy link
Member

@akien-mga akien-mga Jun 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

@akien-mga akien-mga merged commit af69424 into godotengine:master Jun 26, 2022
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jun 26, 2022
@ConteZero ConteZero deleted the drag_and_drop_option branch June 26, 2022 14:05
@akien-mga
Copy link
Member

Cherry-picked for 3.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants