When the window is full size, the content area should be full size. So it makes the border line disappear.
When it becomes partial size again, the border line is visible.
private IBorderInterface borderInterface = null;
private Layer borderWindowRootLayer = null;
private Layer borderWindowBottomLayer = null;
private IBorderInterface borderInterface = null;
private Layer borderWindowRootLayer = null;
private Layer borderWindowBottomLayer = null;
- private bool isBorderWindow = false;
// for border area
private View rootView = null;
// for border area
private View rootView = null;
private View topView = null;
private View contentsView = null;
private View bottomView = null;
private View topView = null;
private View contentsView = null;
private View bottomView = null;
- private bool isTop = false;
- private bool isBottom = false;
private float borderHeight = 0;
private int screenWidth = 0;
private int screenHeight = 0;
private float borderHeight = 0;
private int screenWidth = 0;
private int screenHeight = 0;
+ private bool isBorderWindow = false;
+ private bool hasTopView = false;
+ private bool hasBottomView = false;
+ private bool isEnabledOverlayMode = false;
+ private bool isMaximized = false;
+
// for config
private Size2D minSize = null;
private Size2D maxSize = null;
// for config
private Size2D minSize = null;
private Size2D maxSize = null;
if (borderInterface != null)
{
float height = 0;
if (borderInterface != null)
{
float height = 0;
- if (isTop) height += topView.SizeHeight;
- if (isBottom) height += bottomView.SizeHeight;
+ if (hasTopView) height += topView.SizeHeight;
+ if (hasBottomView) height += bottomView.SizeHeight;
if (height != borderHeight)
{
if (height != borderHeight)
{
// Increase the window size as much as the border area.
borderHeight = 0;
// Increase the window size as much as the border area.
borderHeight = 0;
- if (isTop) borderHeight += topView.SizeHeight;
- if (isBottom) borderHeight += bottomView.SizeHeight;
+ if (hasTopView) borderHeight += topView.SizeHeight;
+ if (hasBottomView) borderHeight += bottomView.SizeHeight;
// Sets the minimum / maximum size to be resized by RequestResizeToServer.
if (borderInterface.MinSize != null)
// Sets the minimum / maximum size to be resized by RequestResizeToServer.
if (borderInterface.MinSize != null)
if (borderInterface.CreateTopBorderView(topView) == true && topView != null)
{
borderView.Add(topView);
if (borderInterface.CreateTopBorderView(topView) == true && topView != null)
{
borderView.Add(topView);
}
borderView.Add(contentsView);
if (borderInterface.CreateBottomBorderView(bottomView) == true && bottomView != null)
{
borderView.Add(bottomView);
}
borderView.Add(contentsView);
if (borderInterface.CreateBottomBorderView(bottomView) == true && bottomView != null)
{
borderView.Add(bottomView);
}
rootView.Add(borderView);
}
rootView.Add(borderView);
- return isTop || isBottom;
+ return hasTopView || hasBottomView;
direction = BorderDirection.Top;
}
// check move
direction = BorderDirection.Top;
}
// check move
- else if ((yPosition > WindowSize.Height) || (isTop == true && yPosition < topView.SizeHeight))
+ else if ((yPosition > WindowSize.Height) || (hasTopView == true && yPosition < topView.SizeHeight))
{
direction = BorderDirection.Move;
}
{
direction = BorderDirection.Move;
}
{
if (borderInterface.OverlayMode == true)
{
{
if (borderInterface.OverlayMode == true)
{
- borderInterface.OnOverlayMode(enable);
- borderView?.OverlayMode(enable);
- if (enable == true)
- {
- GetBorderWindowBottomLayer().RaiseToTop();
- }
- else
+ if (isEnabledOverlayMode != enable)
- GetBorderWindowBottomLayer().LowerToBottom();
+ borderView?.OverlayMode(enable);
+ borderInterface.OnOverlayMode(enable);
+ if (enable == true)
+ {
+ GetBorderWindowBottomLayer().RaiseToTop();
+ }
+ else
+ {
+ GetBorderWindowBottomLayer().LowerToBottom();
+ }
+ isEnabledOverlayMode = enable;
+ private void DoMaximize(bool isMaximized)
+ {
+ if (this.isMaximized != isMaximized)
+ {
+ borderView?.OnMaximize(isMaximized);
+ borderInterface.OnMaximize(isMaximized);
+ }
+ this.isMaximized = isMaximized;
+ }
+
// Called when the window position has changed.
private void OnBorderWindowMoved(object sender, WindowMovedEventArgs e)
{
// Called when the window position has changed.
private void OnBorderWindowMoved(object sender, WindowMovedEventArgs e)
{
// reset borderHeight
borderHeight = 0;
// reset borderHeight
borderHeight = 0;
- if (isTop) borderHeight += topView.SizeHeight;
- if (isBottom) borderHeight += bottomView.SizeHeight;
+ if (hasTopView) borderHeight += topView.SizeHeight;
+ if (hasBottomView) borderHeight += bottomView.SizeHeight;
- if (borderInterface.OverlayMode == true && IsMaximized() == true)
+ bool isMaximized = IsMaximized();
+ bool isEnabledOverlay = (borderInterface.OverlayMode == true && isMaximized == true);
+
+ float width = 0;
+ float height = isEnabledOverlay ? 0 : borderHeight;
+ float y = isEnabledOverlay ? 0 : ((hasTopView == true) ? topView.SizeHeight : 0);
+
+ if (isMaximized == false)
- Interop.ActorInternal.SetSize(GetBorderWindowRootLayer().SwigCPtr, resizeWidth, resizeHeight);
- Interop.ActorInternal.SetSize(GetBorderWindowBottomLayer().SwigCPtr, resizeWidth, resizeHeight);
- Interop.ActorInternal.SetPosition(GetBorderWindowRootLayer().SwigCPtr, 0, 0);
- if (contentsView != null)
- {
- contentsView.SizeHeight = resizeHeight - borderHeight - (float)(borderInterface.BorderLineThickness * 2);
- }
- DoOverlayMode(true);
+ width = (float)(borderInterface.BorderLineThickness * 2);
+ height += (float)(borderInterface.BorderLineThickness * 2);
+ y += borderInterface.BorderLineThickness;
+
+ Interop.ActorInternal.SetSize(GetBorderWindowRootLayer().SwigCPtr, resizeWidth, resizeHeight);
+ Interop.ActorInternal.SetSize(GetBorderWindowBottomLayer().SwigCPtr, resizeWidth + width, resizeHeight + height);
+ Interop.ActorInternal.SetPosition(GetBorderWindowRootLayer().SwigCPtr, 0, y);
+
+ if (contentsView != null)
- float height = (isTop == true) ? topView.SizeHeight : 0;
- Interop.ActorInternal.SetSize(GetBorderWindowRootLayer().SwigCPtr, resizeWidth, resizeHeight);
- Interop.ActorInternal.SetSize(GetBorderWindowBottomLayer().SwigCPtr, resizeWidth + (float)(borderInterface.BorderLineThickness * 2), resizeHeight + borderHeight + (float)(borderInterface.BorderLineThickness * 2));
- Interop.ActorInternal.SetPosition(GetBorderWindowRootLayer().SwigCPtr, 0, height + borderInterface.BorderLineThickness);
- if (contentsView != null)
- {
- contentsView.SizeHeight = resizeHeight;
- }
- DoOverlayMode(false);
+ contentsView.SizeHeight = resizeHeight - (isEnabledOverlay ? borderHeight : 0);
+ DoMaximize(isMaximized);
+
+ DoOverlayMode(isEnabledOverlay);
if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); }
}
if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); }
}
Interop.Actor.SetAnchorPoint(borderWindowRootLayer.SwigCPtr, topCentor.SwigCPtr);
Interop.Actor.Add(rootLayer.SwigCPtr, borderWindowRootLayer.SwigCPtr);
Interop.ActorInternal.SetSize(borderWindowRootLayer.SwigCPtr, WindowSize.Width, WindowSize.Height - borderHeight - borderInterface.BorderLineThickness * 2);
Interop.Actor.SetAnchorPoint(borderWindowRootLayer.SwigCPtr, topCentor.SwigCPtr);
Interop.Actor.Add(rootLayer.SwigCPtr, borderWindowRootLayer.SwigCPtr);
Interop.ActorInternal.SetSize(borderWindowRootLayer.SwigCPtr, WindowSize.Width, WindowSize.Height - borderHeight - borderInterface.BorderLineThickness * 2);
- float height = (isTop == true) ? topView.SizeHeight : 0;
+ float height = (hasTopView == true) ? topView.SizeHeight : 0;
Interop.ActorInternal.SetPosition(borderWindowRootLayer.SwigCPtr, 0, height + borderInterface.BorderLineThickness);
using PropertyValue propertyValue = new Tizen.NUI.PropertyValue((int)Tizen.NUI.ClippingModeType.ClipToBoundingBox);
Tizen.NUI.Object.SetProperty(borderWindowRootLayer.SwigCPtr, Tizen.NUI.BaseComponents.View.Property.ClippingMode, propertyValue);
Interop.ActorInternal.SetPosition(borderWindowRootLayer.SwigCPtr, 0, height + borderInterface.BorderLineThickness);
using PropertyValue propertyValue = new Tizen.NUI.PropertyValue((int)Tizen.NUI.ClippingModeType.ClipToBoundingBox);
Tizen.NUI.Object.SetProperty(borderWindowRootLayer.SwigCPtr, Tizen.NUI.BaseComponents.View.Property.ClippingMode, propertyValue);
// View class for border view.
private class BorderView : View
{
// View class for border view.
private class BorderView : View
{
- private bool overlayEnabled = false;
+ private bool isEnabledOverlay = false;
+ private Extents prePadding = new Extents(0, 0, 0, 0);
/// <summary>
/// Set whether or not it is in overlay mode.
/// <summary>
/// Set whether or not it is in overlay mode.
[EditorBrowsable(EditorBrowsableState.Never)]
public void OverlayMode(bool enabled)
{
[EditorBrowsable(EditorBrowsableState.Never)]
public void OverlayMode(bool enabled)
{
- overlayEnabled = enabled;
+ isEnabledOverlay = enabled;
- protected override bool HitTest(Touch touch)
+ /// <summary>
+ /// Called when the window is maximized.
+ /// </summary>
+ /// <param name="isMaximized">If window is maximized or unmaximized.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void OnMaximize(bool isMaximized)
- // If borderView is in overlay mode, pass the hittest.
- if (overlayEnabled == true)
+ // When maximized, it is displayed in full without border lines.
+ if (isMaximized == true)
+ prePadding = Padding;
+ Padding = new Extents(0, 0, 0, 0);
+ else
+ {
+ Padding = prePadding;
+ }
+
+ }
+
+ protected override bool HitTest(Touch touch)
+ {
+ // If borderView is in overlay mode, pass the hittest.
+ return (isEnabledOverlay == false);
private Size2D minSize;
private Size2D maxSize;
private Window.BorderResizePolicyType resizePolicy;
private Size2D minSize;
private Size2D maxSize;
private Window.BorderResizePolicyType resizePolicy;
#endregion //Fields
#region Events
#endregion //Fields
#region Events
if (BorderWindow.IsMaximized())
{
BorderWindow.Maximize(false);
if (BorderWindow.IsMaximized())
{
BorderWindow.Maximize(false);
else
{
BorderWindow.Maximize(true);
else
{
BorderWindow.Maximize(true);
if (BorderWindow.IsMaximized() == true)
{
BorderWindow.Maximize(false);
if (BorderWindow.IsMaximized() == true)
{
BorderWindow.Maximize(false);
if (BorderWindow.IsMaximized())
{
BorderWindow.Maximize(false);
if (BorderWindow.IsMaximized())
{
BorderWindow.Maximize(false);
}
else
{
BorderWindow.Maximize(true);
}
else
{
BorderWindow.Maximize(true);
if (BorderWindow.IsMaximized() == false)
{
BorderWindow.Maximize(true);
if (BorderWindow.IsMaximized() == false)
{
BorderWindow.Maximize(true);
}
else
{
BorderWindow.Maximize(false);
}
else
{
BorderWindow.Maximize(false);
if (BorderWindow.IsMaximized() == true)
{
BorderWindow.Maximize(false);
if (BorderWindow.IsMaximized() == true)
{
BorderWindow.Maximize(false);
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual void OnMaximize(bool isMaximized)
{
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual void OnMaximize(bool isMaximized)
{
+ Tizen.Log.Info("NUI", $"OnMaximize {isMaximized}\n");
{
if (borderView != null && OverlayMode == true)
{
{
if (borderView != null && OverlayMode == true)
{
+ Tizen.Log.Info("NUI", $"OnOverlayMode {enabled}\n");
if (enabled == true)
{
backgroundColor = new Color(borderView.BackgroundColor);
if (enabled == true)
{
backgroundColor = new Color(borderView.BackgroundColor);