1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +00:00

Tweak property name style selector in the editor inspector

A preview is now displayed in the options' text:

- Raw (e.g. "z_index")
- Capitalized (e.g. "Z Index")
- Localized (e.g. "Z Index")
  - "Z Index" is localized in the user's language.
This commit is contained in:
Hugo Locurcio
2024-06-02 01:14:03 +02:00
parent b75f0485ba
commit 010d02a6ee
2 changed files with 5 additions and 4 deletions

View File

@@ -541,9 +541,10 @@ void InspectorDock::update(Object *p_object) {
p->add_shortcut(ED_SHORTCUT("property_editor/expand_revertable", TTR("Expand Non-Default")), EXPAND_REVERTABLE);
p->add_separator(TTR("Property Name Style"));
p->add_radio_check_item(TTR("Raw"), PROPERTY_NAME_STYLE_RAW);
p->add_radio_check_item(TTR("Capitalized"), PROPERTY_NAME_STYLE_CAPITALIZED);
p->add_radio_check_item(TTR("Localized"), PROPERTY_NAME_STYLE_LOCALIZED);
p->add_radio_check_item(vformat(TTR("Raw (e.g. \"%s\")"), "z_index"), PROPERTY_NAME_STYLE_RAW);
p->add_radio_check_item(vformat(TTR("Capitalized (e.g. \"%s\")"), "Z Index"), PROPERTY_NAME_STYLE_CAPITALIZED);
// TRANSLATORS: "Z Index" should match the existing translated CanvasItem property name in the current language you're working on.
p->add_radio_check_item(TTR("Localized (e.g. \"Z Index\")"), PROPERTY_NAME_STYLE_LOCALIZED);
if (!EditorPropertyNameProcessor::is_localization_available()) {
const int index = p->get_item_index(PROPERTY_NAME_STYLE_LOCALIZED);