From 92028ff39762a24f88723279452633d896d9970d Mon Sep 17 00:00:00 2001 From: "joogab.yun" Date: Tue, 16 Aug 2022 13:18:06 +0900 Subject: [PATCH] [NUI] Added API to know when border window starts moving and ends moving ```c# public virtual void OnRequestMove() {} public virtual void OnMoved(int x, int y) {} ``` --- src/Tizen.NUI/src/public/Window/BorderWindow.cs | 9 +++++++++ src/Tizen.NUI/src/public/Window/DefaultBorder.cs | 16 ++++++++++++++++ src/Tizen.NUI/src/public/Window/IBorderInterface.cs | 14 ++++++++------ 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/Tizen.NUI/src/public/Window/BorderWindow.cs b/src/Tizen.NUI/src/public/Window/BorderWindow.cs index 792725f..161de37 100755 --- a/src/Tizen.NUI/src/public/Window/BorderWindow.cs +++ b/src/Tizen.NUI/src/public/Window/BorderWindow.cs @@ -219,6 +219,8 @@ namespace Tizen.NUI Resized += OnBorderWindowResized; + Moved += OnBorderWindowMoved; + borderInterface.OnCreated(borderView); // Increase the window size as much as the border area. @@ -435,6 +437,13 @@ namespace Tizen.NUI } } + // Called when the window position has changed. + private void OnBorderWindowMoved(object sender, WindowMovedEventArgs e) + { + Tizen.Log.Info("NUI", $"OnBorderWindowMoved {e.WindowPosition.X}, {e.WindowPosition.Y}\n"); + borderInterface.OnMoved(e.WindowPosition.X, e.WindowPosition.X); + } + // Called when the window size has changed. private void OnBorderWindowResized(object sender, Window.ResizedEventArgs e) diff --git a/src/Tizen.NUI/src/public/Window/DefaultBorder.cs b/src/Tizen.NUI/src/public/Window/DefaultBorder.cs index 815540a..3d1d598 100755 --- a/src/Tizen.NUI/src/public/Window/DefaultBorder.cs +++ b/src/Tizen.NUI/src/public/Window/DefaultBorder.cs @@ -420,6 +420,7 @@ namespace Tizen.NUI } else { + OnRequestMove(); BorderWindow.RequestMoveToServer(); } } @@ -780,6 +781,7 @@ namespace Tizen.NUI } else { + OnRequestMove(); BorderWindow.RequestMoveToServer(); } } @@ -831,6 +833,20 @@ namespace Tizen.NUI } /// + /// Called when requesting a move + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public virtual void OnRequestMove() {} + + /// + /// Called when the window is moved. + /// + /// The x of the moved window + /// The y of the moved window + [EditorBrowsable(EditorBrowsableState.Never)] + public virtual void OnMoved(int x, int y) {} + + /// /// Called when the window is maximized. /// /// If window is maximized or unmaximized. diff --git a/src/Tizen.NUI/src/public/Window/IBorderInterface.cs b/src/Tizen.NUI/src/public/Window/IBorderInterface.cs index 664170e..95fa46b 100755 --- a/src/Tizen.NUI/src/public/Window/IBorderInterface.cs +++ b/src/Tizen.NUI/src/public/Window/IBorderInterface.cs @@ -109,12 +109,6 @@ namespace Tizen.NUI public void OnCreated(View borderView); /// - /// Called when requesting a resize - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void OnRequestResize(); - - /// /// Called when the window is resized. /// /// The width of the resized window @@ -123,6 +117,14 @@ namespace Tizen.NUI public void OnResized(int width, int height); /// + /// Called when the window is moved. + /// + /// The x of the moved window + /// The y of the moved window + [EditorBrowsable(EditorBrowsableState.Never)] + public void OnMoved(int x, int y); + + /// /// Called when the window is maximized. /// /// If window is maximized or unmaximized. -- 2.7.4