You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 19:31:35 +00:00
Fix issues with property height in the inspector
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user