Merge pull request #61483 from kleonc/popup-update-exclusive-when-shown
[3.x] Allow changing `exclusive` of already popped up `Popup`
This commit is contained in:
commit
b44928586b
3 changed files with 9 additions and 0 deletions
|
@ -2051,6 +2051,11 @@ void Control::show_modal(bool p_exclusive) {
|
|||
data.modal_frame = Engine::get_singleton()->get_frames_drawn();
|
||||
}
|
||||
|
||||
void Control::set_modal_exclusive(bool p_exclusive) {
|
||||
ERR_FAIL_NULL_MSG(data.MI, "Modal exclusive can be set only if the Control is already shown as modal.");
|
||||
data.modal_exclusive = p_exclusive;
|
||||
}
|
||||
|
||||
void Control::_modal_set_prev_focus_owner(ObjectID p_prev) {
|
||||
data.modal_prev_focus_owner = p_prev;
|
||||
}
|
||||
|
|
|
@ -250,6 +250,7 @@ protected:
|
|||
virtual void remove_child_notify(Node *p_child);
|
||||
|
||||
//virtual void _window_gui_input(InputEvent p_event);
|
||||
void set_modal_exclusive(bool p_exclusive);
|
||||
|
||||
bool _set(const StringName &p_name, const Variant &p_value);
|
||||
bool _get(const StringName &p_name, Variant &r_ret) const;
|
||||
|
|
|
@ -194,6 +194,9 @@ void Popup::_popup(const Rect2 &p_bounds, const bool p_centered) {
|
|||
|
||||
void Popup::set_exclusive(bool p_exclusive) {
|
||||
exclusive = p_exclusive;
|
||||
if (popped_up) {
|
||||
set_modal_exclusive(exclusive);
|
||||
}
|
||||
}
|
||||
|
||||
bool Popup::is_exclusive() const {
|
||||
|
|
Loading…
Reference in a new issue