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

Change StringName & inspector hint to be harder to confuse with actual text #84219

Open
stephane-archer opened this issue Oct 30, 2023 · 15 comments · May be fixed by #84949
Open

Change StringName & inspector hint to be harder to confuse with actual text #84219

stephane-archer opened this issue Oct 30, 2023 · 15 comments · May be fixed by #84949

Comments

@stephane-archer
Copy link

Godot version

v4.1.2.stable.official [399c9dc]

System information

MacOS 13.4.1 (c) (22F770820d)

Issue description

while I was doing the official 2D tutorial I wasn't able to set a shortcut
here is the doc:
https://docs.godotengine.org/en/stable/getting_started/first_2d_game/07.finishing-up.html#keyboard-shortcut
Here is what I see, I can't interact or edit the & sign:
Screenshot 2023-10-30 at 18 59 31

Steps to reproduce

make the official tutorial

Minimal reproduction project

bugreport.zip

@mrcdk
Copy link
Contributor

mrcdk commented Oct 31, 2023

Is the text input next to the & disabled? You should be able to type the Input action name in it.

@AThousandShips
Copy link
Member

AThousandShips commented Oct 31, 2023

The & sign is not the input, it's a marker that it's a StringName the edit area is the lighter gray to the right

The documentation screenshot should be updated

@Calinou
Copy link
Member

Calinou commented Oct 31, 2023

We should change the StringName inspector to make the & more faint, or use a symbolic & icon as opposed to a literal & character (it will look more stylized and will be harder to confuse with text).

Alternatively, we can get rid of this hint entirely as it's not really relevant from an user perspective (when you don't manage the script, that is).

@Calinou Calinou changed the title Impossible to setup shortcut on button on mac Change StringName & inspector hint to be harder to confuse with actual text Oct 31, 2023
@dalexeev
Copy link
Member

dalexeev commented Nov 2, 2023

I find it important to distinguish between similar data types (int vs float, String vs StringName, arrays, null vs Object#null vs FreedInstance, etc.), both in print() output and in the editor.

See also:

We should change the StringName inspector to make the & more faint, or use a symbolic & icon as opposed to a literal & character (it will look more stylized and will be harder to confuse with text).

We could use the type icon:

Previously, type icons were displayed in the inspector for all properties, see #11505:

@zf-moth
Copy link

zf-moth commented Nov 2, 2023

I find it important to distinguish between similar data types

While it's important to distinguish between data types, I believe that a tool tip is a sufficient means to achieve this goal, eliminating unnecessary interface clutter and visual embellishments. Users can easily hover their mouse over an input box if they are unsure of the data type, providing a cleaner and efficient approach.

Another point is that these icons may pose readability challenges for beginners, whom these indicators aim to assist.

@AThousandShips
Copy link
Member

This was done in:

And because of multiple reasons and shouldn't be reverted

@zf-moth
Copy link

zf-moth commented Nov 2, 2023

The need to introduce a tool tip for a label that is intended to signify its purpose as a StringName label further affirms my point for removal of such label and instead moving the tooltip to input box.

@AThousandShips
Copy link
Member

The tooltip isnt accessible, tooltips aren't available on all input modes and platforms, and without it you can't tell the difference

@Calinou
Copy link
Member

Calinou commented Nov 2, 2023

If you don't want to use the StringName type icon (which may look a bit cryptic and out of place), change the hint to use a bold font but decrease its opacity to compensate.

@dalexeev
Copy link
Member

dalexeev commented Nov 2, 2023

While it's important to distinguish between data types, I believe that a tool tip is a sufficient means to achieve this goal, eliminating unnecessary interface clutter and visual embellishments. Users can easily hover their mouse over an input box if they are unsure of the data type

I'm not sure if we should add type icons for each property like in 2.x (?), it can really look noisy. But I think it's important to distinguish similar types without hovering over a property. For int vs float this can be achieved using trailing decimal, for arrays this is done in the inspector (but not in print() output):

For String vs StringName vs NodePath vs Node it might look like this:

@AshutoshAkkole
Copy link

I want to work on this issue,
So we can go with bold "&" with decreased opacity, or maybe icon?

@AThousandShips
Copy link
Member

That is the suggestion yes!

@zhelding zhelding linked a pull request Nov 15, 2023 that will close this issue
@zhelding
Copy link

zhelding commented Nov 15, 2023

Started working on a pull request for this (#84949).

So far, I have identified the relevant bit of code for modifying the appearance of the label and am able to set it to an arbitrary color.

However, I have so far been unsuccessful in retrieving the theme-appropriate color to apply to the label. I've tried using get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor)) - but for some reason that seems to just return the color black.

Any advice would be appreciated!

@KoBeWi
Copy link
Member

KoBeWi commented Nov 16, 2023

You are probably calling this method too early. Try doing it inside NOTIFICATION_POSTINITIALIZE or NOTIFICATION_THEME_CHANGED.

@zhelding
Copy link

Thanks so much for the tip; I believe #84949 now resolves this!

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