mirror of
https://github.com/godotengine/godot.git
synced 2025-01-22 10:32:54 -05:00
Merge pull request #101876 from scgm0/Fix-OptionButton--show_popup
Fix OptionButton::show_popup
This commit is contained in:
commit
c7c19eb162
1 changed files with 4 additions and 7 deletions
|
@ -468,12 +468,6 @@ void OptionButton::show_popup() {
|
|||
return;
|
||||
}
|
||||
|
||||
Rect2 rect = get_screen_rect();
|
||||
rect.position.y += rect.size.height;
|
||||
rect.size.height = 0;
|
||||
popup->set_position(rect.position);
|
||||
popup->set_size(rect.size);
|
||||
|
||||
// If not triggered by the mouse, start the popup with the checked item (or the first enabled one) focused.
|
||||
if (current != NONE_SELECTED && !popup->is_item_disabled(current)) {
|
||||
if (!_was_pressed_by_mouse()) {
|
||||
|
@ -495,7 +489,10 @@ void OptionButton::show_popup() {
|
|||
}
|
||||
}
|
||||
|
||||
popup->popup();
|
||||
Rect2 rect = get_screen_rect();
|
||||
rect.position.y += rect.size.height;
|
||||
rect.size.height = 0;
|
||||
popup->popup(rect);
|
||||
}
|
||||
|
||||
void OptionButton::_validate_property(PropertyInfo &p_property) const {
|
||||
|
|
Loading…
Reference in a new issue