feat: modules moved and engine moved to submodule

This commit is contained in:
Jan van der Weide 2025-04-12 18:40:44 +02:00
parent dfb5e645cd
commit c33d2130cc
5136 changed files with 225275 additions and 64485 deletions

View file

@ -38,7 +38,7 @@
#include "scene/theme/theme_db.h"
void Popup::_input_from_window(const Ref<InputEvent> &p_event) {
if (get_flag(FLAG_POPUP) && p_event->is_action_pressed(SNAME("ui_cancel"), false, true)) {
if ((ac_popup || get_flag(FLAG_POPUP)) && p_event->is_action_pressed(SNAME("ui_cancel"), false, true)) {
hide_reason = HIDE_REASON_CANCELED; // ESC pressed, mark as canceled unconditionally.
_close_pressed();
}
@ -115,7 +115,7 @@ void Popup::_notification(int p_what) {
} break;
case NOTIFICATION_APPLICATION_FOCUS_OUT: {
if (!is_in_edited_scene_root() && get_flag(FLAG_POPUP)) {
if (!is_in_edited_scene_root() && (get_flag(FLAG_POPUP) || ac_popup)) {
if (hide_reason == HIDE_REASON_NONE) {
hide_reason = HIDE_REASON_UNFOCUSED;
}
@ -126,7 +126,7 @@ void Popup::_notification(int p_what) {
}
void Popup::_parent_focused() {
if (popped_up && get_flag(FLAG_POPUP)) {
if (popped_up && (get_flag(FLAG_POPUP) || ac_popup)) {
if (hide_reason == HIDE_REASON_NONE) {
hide_reason = HIDE_REASON_UNFOCUSED;
}
@ -167,6 +167,11 @@ Rect2i Popup::_popup_adjust_rect() const {
Rect2i current(get_position(), get_size());
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_SELF_FITTING_WINDOWS)) {
// We're fine as is, the Display Server will take care of that for us.
return current;
}
if (current.position.x + current.size.x > parent_rect.position.x + parent_rect.size.x) {
current.position.x = parent_rect.position.x + parent_rect.size.x - current.size.x;
}
@ -218,7 +223,10 @@ Popup::Popup() {
set_transient(true);
set_flag(FLAG_BORDERLESS, true);
set_flag(FLAG_RESIZE_DISABLED, true);
set_flag(FLAG_MINIMIZE_DISABLED, true);
set_flag(FLAG_MAXIMIZE_DISABLED, true);
set_flag(FLAG_POPUP, true);
set_flag(FLAG_POPUP_WM_HINT, true);
}
Popup::~Popup() {
@ -299,7 +307,7 @@ Rect2i PopupPanel::_popup_adjust_rect() const {
_update_child_rects();
if (is_layout_rtl()) {
current.position -= Vector2(ABS(panel->get_offset(SIDE_RIGHT)), panel->get_offset(SIDE_TOP)) * get_content_scale_factor();
current.position -= Vector2(Math::abs(panel->get_offset(SIDE_RIGHT)), panel->get_offset(SIDE_TOP)) * get_content_scale_factor();
} else {
current.position -= Vector2(panel->get_offset(SIDE_LEFT), panel->get_offset(SIDE_TOP)) * get_content_scale_factor();
}