From: huiyueun <35286162+huiyueun@users.noreply.github.com> Date: Thu, 25 Jan 2018 04:29:20 +0000 (+0900) Subject: [NUI]Revert sibling patch (#78) X-Git-Tag: 4.0.1-preview1-00068~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dc3591ecaefb7e331ce7d9bd6a657f6da3a9e7de;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI]Revert sibling patch (#78) * Revert "[NUI] Fix SiblingOrder return value (#37)" This reverts commit 6591fa264a9316785a0601f0b25f2fd1994dad22. * Revert "[Tizen.NUI]Fix bug about Children property. (#23)" This reverts commit 6d306df109b452d8f03bc28180b56bf38fd4ed2d. * Revert "[NUI] Fix sibling issue (#20)" This reverts commit da9ec169dab93abd132247eaad37eaf559e99edf. --- diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 0e3ae0405..41668b281 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -49,18 +49,11 @@ namespace Tizen.NUI.BaseComponents /// 4 public override void Add(View child) { - Container oldParent = child.Parent; - if(oldParent != this) - { - if (oldParent != null) - { - oldParent.Remove(child); - } - NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - Children.Add(child); - } + NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + Children.Add(child); } /// @@ -2255,54 +2248,13 @@ namespace Tizen.NUI.BaseComponents { get { - var parentChildren = Parent?.Children; - int currentOrder = 0; - if (parentChildren != null) - { - currentOrder = parentChildren.IndexOf(this); - - if (currentOrder < 0) - { - return 0; - } - else if (currentOrder < parentChildren.Count) - { - return currentOrder; - } - } - - return 0; + int temp = 0; + GetProperty(View.Property.SIBLING_ORDER).Get(out temp); + return temp; } set { - var siblings = Parent?.Children; - if (siblings != null) - { - int currentOrder = siblings.IndexOf(this); - - if (value != currentOrder) - { - if (value == 0) - { - LowerToBottom(); - } - else if (value < siblings.Count - 1) - { - if (value > currentOrder) - { - RaiseAbove(siblings[value]); - } - else - { - LowerBelow(siblings[value]); - } - } - else - { - RaiseToTop(); - } - } - } + SetProperty(View.Property.SIBLING_ORDER, new Tizen.NUI.PropertyValue(value)); } } @@ -3744,22 +3696,6 @@ namespace Tizen.NUI.BaseComponents } } - - /// - /// [Obsolete("Please do not use! this will be deprecated. Please use Visibility instead.")] - /// - /// 3 - [Obsolete("Please do not use! This will be deprecated! Please use Visibility instead!")] - [EditorBrowsable(EditorBrowsableState.Never)] - public bool Visible - { - get - { - return IsVisible(); - } - } - - /// /// Gets the view's world color. /// diff --git a/src/Tizen.NUI/src/public/Layer.cs b/src/Tizen.NUI/src/public/Layer.cs index 926468632..8fee27b7b 100755 --- a/src/Tizen.NUI/src/public/Layer.cs +++ b/src/Tizen.NUI/src/public/Layer.cs @@ -50,18 +50,11 @@ namespace Tizen.NUI /// 4 public override void Add(View child) { - Container oldParent = child.GetParent(); - if (oldParent != this) - { - if (oldParent != null) - { - oldParent.Remove(child); - } - NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - Children.Add(child); - } + NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + Children.Add(child); } /// @@ -270,8 +263,6 @@ namespace Tizen.NUI parentChildren[currentIdx] = temp; } } - NDalicPINVOKE.Layer_Raise(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// @@ -295,46 +286,16 @@ namespace Tizen.NUI } } - NDalicPINVOKE.Layer_Lower(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void RaiseAbove(Layer target) { - var parentChildren = Window.Instance.LayersChildren; - if (parentChildren != null) - { - int currentIndex = parentChildren.IndexOf(this); - int targetIndex = parentChildren.IndexOf(target); - - // If the currentIndex is less than the target index and the target has the same parent. - if (currentIndex < targetIndex) - { - parentChildren.Remove(this); - parentChildren.Insert(targetIndex, this); - } - } NDalicPINVOKE.Layer_RaiseAbove(swigCPtr, Layer.getCPtr(target)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void LowerBelow(Layer target) { - var parentChildren = Window.Instance.LayersChildren; - - if (parentChildren != null) - { - int currentIndex = parentChildren.IndexOf(this); - int targetIndex = parentChildren.IndexOf(target); - - // If the currentIndex is not already the 0th index and the target has the same parent. - if ((currentIndex != 0) && (targetIndex != -1) && - (currentIndex > targetIndex)) - { - parentChildren.Remove(this); - parentChildren.Insert(targetIndex, this); - } - } NDalicPINVOKE.Layer_LowerBelow(swigCPtr, Layer.getCPtr(target)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); }