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 Ability to Enable/Disable Shortcuts and Selection for LineEdit/TextEdit #31188

Merged

Conversation

codecustard
Copy link
Contributor

@codecustard codecustard commented Aug 8, 2019

This PR adds the ability to enable/disable shortcut keys and selection for LineEdit and TextEdit.

Closes: #31183

scene/gui/line_edit.cpp Outdated Show resolved Hide resolved
scene/gui/line_edit.cpp Outdated Show resolved Hide resolved
@akien-mga
Copy link
Member

Closes: #31183

This issue also requests the same feature in TextEdit.

@akien-mga
Copy link
Member

Needs a rebase to remove the merge commit and fix merge conflicts, otherwise I guess it should be ok to merge.

Copy link
Member

@Paulb23 Paulb23 left a comment

Choose a reason for hiding this comment

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

This doesn't seem to fix the linked issue? As it describes disabling selections not shortcuts.

In any case, you should only need to remove the shortcuts inside new method _generate_context_menu leaving the main switch alone.

@codecustard
Copy link
Contributor Author

This doesn't seem to fix the linked issue? As it describes disabling selections not shortcuts.

In any case, you should only need to remove the shortcuts inside new method _generate_context_menu leaving the main switch alone.

I've tried that before, but it does not seem to have any effect. The context menu will show or not show the shortcut keys... but the switch statement causes the shortcut keys to have effect regardless of whether the context menu has them or not.

@codecustard codecustard changed the title Add Ability to Enable/Disable Shortcuts for LineEdit Add Ability to Enable/Disable Shortcuts and Selection for LineEdit/TextEdit Sep 3, 2019
@Paulb23
Copy link
Member

Paulb23 commented Sep 3, 2019

I've tried that before, but it does not seem to have any effect

Ahh my bad, I remember now, currently they are visual only. Related #29490, which will require shortcuts to handle echoed events before they can be changed.

In that case, there are a couple missing:

  • select_all() on line 3459
  • cut() on line 3201

Copy link
Member

@Paulb23 Paulb23 left a comment

Choose a reason for hiding this comment

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

Couple notes left inline, It's also still possible to select with the mouse or shift + arrow keys within line_edit.

scene/gui/line_edit.cpp Show resolved Hide resolved
scene/gui/text_edit.cpp Show resolved Hide resolved
This PR adds the ability to enable/disable shortcut keys and selection for LineEdit/TextEdit. It also updates the context menu when you disable/enable the shortcut keys or selection.
@akien-mga akien-mga merged commit fae1415 into godotengine:master Sep 19, 2019
@akien-mga
Copy link
Member

Thanks!

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.

Text Selection Forced when using LineEdit/TextEdit
4 participants