Update rect after _pre_popup in popup_centered_*.

This commit is contained in:
Pāvels Nadtočajevs 2025-11-10 10:59:11 +02:00
parent 6fd949a6dc
commit adf18ff44d
No known key found for this signature in database
GPG key ID: 8413210218EF35D2
10 changed files with 60 additions and 18 deletions

View file

@ -261,6 +261,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() {}
@ -409,7 +410,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);