-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
[3.x] Add property name style toggle to Inspector #59313
Conversation
What do you think about moving the options to this menu instead? The search bar and sub-resource dropdown button having different lengths looks a little odd.
Localization could probably be disabled for English since localized and capitalized are the same in that case, right? |
d01994a
to
0c67cbe
Compare
Added a blacklist of languages, currently "en" only. It now disables the menu item and adds a tooltip. It also selects Capitalized on startup if you set Localized in Editor Settings for these languages.
It's also unbalanced a few versions ago ;) I tried locally to move the switch into the properties menu. I think it looks a bit lack of context, maybe wording should be changed? I'll include this if you think it's OK. |
@timothyqiu yes, I think that's better.
You could add text to the separator right above it that says something like "Property Name Style". |
0c67cbe
to
8c5993e
Compare
8c5993e
to
edaeeb5
Compare
edaeeb5
to
f33b511
Compare
f33b511
to
8ecdb0b
Compare
if (!EditorPropertyNameProcessor::is_localization_available()) { | ||
const int index = p->get_item_index(PROPERTY_NAME_STYLE_LOCALIZED); | ||
p->set_item_disabled(index, true); | ||
p->set_item_tooltip(index, TTR("Localization not available for current language.")); | ||
} |
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.
That doesn't seem to work for me on Linux with the en
locale, the option is still 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.
This is based on interface/editor/editor_language
. I tried launching the editor using LANG=en_US
, the editor setting is "en", and the option is disabled. What's your interface/editor/editor_language
?
p.s. Also, it's only the Inspector drop down that will be disabled. The option in editor settings will not be disabled, since it's for default value, independent of editor language.
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.
Hm I just tested again and it's working fine now, weird.
|
||
p->add_separator(TTR("Property Name Style")); | ||
p->add_radio_check_item(TTR("Raw"), PROPERTY_NAME_STYLE_RAW); |
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.
I feel "Raw" might not be very explicit. Maybe "Raw Path" or just "Path"/"Property Path"?
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.
It's only part of a path, i.e. there is no slash in it, more like a snake cased identifier. I think it's confusing to call it Path style.
8ecdb0b
to
b1044b9
Compare
Thanks! |
This PR adds a button to the Inspector. It switches among three different property name styles:
http_proxy
HTTP Proxy
HTTP 代理
The Inspector defaults to the
interface/inspector/default_property_name_style
editor setting at startup. This setting defaults to "Capitalized" and it replaces the oldinterface/inspector/capitalize_properties
.Localization is currently disabled for "en":
The previous PR added a
interface/editor/translate_properties
setting for all properties. This is now replaced byinterface/editor/localize_settings
to focus on settings. It defaults totrue
because settings are usually accessed via GUI instead of code. You can still access the path via right click menu or tooltip.Editor settings take a few seconds to make effect:
The
EditorInspector
defaults to Capitalized. Common usages such as the import dock and the export dialog are set to honorlocalize_settings
too. The local stack variables inspector in Debugger is kept Raw.I'll make a PR for
master
after this is discussed.