From be98cd8a94f2dba5021afb6142cf6cf3aa5075f3 Mon Sep 17 00:00:00 2001 From: "joogab.yun" Date: Sat, 3 Jun 2023 09:53:38 +0900 Subject: [PATCH] [NUI] Add moveCompleted and resizeCompleted api on BorderWindow --- src/Tizen.NUI/src/public/Window/BorderWindow.cs | 24 ++++++++++++++++++---- src/Tizen.NUI/src/public/Window/DefaultBorder.cs | 20 ++++++++++++++++-- .../src/public/Window/IBorderInterface.cs | 16 +++++++++++++++ 3 files changed, 54 insertions(+), 6 deletions(-) diff --git a/src/Tizen.NUI/src/public/Window/BorderWindow.cs b/src/Tizen.NUI/src/public/Window/BorderWindow.cs index 3b0cc1b..64477db 100755 --- a/src/Tizen.NUI/src/public/Window/BorderWindow.cs +++ b/src/Tizen.NUI/src/public/Window/BorderWindow.cs @@ -186,14 +186,14 @@ namespace Tizen.NUI SetMimimumSize(mimimumSize); minSize = borderInterface.MinSize; } - + if (maxSize != borderInterface.MaxSize || (borderInterface.MaxSize != null && isNeedResizeByLine == true)) { using Size2D maximumSize = new Size2D((borderInterface.MaxSize?.Width + (int)borderLineThickness * 2 ?? 0), (borderInterface.MaxSize?.Height ?? 0) + (int)(borderHeight + borderLineThickness * 2)); SetMaximumSize(maximumSize); maxSize = borderInterface.MaxSize; } - + if (borderResizePolicy != borderInterface.ResizePolicy) { AddAuxiliaryHint("wm.policy.win.resize_aspect_ratio", "0"); @@ -203,7 +203,7 @@ namespace Tizen.NUI AddAuxiliaryHint("wm.policy.win.resize_aspect_ratio", "1"); } } - + } } /// @@ -269,6 +269,10 @@ namespace Tizen.NUI Moved += OnBorderWindowMoved; + MoveCompleted += OnBorderWindowMoveCompleted; + + ResizeCompleted += OnBorderWindowResizeCompleted; + borderInterface.OnCreated(borderView); // Increase the window size as much as the border area. @@ -533,7 +537,19 @@ namespace Tizen.NUI 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); + borderInterface.OnMoved(e.WindowPosition.X, e.WindowPosition.Y); + } + + private void OnBorderWindowMoveCompleted(object sender, WindowMoveCompletedEventArgs e) + { + Tizen.Log.Info("NUI", $"OnBorderWindowMoveCompleted {e.WindowCompletedPosition.X}, {e.WindowCompletedPosition.Y}\n"); + borderInterface.OnMoveCompleted(e.WindowCompletedPosition.X, e.WindowCompletedPosition.Y); + } + + private void OnBorderWindowResizeCompleted(object sender, WindowResizeCompletedEventArgs e) + { + Tizen.Log.Info("NUI", $"OnBorderWindowResizeCompleted {e.WindowCompletedSize.Width}, {e.WindowCompletedSize.Height}\n"); + borderInterface.OnResizeCompleted(e.WindowCompletedSize.Width, e.WindowCompletedSize.Height); } diff --git a/src/Tizen.NUI/src/public/Window/DefaultBorder.cs b/src/Tizen.NUI/src/public/Window/DefaultBorder.cs index f185a22..af8841b 100755 --- a/src/Tizen.NUI/src/public/Window/DefaultBorder.cs +++ b/src/Tizen.NUI/src/public/Window/DefaultBorder.cs @@ -159,13 +159,13 @@ namespace Tizen.NUI var instance = (DefaultBorder)bindable; return instance.resizePolicy; }); - + /// /// The thickness of the border. /// [EditorBrowsable(EditorBrowsableState.Never)] - public uint BorderLineThickness + public uint BorderLineThickness { get { @@ -800,6 +800,22 @@ namespace Tizen.NUI public virtual void OnMoved(int x, int y) {} /// + /// Called when window has been moved the display server. + /// + /// The x of the has been moved window + /// The y of the has been moved window + [EditorBrowsable(EditorBrowsableState.Never)] + public virtual void OnMoveCompleted(int x, int y) {} + + /// + /// Called when window has been resized the display server. + /// + /// The width of the resized window + /// The height of the resized window + [EditorBrowsable(EditorBrowsableState.Never)] + public virtual void OnResizeCompleted(int width, int height) {} + + /// /// 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 95fa46b..bee48fa 100755 --- a/src/Tizen.NUI/src/public/Window/IBorderInterface.cs +++ b/src/Tizen.NUI/src/public/Window/IBorderInterface.cs @@ -125,6 +125,22 @@ namespace Tizen.NUI public void OnMoved(int x, int y); /// + /// Called when window has been moved the display server. + /// + /// The x of the has been moved window + /// The y of the has been moved window + [EditorBrowsable(EditorBrowsableState.Never)] + public void OnMoveCompleted(int x, int y); + + /// + /// Called when window has been resized the display server. + /// + /// The width of the resized window + /// The height of the resized window + [EditorBrowsable(EditorBrowsableState.Never)] + public void OnResizeCompleted(int width, int height); + + /// /// Called when the window is maximized. /// /// If window is maximized or unmaximized. -- 2.7.4