From 5d97ef8b707cd62bcc84a081a0ae08449484af43 Mon Sep 17 00:00:00 2001 From: dongsug-song <35130733+dongsug-song@users.noreply.github.com> Date: Fri, 14 Dec 2018 16:26:59 +0900 Subject: [PATCH] [NUI] RootLayout call RequestRelayout() when Window changed size or position (#615) --- src/Tizen.NUI/src/public/Window.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/Tizen.NUI/src/public/Window.cs b/src/Tizen.NUI/src/public/Window.cs index 527c9ec..09e3d8c 100755 --- a/src/Tizen.NUI/src/public/Window.cs +++ b/src/Tizen.NUI/src/public/Window.cs @@ -34,6 +34,7 @@ namespace Tizen.NUI private readonly global::System.Runtime.InteropServices.HandleRef rootLayoutCPtr; private Layer _rootLayer; private string _windowTitle; + private readonly LayoutItem rootLayoutItem; private List _childLayers = new List(); internal List LayersChildren @@ -60,6 +61,12 @@ namespace Tizen.NUI Layer rootLayer = GetRootLayer(); // Add the root layout created above to the root layer. NDalicPINVOKE.Actor_Add( Layer.getCPtr(rootLayer), rootLayoutCPtr ); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + global::System.IntPtr rootControlLayoutIntPtr = Tizen.NUI.NDalicManualPINVOKE.GetLayout__SWIG_1(rootLayoutCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + rootLayoutItem = new LayoutItem(rootControlLayoutIntPtr, true); } } @@ -1467,6 +1474,11 @@ namespace Tizen.NUI NDalicManualPINVOKE.SetSize(swigCPtr, Uint16Pair.getCPtr(val)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + if(rootLayoutItem != null) + { + rootLayoutItem.RequestLayout(); + } } internal Size2D GetWindowSize() @@ -1484,6 +1496,11 @@ namespace Tizen.NUI NDalicManualPINVOKE.SetPosition(swigCPtr, Uint16Pair.getCPtr(val)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + if(rootLayoutItem != null) + { + rootLayoutItem.RequestLayout(); + } } internal Position2D GetPosition() @@ -1499,6 +1516,11 @@ namespace Tizen.NUI { NDalicPINVOKE.Window_SetPositionSize(swigCPtr, Rectangle.getCPtr(positionSize)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + if(rootLayoutItem != null) + { + rootLayoutItem.RequestLayout(); + } } /// -- 2.7.4