From bed29872d2a7befff9d4cb7313cb40060326a95e Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 9 Nov 2020 20:45:27 +0800 Subject: ... --- include/cru/ui/host/WindowHost.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/cru/ui/host') diff --git a/include/cru/ui/host/WindowHost.hpp b/include/cru/ui/host/WindowHost.hpp index 9fc24eb2..bd2f7c16 100644 --- a/include/cru/ui/host/WindowHost.hpp +++ b/include/cru/ui/host/WindowHost.hpp @@ -8,6 +8,7 @@ #include #include +#include namespace cru::ui::host { class LayoutPaintCycler; @@ -109,6 +110,14 @@ class WindowHost : public Object { return &native_window_change_event_; } + // If window exist, return window actual size. Otherwise if saved rect exists, + // return it. Otherwise return 0. + Rect GetWindowRect(); + + void SetSavedWindowRect(std::optional rect); + + void SetWindowRect(const Rect& rect); + private: //*************** region: native messages *************** void OnNativeDestroy(platform::gui::INativeWindow* window, std::nullptr_t); @@ -161,5 +170,7 @@ class WindowHost : public Object { bool layout_prefer_to_fill_window_ = true; Event native_window_change_event_; + + std::optional saved_rect_; }; } // namespace cru::ui::host -- cgit v1.2.3