mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
[Scene] Add SceneStringNames::pressed
This commit is contained in:
@@ -2203,7 +2203,7 @@ void EditorInspectorArray::_setup() {
|
||||
if (element_position > 0) {
|
||||
ae.move_up = memnew(Button);
|
||||
ae.move_up->set_icon(get_editor_theme_icon(SNAME("MoveUp")));
|
||||
ae.move_up->connect("pressed", callable_mp(this, &EditorInspectorArray::_move_element).bind(element_position, element_position - 1));
|
||||
ae.move_up->connect(SceneStringName(pressed), callable_mp(this, &EditorInspectorArray::_move_element).bind(element_position, element_position - 1));
|
||||
move_vbox->add_child(ae.move_up);
|
||||
}
|
||||
|
||||
@@ -2219,7 +2219,7 @@ void EditorInspectorArray::_setup() {
|
||||
if (element_position < _get_array_count() - 1) {
|
||||
ae.move_down = memnew(Button);
|
||||
ae.move_down->set_icon(get_editor_theme_icon(SNAME("MoveDown")));
|
||||
ae.move_down->connect("pressed", callable_mp(this, &EditorInspectorArray::_move_element).bind(element_position, element_position + 2));
|
||||
ae.move_down->connect(SceneStringName(pressed), callable_mp(this, &EditorInspectorArray::_move_element).bind(element_position, element_position + 2));
|
||||
move_vbox->add_child(ae.move_down);
|
||||
}
|
||||
}
|
||||
@@ -2243,7 +2243,7 @@ void EditorInspectorArray::_setup() {
|
||||
ae.erase = memnew(Button);
|
||||
ae.erase->set_icon(get_editor_theme_icon(SNAME("Remove")));
|
||||
ae.erase->set_v_size_flags(SIZE_SHRINK_CENTER);
|
||||
ae.erase->connect("pressed", callable_mp(this, &EditorInspectorArray::_remove_item).bind(element_position));
|
||||
ae.erase->connect(SceneStringName(pressed), callable_mp(this, &EditorInspectorArray::_remove_item).bind(element_position));
|
||||
ae.hbox->add_child(ae.erase);
|
||||
}
|
||||
|
||||
@@ -2433,7 +2433,7 @@ EditorInspectorArray::EditorInspectorArray(bool p_read_only) {
|
||||
vbox->add_child(elements_vbox);
|
||||
|
||||
add_button = EditorInspector::create_inspector_action_button(TTR("Add Element"));
|
||||
add_button->connect("pressed", callable_mp(this, &EditorInspectorArray::_add_button_pressed));
|
||||
add_button->connect(SceneStringName(pressed), callable_mp(this, &EditorInspectorArray::_add_button_pressed));
|
||||
add_button->set_disabled(read_only);
|
||||
vbox->add_child(add_button);
|
||||
|
||||
@@ -2528,12 +2528,12 @@ EditorPaginator::EditorPaginator() {
|
||||
|
||||
first_page_button = memnew(Button);
|
||||
first_page_button->set_flat(true);
|
||||
first_page_button->connect("pressed", callable_mp(this, &EditorPaginator::_first_page_button_pressed));
|
||||
first_page_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPaginator::_first_page_button_pressed));
|
||||
add_child(first_page_button);
|
||||
|
||||
prev_page_button = memnew(Button);
|
||||
prev_page_button->set_flat(true);
|
||||
prev_page_button->connect("pressed", callable_mp(this, &EditorPaginator::_prev_page_button_pressed));
|
||||
prev_page_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPaginator::_prev_page_button_pressed));
|
||||
add_child(prev_page_button);
|
||||
|
||||
page_line_edit = memnew(LineEdit);
|
||||
@@ -2546,12 +2546,12 @@ EditorPaginator::EditorPaginator() {
|
||||
|
||||
next_page_button = memnew(Button);
|
||||
next_page_button->set_flat(true);
|
||||
next_page_button->connect("pressed", callable_mp(this, &EditorPaginator::_next_page_button_pressed));
|
||||
next_page_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPaginator::_next_page_button_pressed));
|
||||
add_child(next_page_button);
|
||||
|
||||
last_page_button = memnew(Button);
|
||||
last_page_button->set_flat(true);
|
||||
last_page_button->connect("pressed", callable_mp(this, &EditorPaginator::_last_page_button_pressed));
|
||||
last_page_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPaginator::_last_page_button_pressed));
|
||||
add_child(last_page_button);
|
||||
}
|
||||
|
||||
@@ -3465,7 +3465,7 @@ void EditorInspector::update_tree() {
|
||||
|
||||
Button *add_md = EditorInspector::create_inspector_action_button(TTR("Add Metadata"));
|
||||
add_md->set_icon(get_editor_theme_icon(SNAME("Add")));
|
||||
add_md->connect(SNAME("pressed"), callable_mp(this, &EditorInspector::_show_add_meta_dialog));
|
||||
add_md->connect(SceneStringName(pressed), callable_mp(this, &EditorInspector::_show_add_meta_dialog));
|
||||
main_vbox->add_child(add_md);
|
||||
if (all_read_only) {
|
||||
add_md->set_disabled(true);
|
||||
|
||||
Reference in New Issue
Block a user