瀏覽代碼

PopupMenu: Update margins on visibility change

Fixes #96149.

Co-authored-by: Haoyu Qiu <[email protected]>
Rémi Verschelde 11 月之前
父節點
當前提交
c84cf04e95
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      scene/gui/popup_menu.cpp

+ 2 - 0
scene/gui/popup_menu.cpp

@@ -646,6 +646,8 @@ void PopupMenu::_notification(int p_what) {
 		case NOTIFICATION_POST_POPUP: {
 		case NOTIFICATION_POST_POPUP: {
 			initial_button_mask = Input::get_singleton()->get_mouse_button_mask();
 			initial_button_mask = Input::get_singleton()->get_mouse_button_mask();
 			during_grabbed_click = (bool)initial_button_mask;
 			during_grabbed_click = (bool)initial_button_mask;
+		} break;
+		case NOTIFICATION_VISIBILITY_CHANGED: {
 			// Set margin on the margin container
 			// Set margin on the margin container
 			Ref<StyleBox> panel_style = get_stylebox("panel");
 			Ref<StyleBox> panel_style = get_stylebox("panel");
 			margin_container->add_constant_override("margin_top", panel_style->get_margin(Margin::MARGIN_TOP));
 			margin_container->add_constant_override("margin_top", panel_style->get_margin(Margin::MARGIN_TOP));