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

[macOS/Windows] Add Emoji & Symbols context menu item to LineEdit/TextEdit to show system character picker. #101021

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Jan 2, 2025

Implements godotengine/godot-proposals#11468 for macOS. Edit: And Windows.

Screen.Recording.2025-01-02.at.13.23.18.mov

@FourGames
Copy link

Would look better with just emoji and then showing the shortcut like the others

@bruvzg bruvzg requested a review from a team as a code owner January 2, 2025 13:59
@bruvzg
Copy link
Member Author

bruvzg commented Jan 2, 2025

Added Windows support as well.

@bruvzg bruvzg changed the title [macOS] Add Emoji & Symbols context menu item to LineEdit/TextEdit to show system character picker. [macOS/Windows] Add Emoji & Symbols context menu item to LineEdit/TextEdit to show system character picker. Jan 2, 2025
@Mickeon
Copy link
Contributor

Mickeon commented Jan 2, 2025

Keeping it at the top will screw up with the user's muscle memory so maybe it's worth evaluating to move it down.

@FourGames
Copy link

Keeping it at the top will screw up with the user's muscle memory so maybe it's worth evaluating to move it down.

It's best at the top that's what's used by browsers since it's most accessible and acts as a second keyboard.

@FourGames
Copy link

It’s worth considering renaming "Emoji & Symbols" to just "Emoji" because all the other options are shorter, making this one stand out negatively due to its length. Additionally, "Emoji" is a more commonly used term for this action in browsers.

@bruvzg
Copy link
Member Author

bruvzg commented Jan 2, 2025

It's best at the top that's what's used by browsers

Chromium based browsers have it on top, GTK have it on the bottom, macOS have it at the bottom of "Edit" menu. Not sure if there are any other examples for emoji picker in the context menu.

Additionally, "Emoji" is a more commonly used term for this action in browsers.

On macOS, Chromium also calls it Emoji & Symbols (native macOS "Edit" menu do the same), but it's Emoji on Windows (I guess Windows picker is more limited).

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally on Windows 11 23H2, it works as expected.

image

One issue I noticed is that the dialog appears when right-clicking text fields that only accept numeric values, such as SpinBox and EditorSpinSlider (as shown above). Perhaps these fields should have a property not to show the emoji option in the context menu?

@FourGames
Copy link

Chromium based browsers have it on top, GTK have it on the bottom, macOS have it at the bottom of "Edit" menu. Not sure if there are any other examples for emoji picker in the context menu.

On macOS, Chromium also calls it Emoji & Symbols (native macOS "Edit" menu do the same), but it's Emoji on Windows (I guess Windows picker is more limited).

One issue I noticed is that the dialog appears when right-clicking text fields that only accept numeric values, such as SpinBox and EditorSpinSlider (as shown above). Perhaps these fields should have a property not to show the emoji option in the context menu?

Since there isn't a standard for naming or placement, I suggest the following:

  • The longer name "Emoji & Symbols" works better at the bottom of the context menu visually, and might also reduce the need to address the numeric-only fields issue.
  • Adopting the shorter name "Emoji" fits better at the top, aligning with browser conventions and keeping it accessible, but this would require solving the numeric-only fields issue.

@FourGames
Copy link

Is it possible to make this usable in scripts as well?

@bruvzg
Copy link
Member Author

bruvzg commented Jan 3, 2025

Is it possible to make this usable in scripts as well?

Done. Also added a flag to disable it (and set it for spin boxes).

@akien-mga akien-mga removed this from the 4.x milestone Jan 10, 2025
@akien-mga akien-mga added this to the 4.4 milestone Jan 10, 2025
@akien-mga akien-mga merged commit 867425f into godotengine:master Jan 10, 2025
20 checks passed
@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.

5 participants