From a60910cb3db6f47fd8f3b7f31648a9d0514d4f2c Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 20 Nov 2021 22:43:30 +0800 Subject: ... --- include/cru/ui/host/WindowHost.hpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'include/cru/ui/host') diff --git a/include/cru/ui/host/WindowHost.hpp b/include/cru/ui/host/WindowHost.hpp index f3caeeef..6fb853b6 100644 --- a/include/cru/ui/host/WindowHost.hpp +++ b/include/cru/ui/host/WindowHost.hpp @@ -30,7 +30,7 @@ class WindowHost : public Object { CRU_DEFINE_CLASS_LOG_TAG(u"cru::ui::host::WindowHost") public: - WindowHost(controls::Control* root_control); + WindowHost(controls::Control* root_control, CreateWindowParams params); CRU_DELETE_COPY(WindowHost) CRU_DELETE_MOVE(WindowHost) @@ -40,10 +40,6 @@ class WindowHost : public Object { public: platform::gui::INativeWindow* GetNativeWindow() { return native_window_; } - // Do nothing if native window is already created. - gsl::not_null CreateNativeWindow( - CreateWindowParams create_window_params = {}); - // Mark the layout as invalid, and arrange a re-layout later. // This method could be called more than one times in a message cycle. But // layout only takes place once. @@ -112,18 +108,13 @@ 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); - std::shared_ptr GetOverrideCursor(); void SetOverrideCursor(std::shared_ptr cursor); private: + gsl::not_null CreateNativeWindow( + CreateWindowParams params); + //*************** region: native messages *************** void OnNativeDestroy(platform::gui::INativeWindow* window, std::nullptr_t); void OnNativePaint(platform::gui::INativeWindow* window, std::nullptr_t); @@ -178,8 +169,6 @@ class WindowHost : public Object { Event native_window_change_event_; - std::optional saved_rect_; - std::shared_ptr override_cursor_; }; } // namespace cru::ui::host -- cgit v1.2.3