// +=====+
// '+' is BorderLineThickness
// '=' is BorderHeight
- WindowSize += new Size2D((int)borderInterface.GetBorderLineThickness() * 2, (int)(borderInterface.GetBorderHeight() + borderInterface.GetBorderLineThickness()));
+ WindowSize += new Size2D((int)borderInterface.BorderLineThickness * 2, (int)(borderInterface.BorderHeight + borderInterface.BorderLineThickness));
if (CreateBorder() == false)
{
- WindowSize -= new Size2D((int)borderInterface.GetBorderLineThickness() * 2, (int)(borderInterface.GetBorderHeight() + borderInterface.GetBorderLineThickness()));
+ WindowSize -= new Size2D((int)borderInterface.BorderLineThickness * 2, (int)(borderInterface.BorderHeight + borderInterface.BorderLineThickness));
Resized -= OnBorderWindowResized;
isBorderWindow = false;
this.borderInterface = null;
SetTransparency(true);
BackgroundColor = Color.Transparent;
- borderInterface.SetWindow(this);
+ borderInterface.BorderWindow = this;
EnableFloatingMode(true);
}
else
{
- if (borderInterface.IsOverlayMode() == true)
+ if (borderInterface.OverlayMode == true)
{
rootView.InterceptTouchEvent += OverlayInterceptTouch;
}
BorderDirection direction = BorderDirection.None;
// check bottom left corner
- if (xPosition < borderInterface.GetTouchThickness() && yPosition > WindowSize.Height + borderInterface.GetBorderHeight() - borderInterface.GetTouchThickness())
+ if (xPosition < borderInterface.TouchThickness && yPosition > WindowSize.Height + borderInterface.BorderHeight - borderInterface.TouchThickness)
{
direction = BorderDirection.BottomLeft;
}
// check bottom right corner
- else if (xPosition > WindowSize.Width + borderInterface.GetBorderLineThickness()*2 - borderInterface.GetTouchThickness() && yPosition > WindowSize.Height + borderInterface.GetBorderHeight() - borderInterface.GetTouchThickness())
+ else if (xPosition > WindowSize.Width + borderInterface.BorderLineThickness * 2 - borderInterface.TouchThickness && yPosition > WindowSize.Height + borderInterface.BorderHeight - borderInterface.TouchThickness)
{
direction = BorderDirection.BottomRight;
}
// check top left corner
- else if (xPosition < borderInterface.GetTouchThickness() && yPosition < borderInterface.GetTouchThickness())
+ else if (xPosition < borderInterface.TouchThickness && yPosition < borderInterface.TouchThickness)
{
direction = BorderDirection.TopLeft;
}
// check top right corner
- else if (xPosition > WindowSize.Width + borderInterface.GetBorderLineThickness()*2 - borderInterface.GetTouchThickness() && yPosition < borderInterface.GetTouchThickness())
+ else if (xPosition > WindowSize.Width + borderInterface.BorderLineThickness * 2 - borderInterface.TouchThickness && yPosition < borderInterface.TouchThickness)
{
direction = BorderDirection.TopRight;
}
// check left side
- else if (xPosition < borderInterface.GetTouchThickness())
+ else if (xPosition < borderInterface.TouchThickness)
{
direction = BorderDirection.Left;
}
// check right side
- else if (xPosition > WindowSize.Width + borderInterface.GetBorderLineThickness()*2 - borderInterface.GetTouchThickness())
+ else if (xPosition > WindowSize.Width + borderInterface.BorderLineThickness*2 - borderInterface.TouchThickness)
{
direction = BorderDirection.Right;
}
// check bottom side
- else if (yPosition > WindowSize.Height + borderInterface.GetBorderHeight() + borderInterface.GetBorderLineThickness() - borderInterface.GetTouchThickness())
+ else if (yPosition > WindowSize.Height + borderInterface.BorderHeight + borderInterface.BorderLineThickness - borderInterface.TouchThickness)
{
direction = BorderDirection.Bottom;
}
// check top side
- else if (yPosition < borderInterface.GetTouchThickness())
+ else if (yPosition < borderInterface.TouchThickness)
{
direction = BorderDirection.Top;
}
private void OverlayMode(bool enable)
{
- if (borderInterface.IsOverlayMode() == true)
+ if (borderInterface.OverlayMode == true)
{
if (enable == true)
{
Tizen.Log.Info("NUI", $"OnBorderWindowResized {e.WindowSize.Width},{e.WindowSize.Height}\n");
int resizeWidth = e.WindowSize.Width;
int resizeHeight = e.WindowSize.Height;
- if (borderInterface.GetMinSize() != null)
+ if (borderInterface.MinSize != null)
{
- resizeWidth = borderInterface.GetMinSize().Width > resizeWidth ? (int)borderInterface.GetMinSize().Width : resizeWidth;
- resizeHeight = borderInterface.GetMinSize().Height > resizeHeight ? (int)borderInterface.GetMinSize().Height : resizeHeight;
+ resizeWidth = borderInterface.MinSize.Width > resizeWidth ? (int)borderInterface.MinSize.Width : resizeWidth;
+ resizeHeight = borderInterface.MinSize.Height > resizeHeight ? (int)borderInterface.MinSize.Height : resizeHeight;
}
- if (borderInterface.GetMaxSize() != null)
+ if (borderInterface.MaxSize != null)
{
- resizeWidth = borderInterface.GetMaxSize().Width < resizeWidth ? (int)borderInterface.GetMaxSize().Width : resizeWidth;
- resizeHeight = borderInterface.GetMaxSize().Height < resizeHeight ? (int)borderInterface.GetMaxSize().Height : resizeHeight;
+ resizeWidth = borderInterface.MaxSize.Width < resizeWidth ? (int)borderInterface.MaxSize.Width : resizeWidth;
+ resizeHeight = borderInterface.MaxSize.Height < resizeHeight ? (int)borderInterface.MaxSize.Height : resizeHeight;
}
if (resizeWidth != e.WindowSize.Width || resizeHeight != e.WindowSize.Height)
WindowSize = new Size2D(resizeWidth, resizeHeight);
}
- if (borderInterface.IsOverlayMode() == true && IsMaximized() == true)
+ if (borderInterface.OverlayMode == true && IsMaximized() == true)
{
Interop.ActorInternal.SetSize(GetBorderWindowRootLayer().SwigCPtr, resizeWidth, resizeHeight);
Interop.ActorInternal.SetSize(GetBorderWindowBottomLayer().SwigCPtr, resizeWidth, resizeHeight);
else
{
Interop.ActorInternal.SetSize(GetBorderWindowRootLayer().SwigCPtr, resizeWidth, resizeHeight);
- Interop.ActorInternal.SetSize(GetBorderWindowBottomLayer().SwigCPtr, resizeWidth + borderInterface.GetBorderLineThickness() * 2, resizeHeight+borderInterface.GetBorderHeight() + borderInterface.GetBorderLineThickness());
+ Interop.ActorInternal.SetSize(GetBorderWindowBottomLayer().SwigCPtr, resizeWidth + borderInterface.BorderLineThickness * 2, resizeHeight+borderInterface.BorderHeight + borderInterface.BorderLineThickness);
OverlayMode(false);
}
Interop.ActorInternal.SetParentOrigin(borderWindowBottomLayer.SwigCPtr, Tizen.NUI.ParentOrigin.TopCenter.SwigCPtr);
Interop.Actor.SetAnchorPoint(borderWindowBottomLayer.SwigCPtr, Tizen.NUI.PivotPoint.TopCenter.SwigCPtr);
Interop.Actor.Add(rootLayer.SwigCPtr, borderWindowBottomLayer.SwigCPtr);
- Interop.ActorInternal.SetSize(borderWindowBottomLayer.SwigCPtr, WindowSize.Width+borderInterface.GetBorderLineThickness()*2, WindowSize.Height+borderInterface.GetBorderLineThickness());
+ Interop.ActorInternal.SetSize(borderWindowBottomLayer.SwigCPtr, WindowSize.Width+borderInterface.BorderLineThickness * 2, WindowSize.Height + borderInterface.BorderLineThickness);
borderWindowBottomLayer.SetWindow(this);
borderWindowBottomLayer.LowerToBottom();
Interop.ActorInternal.SetParentOrigin(borderWindowRootLayer.SwigCPtr, Tizen.NUI.ParentOrigin.TopCenter.SwigCPtr);
Interop.Actor.SetAnchorPoint(borderWindowRootLayer.SwigCPtr, Tizen.NUI.PivotPoint.TopCenter.SwigCPtr);
Interop.Actor.Add(rootLayer.SwigCPtr, borderWindowRootLayer.SwigCPtr);
- Interop.ActorInternal.SetSize(borderWindowRootLayer.SwigCPtr, WindowSize.Width, WindowSize.Height-borderInterface.GetBorderHeight()-borderInterface.GetBorderLineThickness());
- Interop.ActorInternal.SetPosition(borderWindowRootLayer.SwigCPtr, 0, borderInterface.GetBorderLineThickness());
+ Interop.ActorInternal.SetSize(borderWindowRootLayer.SwigCPtr, WindowSize.Width, WindowSize.Height-borderInterface.BorderHeight - borderInterface.BorderLineThickness);
+ Interop.ActorInternal.SetPosition(borderWindowRootLayer.SwigCPtr, 0, borderInterface.BorderLineThickness);
Tizen.NUI.Object.SetProperty(borderWindowRootLayer.SwigCPtr, Tizen.NUI.BaseComponents.View.Property.ClippingMode, new Tizen.NUI.PropertyValue((int)Tizen.NUI.ClippingModeType.ClipToBoundingBox));
if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); }
internal void DisposeBorder()
{
Resized -= OnBorderWindowResized;
- if (borderInterface.IsOverlayMode() == true && rootView != null)
+ if (borderInterface.OverlayMode == true && rootView != null)
{
rootView.InterceptTouchEvent -= OverlayInterceptTouch;
}
{
if (isBorderWindow == true)
{
- var height = (ushort)(size.GetHeight() + borderInterface.GetBorderHeight()+borderInterface.GetBorderLineThickness());
- var width = (ushort)(size.GetWidth() + borderInterface.GetBorderLineThickness()*2);
+ var height = (ushort)(size.GetHeight() + borderInterface.BorderHeight + borderInterface.BorderLineThickness);
+ var width = (ushort)(size.GetWidth() + borderInterface.BorderLineThickness * 2);
size.SetHeight(height);
size.SetWidth(width);
}
private void convertRealWindowSizeToBorderWindowSize(Uint16Pair size)
{
- if (isBorderWindow == true && !(borderInterface.IsOverlayMode() == true && IsMaximized() == true))
+ if (isBorderWindow == true && !(borderInterface.OverlayMode == true && IsMaximized() == true))
{
- var height = (ushort)(size.GetHeight() - borderInterface.GetBorderHeight()-borderInterface.GetBorderLineThickness());
- var width = (ushort)(size.GetWidth() - borderInterface.GetBorderLineThickness()*2);
+ var height = (ushort)(size.GetHeight() - borderInterface.BorderHeight - borderInterface.BorderLineThickness);
+ var width = (ushort)(size.GetWidth() - borderInterface.BorderLineThickness * 2);
size.SetHeight(height);
size.SetWidth(width);
}
#region Fields
private Color backgroundColor;
private View rootView;
- private Window window = null;
private ImageView minimalizeIcon;
private ImageView maximalizeIcon;
#region Methods
/// <summary>
- /// Sets the window which the border is enabled.
+ /// The thickness of the border.
/// </summary>
- /// <param name="window">The window in which the border is enabled.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
- public virtual void SetWindow(Window window)
- {
- this.window = window;
- }
+ public uint BorderLineThickness {get; set;}
+
+ /// <summary>
+ /// The thickness of the border's touch area.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public uint TouchThickness {get; set;}
+
+ /// <summary>
+ /// The height of the border.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public uint BorderHeight {get; set;}
+
+ /// <summary>
+ /// The minimum size by which the window will small.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Size2D MinSize {get; set;}
+
+ /// <summary>
+ /// The maximum size by which the window will big.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Size2D MaxSize {get; set;}
/// <summary>
- /// Returns the window which borders is enabled.
+ /// The window with borders added.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public virtual Window GetWindow()
+ public Window BorderWindow {get; set;}
+
+ /// <summary>
+ /// Whether overlay mode.
+ /// If overlay mode is true, the border area is hidden when the window is maximized.
+ /// And if you touched at screen, the border area is shown on the screen.
+ /// Default value is false;
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool OverlayMode {get; set;}
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public DefaultBorder()
{
- return window;
+ BorderLineThickness = DefaultLineThickness;
+ TouchThickness = DefaultTouchThickness;
+ BorderHeight = DefaultHeight;
+ MinSize = DefaultMinSize;
+ OverlayMode = false;
}
+
/// <summary>
/// Create border UI. Users can override this method to draw border UI.
/// </summary>
{
if (preScale > e.PinchGesture.Scale)
{
- if (window.IsMaximized())
+ if (BorderWindow.IsMaximized())
{
- window.Maximize(false);
+ BorderWindow.Maximize(false);
}
else
{
- window.Minimize(true);
+ BorderWindow.Minimize(true);
}
}
else
{
- window.Maximize(true);
+ BorderWindow.Maximize(true);
}
}
}
if (panGesture.State == Gesture.StateType.Started)
{
- direction = window.GetDirection(panGesture.Position.X, panGesture.Position.Y);
+ direction = BorderWindow.GetDirection(panGesture.Position.X, panGesture.Position.Y);
if (direction == Window.BorderDirection.Move)
{
- if (window.IsMaximized() == true)
+ if (BorderWindow.IsMaximized() == true)
{
- window.Maximize(false);
+ BorderWindow.Maximize(false);
}
else
{
- window.RequestMoveToServer();
+ BorderWindow.RequestMoveToServer();
}
}
else if (direction != Window.BorderDirection.None)
{
- window.RequestResizeToServer((Window.ResizeDirection)direction);
+ BorderWindow.RequestResizeToServer((Window.ResizeDirection)direction);
}
}
else if (panGesture.State == Gesture.StateType.Continuing)
{
if (direction == Window.BorderDirection.BottomLeft || direction == Window.BorderDirection.BottomRight || direction == Window.BorderDirection.TopLeft || direction == Window.BorderDirection.TopRight)
{
- window.WindowSize += new Size2D((int)panGesture.ScreenDisplacement.X, (int)panGesture.ScreenDisplacement.Y);
+ BorderWindow.WindowSize += new Size2D((int)panGesture.ScreenDisplacement.X, (int)panGesture.ScreenDisplacement.Y);
}
else if (direction == Window.BorderDirection.Left || direction == Window.BorderDirection.Right)
{
- window.WindowSize += new Size2D((int)panGesture.ScreenDisplacement.X, 0);
+ BorderWindow.WindowSize += new Size2D((int)panGesture.ScreenDisplacement.X, 0);
}
else if (direction == Window.BorderDirection.Bottom || direction == Window.BorderDirection.Top)
{
- window.WindowSize += new Size2D(0, (int)panGesture.ScreenDisplacement.Y);
+ BorderWindow.WindowSize += new Size2D(0, (int)panGesture.ScreenDisplacement.Y);
}
else if (direction == Window.BorderDirection.Move)
{
- window.WindowPosition += new Position2D((int)panGesture.ScreenDisplacement.X, (int)panGesture.ScreenDisplacement.Y);
+ BorderWindow.WindowPosition += new Position2D((int)panGesture.ScreenDisplacement.X, (int)panGesture.ScreenDisplacement.Y);
}
}
else if (panGesture.State == Gesture.StateType.Finished || panGesture.State == Gesture.StateType.Cancelled)
if (e.Touch.GetState(0) == PointStateType.Down)
{
ClearWindowGesture();
- if(window.IsMinimized() == true)
+ if (BorderWindow.IsMinimized() == true)
{
- window.RequestResizeToServer(Window.ResizeDirection.TopLeft);
+ BorderWindow.RequestResizeToServer(Window.ResizeDirection.TopLeft);
}
else
{
- window.RequestResizeToServer(Window.ResizeDirection.BottomLeft);
+ BorderWindow.RequestResizeToServer(Window.ResizeDirection.BottomLeft);
}
}
return true;
if (e.Touch.GetState(0) == PointStateType.Down)
{
ClearWindowGesture();
- if(window.IsMinimized() == true)
+ if (BorderWindow.IsMinimized() == true)
{
- window.RequestResizeToServer(Window.ResizeDirection.TopRight);
+ BorderWindow.RequestResizeToServer(Window.ResizeDirection.TopRight);
}
else
{
- window.RequestResizeToServer(Window.ResizeDirection.BottomRight);
+ BorderWindow.RequestResizeToServer(Window.ResizeDirection.BottomRight);
}
}
return true;
if (e.Touch.GetState(0) == PointStateType.Up)
{
ClearWindowGesture();
- window.Minimize(true);
+ BorderWindow.Minimize(true);
}
return true;
}
if (e.Touch.GetState(0) == PointStateType.Up)
{
ClearWindowGesture();
- if (window.IsMaximized())
+ if (BorderWindow.IsMaximized())
{
- window.Maximize(false);
+ BorderWindow.Maximize(false);
}
else
{
- window.Maximize(true);
+ BorderWindow.Maximize(true);
}
}
return true;
{
if (e.Touch.GetState(0) == PointStateType.Up)
{
- window.Destroy();
- window = null;
+ BorderWindow.Destroy();
+ BorderWindow = null;
}
return true;
}
private void UpdateIcons()
{
- if (window != null && rootView != null)
+ if (BorderWindow != null && rootView != null)
{
- if (window.IsMaximized() == true)
+ if (BorderWindow.IsMaximized() == true)
{
if (maximalizeIcon != null)
{
}
rootView.CornerRadius = new Vector4(0, 0, 0, 0);
rootView.CornerRadiusPolicy = VisualTransformPolicyType.Relative;
- window.SetTransparency(false);
+ BorderWindow.SetTransparency(false);
}
else
{
}
rootView.CornerRadius = new Vector4(0.03f, 0.03f, 0.03f, 0.03f);
rootView.CornerRadiusPolicy = VisualTransformPolicyType.Relative;
- window.SetTransparency(true);
+ BorderWindow.SetTransparency(true);
}
}
}
private void AddInterceptGesture()
{
isWinGestures = false;
- window.InterceptTouchEvent += OnWinInterceptedTouch;
+ BorderWindow.InterceptTouchEvent += OnWinInterceptedTouch;
}
// Intercept touch on window.
{
return true;
};
- window.Add(windowView);
+ BorderWindow.Add(windowView);
winTapGestureDetector = new TapGestureDetector();
winTapGestureDetector.Attach(windowView);
winPanGestureDetector.Attach(windowView);
winPanGestureDetector.Detected += OnWinPanGestureDetected;
- window.InterceptTouchEvent -= OnWinInterceptedTouch;
+ BorderWindow.InterceptTouchEvent -= OnWinInterceptedTouch;
isWinGestures = true;
return false;
}
currentGesture = CurrentGesture.TapGesture;
if (e.TapGesture.NumberOfTaps == 2)
{
- if (window.IsMaximized() == false)
+ if (BorderWindow.IsMaximized() == false)
{
- window.Maximize(true);
+ BorderWindow.Maximize(true);
}
else
{
- window.Maximize(false);
+ BorderWindow.Maximize(false);
}
}
else
if (panGesture.State == Gesture.StateType.Started)
{
currentGesture = CurrentGesture.PanGesture;
- if (window.IsMaximized() == true)
+ if (BorderWindow.IsMaximized() == true)
{
- window.Maximize(false);
+ BorderWindow.Maximize(false);
}
else
{
- window.RequestMoveToServer();
+ BorderWindow.RequestMoveToServer();
}
}
else if (panGesture.State == Gesture.StateType.Finished || panGesture.State == Gesture.StateType.Cancelled)
winTapGestureDetector.Dispose();
isWinGestures = false;
- window.Remove(windowView);
- window.InterceptTouchEvent += OnWinInterceptedTouch;
+ BorderWindow.Remove(windowView);
+ BorderWindow.InterceptTouchEvent += OnWinInterceptedTouch;
}
}
}
/// <summary>
- /// Returns the thickness of the border.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public virtual uint GetBorderLineThickness()
- {
- return DefaultLineThickness;
- }
-
- /// <summary>
- /// Returns the thickness of the border's touch area.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public virtual uint GetTouchThickness()
- {
- return DefaultTouchThickness;
- }
-
- /// <summary>
- /// Returns the height of the border.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public virtual uint GetBorderHeight()
- {
- return DefaultHeight;
- }
-
- /// <summary>
- /// Returns the minimum size by which the window will small.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public virtual Size2D GetMinSize()
- {
- return DefaultMinSize;
- }
-
- /// <summary>
- /// Returns the maximum size by which the window will big.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public virtual Size2D GetMaxSize()
- {
- return null;
- }
-
- /// <summary>
- /// Returns whether overlay mode is present.
- /// If overlay mode is true, the border area is hidden when the window is maximized.
- /// And if you touched at screen, the border area is shown on the screen.
- /// Default value is false;
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public virtual bool IsOverlayMode()
- {
- return false;
- }
-
- /// <summary>
/// Dispose
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual void Dispose()
{
ClearWindowGesture();
- window.InterceptTouchEvent -= OnWinInterceptedTouch;
+ BorderWindow.InterceptTouchEvent -= OnWinInterceptedTouch;
borderPanGestureDetector.Dispose();
borderPinchGestureDetector.Dispose();
if (windowView != null)
public interface IBorderInterface
{
/// <summary>
- /// Create border UI. User can override this method to draw border UI.
+ /// The thickness of the border.
/// </summary>
- /// <param name="rootView">The root view on which the border.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
- public void CreateBorderView(View rootView);
-
+ public uint BorderLineThickness {get;}
/// <summary>
- /// Called after the border UI is created.
+ /// The thickness of the border's touch area.
/// </summary>
- /// <param name="rootView">The root view on which the border.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
- public void OnCreated(View rootView);
+ public uint TouchThickness {get;}
/// <summary>
- /// Called when the window is resized.
+ /// The height of the border.
/// </summary>
- /// <param name="width">The width of the resized window</param>
- /// <param name="height">The height of the resized window</param>
[EditorBrowsable(EditorBrowsableState.Never)]
- public void OnResized(int width, int height);
+ public uint BorderHeight {get;}
/// <summary>
- /// Returns the thickness of the border.
+ /// The minimum size by which the window will small.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public uint GetBorderLineThickness();
+ public Size2D MinSize {get;}
/// <summary>
- /// Returns the thickness of the border's touch area.
+ /// The maximum size by which the window will big.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public uint GetTouchThickness();
+ public Size2D MaxSize {get;}
/// <summary>
- /// Returns the height of the border.
+ /// The window with borders added.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public uint GetBorderHeight();
+ public Window BorderWindow {get; set;}
/// <summary>
- /// Returns the minimum size by which the window will small.
+ /// Whether overlay mode.
+ /// If overlay mode is true, the border area is hidden when the window is maximized.
+ /// And if you touched at screen, the border area is shown on the screen.
+ /// Default value is false;
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public Size2D GetMinSize();
+ public bool OverlayMode {get;}
- /// <summary>
- /// Returns the maximum size by which the window will big.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Size2D GetMaxSize();
/// <summary>
- /// Sets The window to which the border is added.
+ /// Create border UI. User can override this method to draw border UI.
/// </summary>
+ /// <param name="rootView">The root view on which the border.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
- public void SetWindow(Window window);
+ public void CreateBorderView(View rootView);
/// <summary>
- /// Returns the window with borders added.
+ /// Called after the border UI is created.
/// </summary>
+ /// <param name="rootView">The root view on which the border.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
- public Window GetWindow();
+ public void OnCreated(View rootView);
/// <summary>
- /// Returns whether overlay mode is present.
- /// If overlay mode is true, the border area is hidden when the window is maximized.
- /// And if you touched at screen, the border area is shown on the screen.
- /// Default value is false;
+ /// Called when the window is resized.
/// </summary>
+ /// <param name="width">The width of the resized window</param>
+ /// <param name="height">The height of the resized window</param>
[EditorBrowsable(EditorBrowsableState.Never)]
- public bool IsOverlayMode();
+ public void OnResized(int width, int height);
/// <summary>
/// Dispose
public CustomBorder() : base()
{
+ BorderHeight = 60;
}
-
public override void CreateBorderView(View rootView)
{
this.rootView = rootView;
- // rootView.BackgroundColor = new Color(1, 1, 1, 0.3f);
rootView.CornerRadius = new Vector4(0.03f, 0.03f, 0.03f, 0.03f);
rootView.CornerRadiusPolicy = VisualTransformPolicyType.Relative;
}
}
- public override uint GetBorderLineThickness()
- {
- return base.GetBorderLineThickness();
- }
-
- public override uint GetTouchThickness()
- {
- return base.GetTouchThickness();
- }
-
- public override uint GetBorderHeight()
- {
- return base.GetBorderHeight();
- }
-
- public override Size2D GetMinSize()
- {
- return base.GetMinSize();
- }
-
- public override Size2D GetMaxSize()
- {
- return base.GetMaxSize();
- }
-
- public override void SetWindow(Window window)
- {
- base.SetWindow(window);
- }
-
- public override Window GetWindow()
- {
- return base.GetWindow();
- }
-
public override void Dispose()
{
base.Dispose();
}
- public override bool IsOverlayMode()
- {
- return true;
- }
-
-
}
void CreateSubWindowOne()