From: Taehyub Kim Date: Wed, 18 Oct 2023 11:07:38 +0000 (+0900) Subject: [NUI] Add an API to set offset for drag window X-Git-Tag: accepted/tizen/unified/20231205.024657~76 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8823da25378c8e602891f4493e27a92b99553c88;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Add an API to set offset for drag window --- diff --git a/src/Tizen.NUI/src/public/DragAndDrop/DragAndDrop.cs b/src/Tizen.NUI/src/public/DragAndDrop/DragAndDrop.cs index 0e77eb8..52b0c9e 100755 --- a/src/Tizen.NUI/src/public/DragAndDrop/DragAndDrop.cs +++ b/src/Tizen.NUI/src/public/DragAndDrop/DragAndDrop.cs @@ -43,6 +43,8 @@ namespace Tizen.NUI private Window mDragWindow; private int shadowWidth; private int shadowHeight; + private int dragWindowOffsetX = 0; + private int dragWindowOffsetY = 0; private bool initDrag = false; @@ -123,7 +125,7 @@ namespace Tizen.NUI shadowHeight = MinDragWindowHeight; } - mDragWindow = new Window("DragWindow", new Rectangle(-shadowWidth, -shadowHeight, shadowWidth, shadowHeight), true) + mDragWindow = new Window("DragWindow", new Rectangle(dragWindowOffsetX, dragWindowOffsetY, shadowWidth, shadowHeight), true) { BackgroundColor = Color.Transparent, }; @@ -313,5 +315,17 @@ namespace Tizen.NUI throw new InvalidOperationException("Fail to RemoveListener for Window"); } } + + /// + /// Sets drag window offset + /// + /// The x direction offset + /// The y direction offset + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetDragWindowOffset(int x, int y) + { + dragWindowOffsetX = x; + dragWindowOffsetY = y; + } } } diff --git a/test/NUIDnDSource/NUIDnDSource.cs b/test/NUIDnDSource/NUIDnDSource.cs index 660db6c..7bceebe 100644 --- a/test/NUIDnDSource/NUIDnDSource.cs +++ b/test/NUIDnDSource/NUIDnDSource.cs @@ -24,6 +24,7 @@ namespace NUIDnDSource { // Create DnD Instance dnd = DragAndDrop.Instance; + dnd.SetDragWindowOffset(-75, -75); Window.Instance.KeyEvent += OnKeyEvent; Window.Instance.WindowSize = new Size(900, 1080);