aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/host
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-11-09 20:45:27 +0800
committercrupest <crupest@outlook.com>2020-11-09 20:45:27 +0800
commitbed29872d2a7befff9d4cb7313cb40060326a95e (patch)
tree0439aa1d4a02a6bb5f92d48e5f585ad5d748059a /include/cru/ui/host
parent014aaf773fd95a7f0dd1a766023a21fb6b54a1a1 (diff)
downloadcru-bed29872d2a7befff9d4cb7313cb40060326a95e.tar.gz
cru-bed29872d2a7befff9d4cb7313cb40060326a95e.tar.bz2
cru-bed29872d2a7befff9d4cb7313cb40060326a95e.zip
...
Diffstat (limited to 'include/cru/ui/host')
-rw-r--r--include/cru/ui/host/WindowHost.hpp11
1 files changed, 11 insertions, 0 deletions
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 <functional>
#include <memory>
+#include <optional>
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> 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<platform::gui::INativeWindow*> native_window_change_event_;
+
+ std::optional<Rect> saved_rect_;
};
} // namespace cru::ui::host