Merge pull request #112615 from YeldhamDev/inspector_props_size_fix

Fix issues with property height in the inspector
This commit is contained in:
Rémi Verschelde
2025-12-04 15:52:40 +01:00
14 changed files with 171 additions and 93 deletions

View File

@@ -219,10 +219,7 @@ Size2 EditorProperty::get_minimum_size() const {
return Vector2();
}
Size2 ms;
int separation = 4 * EDSCALE;
ms.height = label.is_empty() ? 0 : theme_cache.font->get_height(theme_cache.font_size) + separation;
Size2 ms = Size2(0, theme_cache.inspector_property_height);
for (int i = 0; i < get_child_count(); i++) {
Control *c = as_sortable_control(get_child(i));
if (!c) {
@@ -316,7 +313,7 @@ void EditorProperty::_notification(int p_what) {
{
int child_room = size.width * (1.0 - split_ratio);
int separation = 4 * EDSCALE;
int height = label.is_empty() ? 0 : theme_cache.font->get_height(theme_cache.font_size) + separation;
int height = theme_cache.inspector_property_height;
int half_padding = theme_cache.padding / 2;
bool no_children = true;
@@ -1982,8 +1979,6 @@ void EditorInspectorSection::_notification(int p_what) {
bg_color = theme_cache.prop_subsection;
bg_color.a /= level;
vbox->add_theme_constant_override("separation", theme_cache.vertical_separation);
} break;
case NOTIFICATION_SORT_CHILDREN: {
@@ -2546,6 +2541,7 @@ EditorInspectorSection::EditorInspectorSection() {
set_focus_mode(FOCUS_ACCESSIBILITY);
vbox = memnew(VBoxContainer);
vbox->set_theme_type_variation(SNAME("EditorPropertyContainer"));
dropping_unfold_timer = memnew(Timer);
dropping_unfold_timer->set_wait_time(EDITOR_GET("interface/editor/dragging_hover_wait_seconds"));
@@ -3557,7 +3553,7 @@ void EditorInspector::initialize_section_theme(EditorInspectorSection::ThemeCach
}
p_cache.horizontal_separation = p_control->get_theme_constant(SNAME("h_separation"), SNAME("EditorInspectorSection"));
p_cache.vertical_separation = p_control->get_theme_constant(SNAME("v_separation"), SNAME("EditorInspector"));
p_cache.vertical_separation = p_control->get_theme_constant(SNAME("separation"), SNAME("EditorPropertyContainer"));
p_cache.inspector_margin = p_control->get_theme_constant(SNAME("inspector_margin"), EditorStringName(Editor));
p_cache.indent_size = p_control->get_theme_constant(SNAME("indent_size"), SNAME("EditorInspectorSection"));
p_cache.key_padding_size = int(EDITOR_GET("interface/theme/base_spacing")) * 2;
@@ -3596,7 +3592,7 @@ void EditorInspector::initialize_category_theme(EditorInspectorCategory::ThemeCa
}
p_cache.horizontal_separation = p_control->get_theme_constant(SNAME("h_separation"), SNAME("Tree"));
p_cache.vertical_separation = p_control->get_theme_constant(SNAME("v_separation"), SNAME("EditorInspector"));
p_cache.vertical_separation = p_control->get_theme_constant(SNAME("separation"), SNAME("EditorPropertyContainer"));
p_cache.class_icon_size = p_control->get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor));
p_cache.font_color = p_control->get_theme_color(SceneStringName(font_color), SNAME("Tree"));
@@ -3644,8 +3640,9 @@ void EditorInspector::initialize_property_theme(EditorProperty::ThemeCache &p_ca
p_cache.font_size = p_control->get_theme_font_size(SceneStringName(font_size), SNAME("Tree"));
p_cache.font_offset = p_control->get_theme_constant(SNAME("font_offset"), SNAME("EditorProperty"));
p_cache.horizontal_separation = p_control->get_theme_constant(SNAME("h_separation"), SNAME("Tree"));
p_cache.vertical_separation = p_control->get_theme_constant(SNAME("v_separation"), SNAME("EditorProperty"));
p_cache.vertical_separation = p_control->get_theme_constant(SNAME("separation"), SNAME("EditorPropertyContainer"));
p_cache.padding = int(EDITOR_GET("interface/theme/base_spacing")) * 2;
p_cache.inspector_property_height = p_control->get_theme_constant(SNAME("inspector_property_height"), EditorStringName(Editor));
p_cache.property_color = p_control->get_theme_color(SNAME("property_color"), SNAME("EditorProperty"));
p_cache.readonly_property_color = p_control->get_theme_color(SNAME("readonly_color"), SNAME("EditorProperty"));
@@ -3807,7 +3804,7 @@ bool EditorInspector::_is_property_disabled_by_feature_profile(const StringName
}
void EditorInspector::_add_section_in_tree(EditorInspectorSection *p_section, VBoxContainer *p_current_vbox) {
// Place adjacent sections in their own vbox with 0 separation
// Place adjacent sections in their own vbox with a theme-specific separation.
VBoxContainer *container = nullptr;
if (p_current_vbox->get_child_count() > 0) {
Node *last_child = p_current_vbox->get_child(-1);
@@ -3815,7 +3812,7 @@ void EditorInspector::_add_section_in_tree(EditorInspectorSection *p_section, VB
}
if (!container) {
container = memnew(VBoxContainer);
container->add_theme_constant_override("separation", theme_cache.vertical_separation);
container->set_theme_type_variation(SNAME("EditorInspectorContainer"));
p_current_vbox->add_child(container);
}
container->add_child(p_section);
@@ -3919,13 +3916,15 @@ void EditorInspector::update_tree() {
bool sub_inspectors_enabled = EDITOR_GET("interface/inspector/open_resources_in_current_inspector");
if (!valid_plugins.is_empty()) {
begin_vbox->show();
// Get the lists of editors to add the beginning.
for (Ref<EditorInspectorPlugin> &ped : valid_plugins) {
ped->parse_begin(object);
_parse_added_editors(begin_vbox, nullptr, ped);
}
// Show if any of the editors were added to the beginning.
if (begin_vbox->get_child_count() > 0) {
begin_vbox->show();
}
}
StringName doc_name;
@@ -4217,7 +4216,7 @@ void EditorInspector::update_tree() {
// Recreate the category vbox if it was reset.
if (category_vbox == nullptr) {
category_vbox = memnew(VBoxContainer);
category_vbox->add_theme_constant_override("separation", theme_cache.vertical_separation);
category_vbox->set_theme_type_variation(SNAME("EditorPropertyContainer"));
category_vbox->hide();
main_vbox->add_child(category_vbox);
}
@@ -4684,6 +4683,8 @@ void EditorInspector::update_tree() {
String tooltip;
VBoxContainer *parent_vbox = favorites_vbox;
if (!section_name.is_empty()) {
favorites_groups_vbox->show();
if (is_localized) {
label = EditorPropertyNameProcessor::get_singleton()->translate_group_name(section_name);
tooltip = section_name;
@@ -4785,6 +4786,10 @@ void EditorInspector::update_tree() {
}
}
}
if (favorites_vbox->get_child_count() > 0) {
favorites_vbox->show();
}
}
// Show a separator if there's no category to clearly divide the properties.
@@ -4863,9 +4868,11 @@ void EditorInspector::_clear(bool p_hide_plugins) {
}
favorites_section->hide();
favorites_vbox->hide();
while (favorites_vbox->get_child_count()) {
memdelete(favorites_vbox->get_child(0));
}
favorites_groups_vbox->hide();
while (favorites_groups_vbox->get_child_count()) {
memdelete(favorites_groups_vbox->get_child(0));
}
@@ -5648,19 +5655,11 @@ void EditorInspector::_notification(int p_what) {
break;
}
theme_cache.vertical_separation = get_theme_constant(SNAME("v_separation"), SNAME("EditorInspector"));
theme_cache.prop_subsection = get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor));
theme_cache.icon_add = get_editor_theme_icon(SNAME("Add"));
initialize_section_theme(section_theme_cache, this);
initialize_category_theme(category_theme_cache, this);
initialize_property_theme(property_theme_cache, this);
base_vbox->add_theme_constant_override("separation", theme_cache.vertical_separation);
begin_vbox->add_theme_constant_override("separation", theme_cache.vertical_separation);
favorites_section->add_theme_constant_override("separation", theme_cache.vertical_separation);
favorites_groups_vbox->add_theme_constant_override("separation", theme_cache.vertical_separation);
main_vbox->add_theme_constant_override("separation", theme_cache.vertical_separation);
} break;
case NOTIFICATION_READY: {
@@ -5893,14 +5892,17 @@ EditorInspector::EditorInspector() {
object = nullptr;
base_vbox = memnew(VBoxContainer);
base_vbox->set_theme_type_variation(SNAME("EditorInspectorContainer"));
base_vbox->set_h_size_flags(SIZE_EXPAND_FILL);
add_child(base_vbox);
begin_vbox = memnew(VBoxContainer);
begin_vbox->set_theme_type_variation(SNAME("EditorInspectorContainer"));
base_vbox->add_child(begin_vbox);
begin_vbox->hide();
favorites_section = memnew(VBoxContainer);
favorites_section->set_theme_type_variation(SNAME("EditorInspectorContainer"));
base_vbox->add_child(favorites_section);
favorites_section->hide();
@@ -5910,15 +5912,20 @@ EditorInspector::EditorInspector() {
favorites_section->add_child(favorites_category);
favorites_vbox = memnew(VBoxContainer);
favorites_vbox->set_theme_type_variation(SNAME("EditorPropertyContainer"));
favorites_section->add_child(favorites_vbox);
favorites_vbox->hide();
favorites_groups_vbox = memnew(VBoxContainer);
favorites_groups_vbox->set_theme_type_variation(SNAME("EditorInspectorContainer"));
favorites_section->add_child(favorites_groups_vbox);
favorites_groups_vbox->hide();
favorites_separator = memnew(HSeparator);
favorites_section->add_child(favorites_separator);
favorites_separator->hide();
main_vbox = memnew(VBoxContainer);
main_vbox->set_theme_type_variation(SNAME("EditorInspectorContainer"));
base_vbox->add_child(main_vbox);
set_horizontal_scroll_mode(SCROLL_MODE_DISABLED);

View File

@@ -102,6 +102,7 @@ class EditorProperty : public Container {
int horizontal_separation = 0;
int vertical_separation = 0;
int padding = 0;
int inspector_property_height = 0;
Color property_color;
Color readonly_property_color;
@@ -701,9 +702,7 @@ class EditorInspector : public ScrollContainer {
static int inspector_plugin_count;
struct ThemeCache {
int vertical_separation = 0;
Color prop_subsection;
Ref<Texture2D> icon_add;
} theme_cache;
EditorInspectorSection::ThemeCache section_theme_cache;

View File

@@ -151,6 +151,7 @@ EditorPropertyVariant::EditorPropertyVariant() {
edit_button = memnew(Button);
edit_button->set_flat(true);
edit_button->set_theme_type_variation(SNAME("EditorInspectorButton"));
edit_button->set_accessibility_name(TTRC("Edit"));
edit_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyVariant::_popup_edit_menu));
content->add_child(edit_button);
@@ -409,6 +410,7 @@ EditorPropertyMultilineText::EditorPropertyMultilineText(bool p_expression) :
open_big_text = memnew(Button);
open_big_text->set_accessibility_name(TTRC("Open Text Edit Dialog"));
open_big_text->set_flat(true);
open_big_text->set_theme_type_variation(SNAME("EditorInspectorButton"));
open_big_text->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyMultilineText::_open_big_text));
hb->add_child(open_big_text);
big_text_dialog = nullptr;
@@ -558,6 +560,7 @@ EditorPropertyTextEnum::EditorPropertyTextEnum() {
option_button->set_h_size_flags(SIZE_EXPAND_FILL);
option_button->set_clip_text(true);
option_button->set_flat(true);
option_button->set_theme_type_variation(SNAME("EditorInspectorButton"));
option_button->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
default_layout->add_child(option_button);
option_button->connect(SceneStringName(item_selected), callable_mp(this, &EditorPropertyTextEnum::_option_selected));
@@ -565,6 +568,7 @@ EditorPropertyTextEnum::EditorPropertyTextEnum() {
edit_button = memnew(Button);
edit_button->set_accessibility_name(TTRC("Edit"));
edit_button->set_flat(true);
edit_button->set_theme_type_variation(SNAME("EditorInspectorButton"));
edit_button->hide();
default_layout->add_child(edit_button);
edit_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyTextEnum::_edit_custom_value));
@@ -578,12 +582,14 @@ EditorPropertyTextEnum::EditorPropertyTextEnum() {
accept_button = memnew(Button);
accept_button->set_accessibility_name(TTRC("Accept Custom Value Edit"));
accept_button->set_flat(true);
accept_button->set_theme_type_variation(SNAME("EditorInspectorButton"));
edit_custom_layout->add_child(accept_button);
accept_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyTextEnum::_custom_value_accepted));
cancel_button = memnew(Button);
cancel_button->set_accessibility_name(TTRC("Cancel Custom Value Edit"));
cancel_button->set_flat(true);
cancel_button->set_theme_type_variation(SNAME("EditorInspectorButton"));
edit_custom_layout->add_child(cancel_button);
cancel_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyTextEnum::_custom_value_canceled));
@@ -647,6 +653,7 @@ EditorPropertyLocale::EditorPropertyLocale() {
locale_edit = memnew(Button);
locale_edit->set_accessibility_name(TTRC("Edit"));
locale_edit->set_clip_text(true);
locale_edit->set_theme_type_variation(SNAME("EditorInspectorButton"));
locale_hb->add_child(locale_edit);
add_focusable(locale);
dialog = nullptr;
@@ -818,11 +825,13 @@ EditorPropertyPath::EditorPropertyPath() {
toggle_uid->set_accessibility_name(TTRC("Toggle Display UID"));
toggle_uid->set_tooltip_text(TTRC("Toggles displaying between path and UID.\nThe UID is the actual value of this property."));
toggle_uid->set_pressed(false);
toggle_uid->set_theme_type_variation(SNAME("EditorInspectorButton"));
path_hb->add_child(toggle_uid);
add_focusable(toggle_uid);
toggle_uid->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyPath::_toggle_uid_display));
path_edit = memnew(Button);
path_edit->set_theme_type_variation(SNAME("EditorInspectorButton"));
path_edit->set_accessibility_name(TTRC("Edit"));
path_hb->add_child(path_edit);
add_focusable(path);
@@ -861,6 +870,7 @@ void EditorPropertyClassName::_dialog_created() {
EditorPropertyClassName::EditorPropertyClassName() {
property = memnew(Button);
property->set_clip_text(true);
property->set_theme_type_variation(SNAME("EditorInspectorButton"));
add_child(property);
add_focusable(property);
property->set_text(selected_type);
@@ -955,6 +965,7 @@ EditorPropertyEnum::EditorPropertyEnum() {
options = memnew(OptionButton);
options->set_clip_text(true);
options->set_flat(true);
options->set_theme_type_variation(SNAME("EditorInspectorButton"));
options->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
add_child(options);
add_focusable(options);
@@ -1622,6 +1633,7 @@ void EditorPropertyObjectID::setup(const String &p_base_type) {
EditorPropertyObjectID::EditorPropertyObjectID() {
edit = memnew(Button);
edit->set_theme_type_variation(SNAME("EditorInspectorButton"));
edit->set_accessibility_name(TTRC("Edit"));
add_child(edit);
add_focusable(edit);
@@ -1648,6 +1660,7 @@ void EditorPropertySignal::update_property() {
EditorPropertySignal::EditorPropertySignal() {
edit = memnew(Button);
edit->set_theme_type_variation(SNAME("EditorInspectorButton"));
edit->set_accessibility_name(TTRC("Edit"));
add_child(edit);
add_focusable(edit);
@@ -1668,6 +1681,7 @@ void EditorPropertyCallable::update_property() {
EditorPropertyCallable::EditorPropertyCallable() {
edit = memnew(Button);
edit->set_theme_type_variation(SNAME("EditorInspectorButton"));
edit->set_accessibility_name(TTRC("Edit"));
add_child(edit);
add_focusable(edit);
@@ -2390,6 +2404,7 @@ EditorPropertyQuaternion::EditorPropertyQuaternion() {
warning = memnew(Button);
warning->set_text(TTR("Temporary Euler may be changed implicitly!"));
warning->set_clip_text(true);
warning->set_theme_type_variation(SNAME("EditorInspectorButton"));
warning->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyQuaternion::_warning_pressed));
warning_dialog = memnew(AcceptDialog);
add_child(warning_dialog);
@@ -2419,6 +2434,7 @@ EditorPropertyQuaternion::EditorPropertyQuaternion() {
edit_button->set_accessibility_name(TTRC("Edit"));
edit_button->set_flat(true);
edit_button->set_toggle_mode(true);
edit_button->set_theme_type_variation(SNAME("EditorInspectorButton"));
default_layout->add_child(edit_button);
edit_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyQuaternion::_edit_custom_value));
@@ -2897,14 +2913,6 @@ void EditorPropertyColor::_popup_closed() {
}
}
void EditorPropertyColor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_THEME_CHANGED: {
picker->set_custom_minimum_size(Size2(0, get_theme_constant(SNAME("color_picker_button_height"), EditorStringName(Editor))));
} break;
}
}
void EditorPropertyColor::update_property() {
picker->set_pick_color(get_edited_property_display_value());
const Color color = picker->get_pick_color();
@@ -2938,6 +2946,7 @@ EditorPropertyColor::EditorPropertyColor() {
picker = memnew(ColorPickerButton);
add_child(picker);
picker->set_flat(true);
picker->set_theme_type_variation(SNAME("EditorInspectorButton"));
picker->connect("color_changed", callable_mp(this, &EditorPropertyColor::_color_changed));
picker->connect("picker_created", callable_mp(this, &EditorPropertyColor::_picker_created), CONNECT_ONE_SHOT);
}
@@ -3246,6 +3255,7 @@ EditorPropertyNodePath::EditorPropertyNodePath() {
assign = memnew(Button);
assign->set_accessibility_name(TTRC("Assign Node"));
assign->set_flat(true);
assign->set_theme_type_variation(SNAME("EditorInspectorButton"));
assign->set_h_size_flags(SIZE_EXPAND_FILL);
assign->set_clip_text(true);
assign->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);

View File

@@ -669,7 +669,6 @@ class EditorPropertyColor : public EditorProperty {
protected:
virtual void _set_read_only(bool p_read_only) override;
void _notification(int p_what);
public:
virtual void update_property() override;

View File

@@ -316,7 +316,7 @@ void EditorPropertyArray::_create_new_property_slot() {
reorder_button->set_button_icon(get_editor_theme_icon(SNAME("TripleBar")));
reorder_button->set_default_cursor_shape(Control::CURSOR_MOVE);
reorder_button->set_disabled(is_read_only());
reorder_button->set_theme_type_variation(SceneStringName(FlatButton));
reorder_button->set_theme_type_variation(SNAME("EditorInspectorFlatButton"));
reorder_button->connect(SceneStringName(gui_input), callable_mp(this, &EditorPropertyArray::_reorder_button_gui_input));
reorder_button->connect(SNAME("button_up"), callable_mp(this, &EditorPropertyArray::_reorder_button_up));
reorder_button->connect(SNAME("button_down"), callable_mp(this, &EditorPropertyArray::_reorder_button_down).bind(idx));
@@ -332,14 +332,14 @@ void EditorPropertyArray::_create_new_property_slot() {
edit_btn->set_accessibility_name(TTRC("Edit"));
edit_btn->set_button_icon(get_editor_theme_icon(SNAME("Edit")));
edit_btn->set_disabled(is_read_only());
edit_btn->set_theme_type_variation(SceneStringName(FlatButton));
edit_btn->set_theme_type_variation(SNAME("EditorInspectorFlatButton"));
edit_btn->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyArray::_change_type).bind(edit_btn, idx));
} else {
remove_btn = memnew(Button);
remove_btn->set_accessibility_name(TTRC("Remove"));
remove_btn->set_button_icon(get_editor_theme_icon(SNAME("Remove")));
remove_btn->set_disabled(is_read_only());
remove_btn->set_theme_type_variation(SceneStringName(FlatButton));
remove_btn->set_theme_type_variation(SNAME("EditorInspectorFlatButton"));
remove_btn->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyArray::_remove_pressed).bind(idx));
}
property_vbox->add_child(hbox);
@@ -442,6 +442,7 @@ void EditorPropertyArray::update_property() {
set_bottom_editor(container);
VBoxContainer *vbox = memnew(VBoxContainer);
vbox->set_theme_type_variation(SNAME("EditorPropertyContainer"));
container->add_child(vbox);
HBoxContainer *hbox = memnew(HBoxContainer);
@@ -462,6 +463,7 @@ void EditorPropertyArray::update_property() {
hbox->add_child(size_slider);
property_vbox = memnew(VBoxContainer);
property_vbox->set_theme_type_variation(SNAME("EditorPropertyContainer"));
property_vbox->set_h_size_flags(SIZE_EXPAND_FILL);
vbox->add_child(property_vbox);
@@ -974,6 +976,7 @@ EditorPropertyArray::EditorPropertyArray() {
edit->set_accessibility_name(TTRC("Edit"));
edit->set_h_size_flags(SIZE_EXPAND_FILL);
edit->set_clip_text(true);
edit->set_theme_type_variation(SNAME("EditorInspectorButton"));
edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyArray::_edit_pressed));
edit->set_toggle_mode(true);
SET_DRAG_FORWARDING_CD(edit, EditorPropertyArray);
@@ -1089,14 +1092,14 @@ void EditorPropertyDictionary::_create_new_property_slot(int p_idx) {
edit_btn->set_accessibility_name(TTRC("Edit"));
edit_btn->set_button_icon(get_editor_theme_icon(SNAME("Edit")));
edit_btn->set_disabled(is_read_only());
edit_btn->set_theme_type_variation(SceneStringName(FlatButton));
edit_btn->set_theme_type_variation(SNAME("EditorInspectorFlatButton"));
edit_btn->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyDictionary::_change_type).bind(edit_btn, slots.size()));
} else if (p_idx >= 0) {
remove_btn = memnew(Button);
remove_btn->set_accessibility_name(TTRC("Remove"));
remove_btn->set_button_icon(get_editor_theme_icon(SNAME("Remove")));
remove_btn->set_disabled(is_read_only());
remove_btn->set_theme_type_variation(SceneStringName(FlatButton));
remove_btn->set_theme_type_variation(SNAME("EditorInspectorFlatButton"));
remove_btn->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyDictionary::_remove_pressed).bind(slots.size()));
}
@@ -1301,9 +1304,11 @@ void EditorPropertyDictionary::update_property() {
set_bottom_editor(container);
VBoxContainer *vbox = memnew(VBoxContainer);
vbox->set_theme_type_variation(SNAME("EditorPropertyContainer"));
container->add_child(vbox);
property_vbox = memnew(VBoxContainer);
property_vbox->set_theme_type_variation(SNAME("EditorPropertyContainer"));
property_vbox->set_h_size_flags(SIZE_EXPAND_FILL);
vbox->add_child(property_vbox);
@@ -1319,6 +1324,7 @@ void EditorPropertyDictionary::update_property() {
property_vbox->add_child(add_panel);
add_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("DictionaryAddItem")));
VBoxContainer *add_vbox = memnew(VBoxContainer);
add_vbox->set_theme_type_variation(SNAME("EditorPropertyContainer"));
add_panel->add_child(add_vbox);
_create_new_property_slot(EditorPropertyDictionaryObject::NEW_KEY_INDEX);
@@ -1539,6 +1545,7 @@ EditorPropertyDictionary::EditorPropertyDictionary() {
edit->set_accessibility_name(TTRC("Edit"));
edit->set_h_size_flags(SIZE_EXPAND_FILL);
edit->set_clip_text(true);
edit->set_theme_type_variation(SNAME("EditorInspectorButton"));
edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyDictionary::_edit_pressed));
edit->set_toggle_mode(true);
add_child(edit);
@@ -1636,9 +1643,11 @@ void EditorPropertyLocalizableString::update_property() {
set_bottom_editor(container);
VBoxContainer *vbox = memnew(VBoxContainer);
vbox->set_theme_type_variation(SNAME("EditorPropertyContainer"));
container->add_child(vbox);
property_vbox = memnew(VBoxContainer);
property_vbox->set_theme_type_variation(SNAME("EditorPropertyContainer"));
property_vbox->set_h_size_flags(SIZE_EXPAND_FILL);
vbox->add_child(property_vbox);
@@ -1750,6 +1759,7 @@ EditorPropertyLocalizableString::EditorPropertyLocalizableString() {
edit->set_accessibility_name(TTRC("Edit"));
edit->set_h_size_flags(SIZE_EXPAND_FILL);
edit->set_clip_text(true);
edit->set_theme_type_variation(SNAME("EditorInspectorButton"));
edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyLocalizableString::_edit_pressed));
edit->set_toggle_mode(true);
add_child(edit);

View File

@@ -1434,6 +1434,7 @@ EditorResourcePicker::EditorResourcePicker(bool p_hide_assign_button_controls) {
make_unique_button->set_tooltip_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
make_unique_button->set_button_mask(MouseButtonMask::LEFT | MouseButtonMask::RIGHT);
make_unique_button->set_action_mode(BaseButton::ACTION_MODE_BUTTON_PRESS);
make_unique_button->set_theme_type_variation(SNAME("EditorInspectorButton"));
add_child(make_unique_button);
make_unique_button->connect(SceneStringName(pressed), callable_mp(this, &EditorResourcePicker::_on_unique_button_pressed));
@@ -1443,6 +1444,7 @@ EditorResourcePicker::EditorResourcePicker(bool p_hide_assign_button_controls) {
assign_button->set_accessibility_name(TTRC("Assign Resource"));
assign_button->set_expand_icon(true);
assign_button->set_clip_text(true);
assign_button->set_theme_type_variation(SNAME("EditorInspectorButton"));
assign_button->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
SET_DRAG_FORWARDING_GCD(assign_button, EditorResourcePicker);
add_child(assign_button);
@@ -1462,13 +1464,13 @@ EditorResourcePicker::EditorResourcePicker(bool p_hide_assign_button_controls) {
}
quick_load_button = memnew(Button);
quick_load_button->set_theme_type_variation(SceneStringName(FlatButton));
quick_load_button->set_theme_type_variation(SNAME("EditorInspectorFlatButton"));
quick_load_button->set_tooltip_text(TTRC("Quick Load"));
add_child(quick_load_button);
quick_load_button->connect(SceneStringName(pressed), callable_mp(this, &EditorResourcePicker::_edit_menu_cbk).bind(OBJ_MENU_QUICKLOAD));
edit_button = memnew(Button);
edit_button->set_theme_type_variation(SceneStringName(FlatButton));
edit_button->set_theme_type_variation(SNAME("EditorInspectorFlatButton"));
edit_button->set_toggle_mode(true);
edit_button->set_action_mode(BaseButton::ACTION_MODE_BUTTON_PRESS);
edit_button->set_accessibility_name(TTRC("Edit"));