Beispiel #1
0
        public bool Equals(ToggleButtonsThemeData other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(textStyle.Equals(other.textStyle) &&
                   constraints.Equals(other.constraints) &&
                   color.Equals(other.color) &&
                   selectedColor.Equals(other.selectedColor) &&
                   disabledColor.Equals(other.disabledColor) &&
                   fillColor.Equals(other.fillColor) &&
                   focusColor.Equals(other.focusColor) &&
                   highlightColor.Equals(other.highlightColor) &&
                   hoverColor.Equals(other.hoverColor) &&
                   splashColor.Equals(other.splashColor) &&
                   borderColor.Equals(other.borderColor) &&
                   selectedBorderColor.Equals(other.selectedBorderColor) &&
                   disabledBorderColor.Equals(other.disabledBorderColor) &&
                   borderRadius.Equals(other.borderRadius) &&
                   borderWidth.Equals(other.borderWidth));
        }
Beispiel #2
0
        private BorderRadius CalculateActualRadius()
        {
            if (BorderRadius.Equals(BorderRadius.None))
            {
                return(BorderRadius);
            }

            var maxRadius = Math.Min(BorderLayout.Width, BorderLayout.Height) * 0.5f;

            var tl = Math.Min(BorderRadius.TopLeft, maxRadius);
            var tr = Math.Min(BorderRadius.TopRight, maxRadius);
            var bl = Math.Min(BorderRadius.BottomLeft, maxRadius);
            var br = Math.Min(BorderRadius.BottomRight, maxRadius);

            return(new BorderRadius(tl, tr, br, bl));
        }