[NUI] Add UpdateProperty api for BorderWindow
authorjoogab.yun <joogab.yun@samsung.com>
Fri, 19 Aug 2022 06:17:32 +0000 (15:17 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Mon, 22 Aug 2022 09:48:10 +0000 (18:48 +0900)
Changing the BorderView's SizeHeight should also change the Window size.

For this, we add an UpdateProperty() api.

src/Tizen.NUI/src/public/Window/BorderWindow.cs
src/Tizen.NUI/src/public/Window/DefaultBorder.cs

index 161de37..0369b76 100755 (executable)
@@ -133,6 +133,17 @@ namespace Tizen.NUI
         {
             if (borderInterface != null)
             {
+                float height = 0;
+                if (isTop) height += topView.SizeHeight;
+                if (isBottom) height += bottomView.SizeHeight;
+
+                if (height != borderHeight)
+                {
+                    float diff = height - borderHeight;
+                    borderHeight = height;
+                    WindowSize = new Size2D(WindowSize.Width, WindowSize.Height + (int)(diff));
+                }
+
                 if (minSize != borderInterface.MinSize)
                 {
                     using Size2D mimimumSize = new Size2D(borderInterface.MinSize.Width, borderInterface.MinSize.Height + (int)borderHeight);
index 3d1d598..f7776a7 100755 (executable)
@@ -119,7 +119,7 @@ namespace Tizen.NUI
         /// The minimum size by which the window will small.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public Size2D MinSize 
+        public Size2D MinSize
         {
             get
             {
@@ -128,7 +128,7 @@ namespace Tizen.NUI
             set
             {
                 minSize = value;
-                BorderWindow?.UpdateProperty();
+                UpdateProperty();
             }
         }
 
@@ -145,7 +145,7 @@ namespace Tizen.NUI
             set
             {
                 maxSize = value;
-                BorderWindow?.UpdateProperty();
+                UpdateProperty();
             }
         }
 
@@ -178,10 +178,19 @@ namespace Tizen.NUI
             set
             {
                 resizePolicy = value;
-                BorderWindow?.UpdateProperty();
+                UpdateProperty();
             }
         }
 
+        /// <summary>
+        /// Update properties
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void UpdateProperty()
+        {
+            BorderWindow?.UpdateProperty();
+        }
+
 
         /// <summary>
         /// Creates a default border