From 7e9b55153e3417428444b533b61fdc90f0e1d083 Mon Sep 17 00:00:00 2001 From: bshsqa <32317749+bshsqa@users.noreply.github.com> Date: Thu, 19 Nov 2020 15:03:52 +0900 Subject: [PATCH] [NUI] Correct the meaning of ExcludeLayouting. (#2256) Signed-off-by: seungho --- src/Tizen.NUI/src/internal/Layouting/GridLocations.cs | 4 ++-- src/Tizen.NUI/src/public/BaseComponents/View.cs | 8 ++++---- src/Tizen.NUI/src/public/Layouting/AbsoluteLayout.cs | 2 +- src/Tizen.NUI/src/public/Layouting/FlexLayout.cs | 4 ++-- src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs | 4 ++-- src/Tizen.NUI/src/public/Layouting/LayoutItem.cs | 6 +++--- src/Tizen.NUI/src/public/Layouting/LinearLayout.cs | 16 ++++++++-------- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/Tizen.NUI/src/internal/Layouting/GridLocations.cs b/src/Tizen.NUI/src/internal/Layouting/GridLocations.cs index 4cf885f..0d92415 100755 --- a/src/Tizen.NUI/src/internal/Layouting/GridLocations.cs +++ b/src/Tizen.NUI/src/internal/Layouting/GridLocations.cs @@ -152,7 +152,7 @@ namespace Tizen.NUI LayoutItem item = LayoutChildren[i]; View view = item?.Owner; if (view == null) continue; - if (item.Owner.ExcludeLayouting) + if (!item.Owner.ExcludeLayouting) { gridChildCount++; } @@ -177,7 +177,7 @@ namespace Tizen.NUI View view = item?.Owner; if (view == null) continue; - if (!view.ExcludeLayouting) + if (view.ExcludeLayouting) { MeasureChildWithoutPadding(item, widthMeasureSpec, heightMeasureSpec); gridChildIndex--; diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 40c7d51..be3e533 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -62,7 +62,7 @@ namespace Tizen.NUI.BaseComponents private bool controlStatePropagation = false; private ViewStyle viewStyle; private bool themeChangeSensitive = false; - private bool excludeLayouting = true; + private bool excludeLayouting = false; internal Size2D sizeSetExplicitly = new Size2D(); // Store size set by API, will be used in place of NaturalSize if not set. internal BackgroundExtraData backgroundExtraData; @@ -217,9 +217,9 @@ namespace Tizen.NUI.BaseComponents set { excludeLayouting = value; - if(Layout != null && Layout.SetPositionByLayout != value) + if (Layout != null && Layout.SetPositionByLayout == value) { - Layout.SetPositionByLayout = value; + Layout.SetPositionByLayout = !value; Layout.RequestLayout(); } } @@ -2207,7 +2207,7 @@ namespace Tizen.NUI.BaseComponents // Remove existing layout from it's parent layout group. _layout?.Unparent(); - value.SetPositionByLayout = excludeLayouting; + value.SetPositionByLayout = !excludeLayouting; // Set layout to this view SetLayout(value); diff --git a/src/Tizen.NUI/src/public/Layouting/AbsoluteLayout.cs b/src/Tizen.NUI/src/public/Layouting/AbsoluteLayout.cs index 44aa5f7..ecb04eb 100755 --- a/src/Tizen.NUI/src/public/Layouting/AbsoluteLayout.cs +++ b/src/Tizen.NUI/src/public/Layouting/AbsoluteLayout.cs @@ -54,7 +54,7 @@ namespace Tizen.NUI // Get size of child with no padding, no margin. we won't support margin, padding for AbsolutLayout. MeasureChildWithoutPadding(childLayout, widthMeasureSpec, heightMeasureSpec); - if (!childLayout.Owner.ExcludeLayouting) + if (childLayout.Owner.ExcludeLayouting) { continue; } diff --git a/src/Tizen.NUI/src/public/Layouting/FlexLayout.cs b/src/Tizen.NUI/src/public/Layouting/FlexLayout.cs index 56ed9b5..2a22439 100755 --- a/src/Tizen.NUI/src/public/Layouting/FlexLayout.cs +++ b/src/Tizen.NUI/src/public/Layouting/FlexLayout.cs @@ -672,7 +672,7 @@ namespace Tizen.NUI if (childHandleRef.Handle == IntPtr.Zero || Child == null) continue; - if (!layoutItem.Owner.ExcludeLayouting) + if (layoutItem.Owner.ExcludeLayouting) { SetFlexPositionType(Child, PositionType.Absolute); Interop.FlexLayout.FlexLayout_SetFlexPositionType(childHandleRef, (int)PositionType.Absolute); @@ -735,7 +735,7 @@ namespace Tizen.NUI LayoutItem childLayout = LayoutChildren[childIndex]; if (childLayout != null) { - if (childLayout.Owner.ExcludeLayouting) + if (!childLayout.Owner.ExcludeLayouting) { // Get the frame for the child, start, top, end, bottom. Vector4 frame = new Vector4(Interop.FlexLayout.FlexLayout_GetNodeFrame(swigCPtr, childIndex), true); diff --git a/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs b/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs index 0e40227..4172c3a 100755 --- a/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs +++ b/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs @@ -431,7 +431,7 @@ namespace Tizen.NUI } /// - /// Layout independent children those Owners have false ExcludeLayouting.
+ /// Layout independent children those Owners have true ExcludeLayouting.
/// These children are required not to be affected by this layout.
///
[EditorBrowsable(EditorBrowsableState.Never)] @@ -443,7 +443,7 @@ namespace Tizen.NUI LayoutItem childLayout = LayoutChildren[childIndex]; if (childLayout != null) { - if (!childLayout.Owner.ExcludeLayouting) + if (childLayout.Owner.ExcludeLayouting) { LayoutLength childWidth = childLayout.MeasuredWidth.Size; LayoutLength childHeight = childLayout.MeasuredHeight.Size; diff --git a/src/Tizen.NUI/src/public/Layouting/LayoutItem.cs b/src/Tizen.NUI/src/public/Layouting/LayoutItem.cs index 7ba44af..c4bba54 100755 --- a/src/Tizen.NUI/src/public/Layouting/LayoutItem.cs +++ b/src/Tizen.NUI/src/public/Layouting/LayoutItem.cs @@ -87,9 +87,9 @@ namespace Tizen.NUI set { setPositionByLayout = value; - if (Owner != null && Owner.ExcludeLayouting != value) + if (Owner != null && Owner.ExcludeLayouting == value) { - Owner.ExcludeLayouting = value; + Owner.ExcludeLayouting = !value; } } } @@ -269,7 +269,7 @@ namespace Tizen.NUI else { // If height or width specification is not explicitly defined, - // the size of the owner view must be reset even the ExcludeLayouting is false. + // the size of the owner view must be reset even the ExcludeLayouting is true. if (Owner.HeightSpecification < 0 || Owner.WidthSpecification < 0) { Owner.SetSize(right.AsRoundedValue() - left.AsRoundedValue(), bottom.AsRoundedValue() - top.AsRoundedValue()); diff --git a/src/Tizen.NUI/src/public/Layouting/LinearLayout.cs b/src/Tizen.NUI/src/public/Layouting/LinearLayout.cs index 10eee9f..ea3ee27 100755 --- a/src/Tizen.NUI/src/public/Layouting/LinearLayout.cs +++ b/src/Tizen.NUI/src/public/Layouting/LinearLayout.cs @@ -290,7 +290,7 @@ namespace Tizen.NUI for (int i = 0; i < LayoutChildren.Count; i++) { LayoutItem childLayout = LayoutChildren[i]; - if (!childLayout.Owner.ExcludeLayouting) + if (childLayout.Owner.ExcludeLayouting) { MeasureChildWithoutPadding(childLayout, widthMeasureSpec, heightMeasureSpec); continue; @@ -407,7 +407,7 @@ namespace Tizen.NUI for (int i = 0; i < numberOfChildren; ++i) { LayoutItem childLayout = LayoutChildren[i]; - if (!childLayout.Owner.ExcludeLayouting) + if (childLayout.Owner.ExcludeLayouting) { continue; } @@ -502,7 +502,7 @@ namespace Tizen.NUI for (int i = 0; i < LayoutChildren.Count; i++) { LayoutItem childLayout = LayoutChildren[i]; - if (!childLayout.Owner.ExcludeLayouting) + if (childLayout.Owner.ExcludeLayouting) { MeasureChildWithoutPadding(childLayout, widthMeasureSpec, heightMeasureSpec); continue; @@ -618,7 +618,7 @@ namespace Tizen.NUI for (int i = 0; i < numberOfChildren; ++i) { LayoutItem childLayout = LayoutChildren[i]; - if (!childLayout.Owner.ExcludeLayouting) + if (childLayout.Owner.ExcludeLayouting) { continue; } @@ -747,7 +747,7 @@ namespace Tizen.NUI LayoutItem childLayout = LayoutChildren[childIndex]; if (childLayout != null) { - if (childLayout.Owner.ExcludeLayouting) + if (!childLayout.Owner.ExcludeLayouting) { LayoutLength childWidth = childLayout.MeasuredWidth.Size; LayoutLength childHeight = childLayout.MeasuredHeight.Size; @@ -811,7 +811,7 @@ namespace Tizen.NUI LayoutItem childLayout = LayoutChildren[i]; if (childLayout != null) { - if (childLayout.Owner.ExcludeLayouting) + if (!childLayout.Owner.ExcludeLayouting) { LayoutLength childWidth = childLayout.MeasuredWidth.Size; LayoutLength childHeight = childLayout.MeasuredHeight.Size; @@ -853,7 +853,7 @@ namespace Tizen.NUI MeasureSpecification uniformMeasureSpec = new MeasureSpecification(MeasuredHeight.Size, MeasureSpecification.ModeType.Exactly); foreach (LayoutItem childLayout in LayoutChildren) { - if (!childLayout.Owner.ExcludeLayouting) + if (childLayout.Owner.ExcludeLayouting) { continue; } @@ -880,7 +880,7 @@ namespace Tizen.NUI MeasureSpecification uniformMeasureSpec = new MeasureSpecification(MeasuredWidth.Size, MeasureSpecification.ModeType.Exactly); foreach (LayoutItem childLayout in LayoutChildren) { - if (!childLayout.Owner.ExcludeLayouting) + if (childLayout.Owner.ExcludeLayouting) { continue; } -- 2.7.4