Merge pull request #112604 from bruvzg/pop_center_rec

Update rect after `_pre_popup` in `popup_centered_*`.
This commit is contained in:
Thaddeus Crews 2025-11-25 09:52:38 -06:00
commit 5afc01c46d
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
10 changed files with 60 additions and 18 deletions

View file

@ -259,6 +259,7 @@ private:
static int root_layout_direction;
protected:
virtual void _popup_base(const Rect2i &p_screen_rect = Rect2i());
virtual void _pre_popup() {} // Called after "about_to_popup", but before window is shown.
virtual Rect2i _popup_adjust_rect() const { return Rect2i(); }
virtual void _post_popup() {}
@ -407,7 +408,7 @@ public:
Window *get_non_popup_window() const;
Viewport *get_parent_viewport() const;
virtual void popup(const Rect2i &p_screen_rect = Rect2i());
void popup(const Rect2i &p_screen_rect = Rect2i());
void popup_on_parent(const Rect2i &p_parent_rect);
void popup_centered(const Size2i &p_minsize = Size2i());
void popup_centered_ratio(float p_ratio = 0.8);