mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 14:12:51 +00:00
Merge pull request #76684 from KoBeWi/this_branch_is_meta
Add background panel to new meta dialog
This commit is contained in:
commit
f868b4781b
@ -3923,6 +3923,12 @@ void EditorInspector::_notification(int p_what) {
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
if (add_meta_error_panel) {
|
||||
add_meta_error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree")));
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_PREDELETE: {
|
||||
edit(nullptr); //just in case
|
||||
} break;
|
||||
@ -4103,13 +4109,16 @@ void EditorInspector::_show_add_meta_dialog() {
|
||||
|
||||
VBoxContainer *vbc = memnew(VBoxContainer);
|
||||
add_meta_dialog->add_child(vbc);
|
||||
|
||||
HBoxContainer *hbc = memnew(HBoxContainer);
|
||||
vbc->add_child(hbc);
|
||||
hbc->add_child(memnew(Label(TTR("Name:"))));
|
||||
|
||||
add_meta_name = memnew(LineEdit);
|
||||
add_meta_name->set_custom_minimum_size(Size2(200 * EDSCALE, 1));
|
||||
hbc->add_child(add_meta_name);
|
||||
hbc->add_child(memnew(Label(TTR("Type:"))));
|
||||
|
||||
add_meta_type = memnew(OptionButton);
|
||||
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
|
||||
if (i == Variant::NIL || i == Variant::RID || i == Variant::CALLABLE || i == Variant::SIGNAL) {
|
||||
@ -4120,12 +4129,24 @@ void EditorInspector::_show_add_meta_dialog() {
|
||||
add_meta_type->add_icon_item(get_theme_icon(type, "EditorIcons"), type, i);
|
||||
}
|
||||
hbc->add_child(add_meta_type);
|
||||
|
||||
Control *spacing = memnew(Control);
|
||||
vbc->add_child(spacing);
|
||||
spacing->set_custom_minimum_size(Size2(0, 10 * EDSCALE));
|
||||
|
||||
add_meta_dialog->set_ok_button_text(TTR("Add"));
|
||||
add_child(add_meta_dialog);
|
||||
add_meta_dialog->register_text_enter(add_meta_name);
|
||||
add_meta_dialog->connect("confirmed", callable_mp(this, &EditorInspector::_add_meta_confirm));
|
||||
|
||||
add_meta_error_panel = memnew(PanelContainer);
|
||||
vbc->add_child(add_meta_error_panel);
|
||||
if (is_inside_tree()) {
|
||||
add_meta_error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree")));
|
||||
}
|
||||
|
||||
add_meta_error = memnew(Label);
|
||||
vbc->add_child(add_meta_error);
|
||||
add_meta_error_panel->add_child(add_meta_error);
|
||||
|
||||
add_meta_name->connect("text_changed", callable_mp(this, &EditorInspector::_check_meta_name));
|
||||
}
|
||||
|
@ -540,6 +540,7 @@ class EditorInspector : public ScrollContainer {
|
||||
ConfirmationDialog *add_meta_dialog = nullptr;
|
||||
LineEdit *add_meta_name = nullptr;
|
||||
OptionButton *add_meta_type = nullptr;
|
||||
PanelContainer *add_meta_error_panel = nullptr;
|
||||
Label *add_meta_error = nullptr;
|
||||
|
||||
void _add_meta_confirm();
|
||||
|
Loading…
Reference in New Issue
Block a user