diff options
Diffstat (limited to 'extension/src')
-rw-r--r-- | extension/src/openvic-extension/utility/UITools.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/extension/src/openvic-extension/utility/UITools.cpp b/extension/src/openvic-extension/utility/UITools.cpp index 4bd537d..0eea6c4 100644 --- a/extension/src/openvic-extension/utility/UITools.cpp +++ b/extension/src/openvic-extension/utility/UITools.cpp @@ -1,4 +1,5 @@ #include "UITools.hpp" +#include <cmath> #include <godot_cpp/classes/color_rect.hpp> #include <godot_cpp/classes/line_edit.hpp> @@ -22,6 +23,9 @@ #include "openvic-extension/singletons/AssetManager.hpp" #include "openvic-extension/singletons/GameSingleton.hpp" #include "openvic-extension/utility/Utilities.hpp" +#include "godot_cpp/classes/control.hpp" +#include "godot_cpp/variant/vector2.hpp" +#include "openvic-simulation/types/Vector.hpp" using namespace godot; using namespace OpenVic; @@ -482,14 +486,18 @@ static bool generate_window(generate_gui_args_t&& args) { GUI::Window const& window = static_cast<GUI::Window const&>(args.element); - // TODO - moveable, fullscreen, dontRender (disable visibility?) + // TODO - moveable, dontRender (disable visibility?) const String window_name = Utilities::std_to_godot_string(window.get_name()); Panel* godot_panel = nullptr; bool ret = new_control(godot_panel, window, args.name); ERR_FAIL_NULL_V_MSG(godot_panel, false, vformat("Failed to create Panel for GUI window %s", window_name)); - godot_panel->set_custom_minimum_size(Utilities::to_godot_fvec2(window.get_size())); + if (window.get_fullscreen()) { + godot_panel->set_anchors_preset(godot::Control::PRESET_FULL_RECT); + } else { + godot_panel->set_custom_minimum_size(Utilities::to_godot_fvec2(window.get_size())); + } Ref<StyleBoxEmpty> stylebox_empty; stylebox_empty.instantiate(); |