Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent some internal nodes being duplicated in Controls #88114

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions scene/gui/color_picker.cpp
Original file line number Diff line number Diff line change
@@ -1741,6 +1741,7 @@ void ColorPicker::_pick_button_pressed() {
picker_preview_color->add_theme_style_override(SceneStringName(panel), picker_preview_style_box_color);

add_child(picker_window, false, INTERNAL_MODE_FRONT);
picker_window->force_parent_owned();
}
set_process_internal(true);

@@ -1889,6 +1890,7 @@ void ColorPicker::_pick_button_pressed_legacy() {
picker_window->hide();
picker_window->set_transient(true);
add_child(picker_window, false, INTERNAL_MODE_FRONT);
picker_window->force_parent_owned();

picker_texture_rect = memnew(TextureRect);
picker_texture_rect->set_anchors_preset(Control::PRESET_FULL_RECT);
@@ -2562,6 +2564,7 @@ void ColorPickerButton::_update_picker() {
picker->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
popup->add_child(picker);
add_child(popup, false, INTERNAL_MODE_FRONT);
popup->force_parent_owned();
picker->connect("color_changed", callable_mp(this, &ColorPickerButton::_color_changed));
popup->connect("about_to_popup", callable_mp(this, &ColorPickerButton::_about_to_popup));
popup->connect("popup_hide", callable_mp(this, &ColorPickerButton::_modal_closed));
1 change: 1 addition & 0 deletions scene/gui/line_edit.cpp
Original file line number Diff line number Diff line change
@@ -2701,6 +2701,7 @@ Key LineEdit::_get_menu_action_accelerator(const String &p_action) {
void LineEdit::_generate_context_menu() {
menu = memnew(PopupMenu);
add_child(menu, false, INTERNAL_MODE_FRONT);
menu->force_parent_owned();

menu_dir = memnew(PopupMenu);
menu_dir->add_radio_check_item(ETR("Same as Layout Direction"), MENU_DIR_INHERITED);
1 change: 1 addition & 0 deletions scene/gui/rich_text_label.cpp
Original file line number Diff line number Diff line change
@@ -6834,6 +6834,7 @@ Size2 RichTextLabel::get_minimum_size() const {
void RichTextLabel::_generate_context_menu() {
menu = memnew(PopupMenu);
add_child(menu, false, INTERNAL_MODE_FRONT);
menu->force_parent_owned();
menu->connect(SceneStringName(id_pressed), callable_mp(this, &RichTextLabel::menu_option));

menu->add_item(ETR("Copy"), MENU_COPY);
1 change: 1 addition & 0 deletions scene/gui/tab_container.cpp
Original file line number Diff line number Diff line change
@@ -761,6 +761,7 @@ void TabContainer::set_all_tabs_in_front(bool p_in_front) {

remove_child(tab_bar);
add_child(tab_bar, false, all_tabs_in_front ? INTERNAL_MODE_FRONT : INTERNAL_MODE_BACK);
tab_bar->force_parent_owned();
}

bool TabContainer::is_all_tabs_in_front() const {
1 change: 1 addition & 0 deletions scene/gui/text_edit.cpp
Original file line number Diff line number Diff line change
@@ -7364,6 +7364,7 @@ Key TextEdit::_get_menu_action_accelerator(const String &p_action) {
void TextEdit::_generate_context_menu() {
menu = memnew(PopupMenu);
add_child(menu, false, INTERNAL_MODE_FRONT);
menu->force_parent_owned();

menu_dir = memnew(PopupMenu);
menu_dir->add_radio_check_item(ETR("Same as Layout Direction"), MENU_DIR_INHERITED);