Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// <summary>
- /// Reset hover state of the element
- /// </summary>
- public override void ResetHover()
- {
- listView.style.borderBottomWidth = new StyleFloat(0.0f);
- listView.style.borderTopWidth = new StyleFloat(0.0f);
- listView.style.borderLeftWidth = new StyleFloat(0.0f);
- listView.style.borderRightWidth = new StyleFloat(0.0f);
- }
- /// <summary>
- /// Set hover state on specific anchor of the element (should update style/border)
- /// </summary>
- /// <param name="anchor">Which anchor is hovered?</param>
- public override void SetAnchorHover(ResizableAnchor anchor)
- {
- switch (anchor)
- {
- case ResizableAnchor.Left:
- listView.style.borderLeftColor = new Color(0.0f, 0.0f, 0.0f, 1.0f);
- listView.style.borderLeftWidth = new StyleFloat(2.0f);
- break;
- case ResizableAnchor.Right:
- listView.style.borderRightColor = new Color(0.0f, 0.0f, 0.0f, 1.0f);
- listView.style.borderRightWidth = new StyleFloat(2.0f);
- break;
- case ResizableAnchor.Bottom:
- listView.style.borderBottomColor = new Color(0.0f, 0.0f, 0.0f, 1.0f);
- listView.style.borderBottomWidth = new StyleFloat(2.0f);
- break;
- case ResizableAnchor.Top:
- listView.style.borderTopColor = new Color(0.0f, 0.0f, 0.0f, 1.0f);
- listView.style.borderTopWidth = new StyleFloat(2.0f);
- break;
- }
- }
- /// <summary>
- /// Set active state on specific anchor of the element (should update style/border)
- /// </summary>
- /// <param name="anchor">Which anchor is active?</param>
- public override void SetAnchorActive(ResizableAnchor anchor)
- {
- switch (anchor)
- {
- case ResizableAnchor.Left:
- listView.style.borderLeftColor = new Color(1.0f, 0.0f, 0.0f, 1.0f);
- listView.style.borderLeftWidth = new StyleFloat(2.0f);
- break;
- case ResizableAnchor.Right:
- listView.style.borderRightColor = new Color(1.0f, 0.0f, 0.0f, 1.0f);
- listView.style.borderRightWidth = new StyleFloat(2.0f);
- break;
- case ResizableAnchor.Bottom:
- listView.style.borderBottomColor = new Color(1.0f, 0.0f, 0.0f, 1.0f);
- listView.style.borderBottomWidth = new StyleFloat(2.0f);
- break;
- case ResizableAnchor.Top:
- listView.style.borderTopColor = new Color(1.0f, 0.0f, 0.0f, 1.0f);
- listView.style.borderTopWidth = new StyleFloat(2.0f);
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement