Пример #1
0
        public static Style GetRadialMenuDefaultStyle()
        {
            Style style = Style.GetDefaultCommonStyle();

            style.SetSizePolicy(SizePolicy.Expand, SizePolicy.Expand);
            style.SetBackground(0, 0, 0, 120);
            style.IsVisible = false;

            Style hideStyle = Style.GetButtonCoreStyle();

            hideStyle.SetPadding(15, 20, 15, 5);
            hideStyle.SetBackground(150, 150, 150);
            hideStyle.SetSize(60, 60);
            hideStyle.SetBorder(new Border(Color.Transparent, new CornerRadius(30), 0));
            hideStyle.SetShadow(new Shadow(5, 3, 3, Color.Black));
            hideStyle.IsShadowDrop = true;
            style.AddInnerStyle("hidebutton", hideStyle);

            Style addStyle = Style.GetButtonCoreStyle();

            addStyle.Font = DefaultsService.GetDefaultFont(FontStyle.Bold, 12);
            addStyle.SetBackground(100, 200, 130);
            addStyle.SetSize(50, 30);
            addStyle.SetBorder(new Border(Color.Transparent, new CornerRadius(15), 0));
            addStyle.SetShadow(new Shadow(5, 3, 3, Color.Black));
            addStyle.IsShadowDrop = true;
            ItemState hover = new ItemState(Color.FromArgb(30, 255, 255, 255));

            hover.Border = new Border(Color.White, new CornerRadius(15), 2);
            addStyle.AddItemState(ItemStateType.Hovered, hover);
            style.AddInnerStyle("addbutton", addStyle);

            return(style);
        }
Пример #2
0
        public static Style GetContactStyle()
        {
            Style style = Style.GetDefaultCommonStyle();

            style.SetSizePolicy(SizePolicy.Fixed, SizePolicy.Fixed);
            style.Background = Color.Transparent;

            Style layout = Style.GetVerticalStackStyle();

            layout.SetSpacing(0, 5);
            style.AddInnerStyle("layout", layout);

            Style face = StyleFactory.GetContactFaceStyle();

            style.AddInnerStyle("face", face);

            Style name = Style.GetLabelStyle();

            name.Font       = DefaultsService.GetDefaultFont(12);
            name.Background = StyleFactory.ContactBackground;
            name.SetSizePolicy(SizePolicy.Fixed, SizePolicy.Fixed);
            name.SetSize(26, 26);
            name.BorderRadius = new CornerRadius(name.Width / 2);
            name.SetAlignment(ItemAlignment.HCenter);
            name.SetTextAlignment(ItemAlignment.HCenter, ItemAlignment.VCenter);
            name.SetShadow(new Shadow(5, 0, 0, Color.Black));
            name.IsShadowDrop = true;
            style.AddInnerStyle("name", name);

            Style notification = Style.GetLabelStyle();

            notification.SetSizePolicy(SizePolicy.Fixed, SizePolicy.Fixed);
            notification.SetTextAlignment(ItemAlignment.HCenter, ItemAlignment.VCenter);
            notification.SetAlignment(ItemAlignment.Right, ItemAlignment.Top);
            notification.SetSize(20, 20);
            notification.SetBorder(new Border(Color.White, new CornerRadius(10), 1));
            notification.Background = StyleFactory.ContactBackground;
            notification.Font       = DefaultsService.GetDefaultFont(FontStyle.Bold, 12);
            style.AddInnerStyle("notification", notification);

            return(style);
        }
Пример #3
0
        public static Style GetPictureStyle()
        {
            // style for Picture
            Style style = new Style();

            style.SetSizePolicy(SizePolicy.Expand, SizePolicy.Expand);
            style.SetSpacing(0, 5);
            style.SetMargin(3, 3, 3, 3);
            style.SetPadding(5, 5, 5, 5);
            style.SetAlignment(ItemAlignment.Left, ItemAlignment.Top);
            style.SetBackground(80, 80, 80);
            style.SetShadow(new Shadow(5, 0, 0, Color.FromArgb(200, 0, 0, 0)));
            style.IsShadowDrop = true;
            style.SetBorder(Color.Gray, new CornerRadius(10), 1);

            // inner stylesExpand: Picture consist of ImageItem and Label
            // stylHCentere for ImageItemVCenter
            Style imageStyle = new Style();

            imageStyle.SetSizePolicy(SizePolicy.Expand, SizePolicy.Expand);
            imageStyle.SetAlignment(ItemAlignment.HCenter, ItemAlignment.VCenter);
            imageStyle.SetBackground(45, 45, 45);
            imageStyle.BorderRadius = new CornerRadius(6, 6, 0, 0);
            style.AddInnerStyle("image", imageStyle);
            // style for Label
            Style textStyle = new Style();

            textStyle.SetSizePolicy(SizePolicy.Expand, SizePolicy.Fixed);
            textStyle.Height = 30;
            textStyle.SetTextAlignment(ItemAlignment.HCenter, ItemAlignment.VCenter);
            // textStyle.SetAlignment(ItemAlignment.LEFT, ItemAlignment.BOTTOM);
            textStyle.SetBackground(150, 150, 150);
            textStyle.SetForeground(32, 32, 32);
            textStyle.BorderRadius = new CornerRadius(0, 0, 6, 6);
            style.AddInnerStyle("text", textStyle);
            return(style);
        }
Пример #4
0
        public static Style GetManualKeyBinderStyle()
        {
            Style style = new Style();

            style.SetAlignment(ItemAlignment.HCenter, ItemAlignment.VCenter);
            style.SetSizePolicy(SizePolicy.Expand, SizePolicy.Expand);
            style.SetBackground(0, 0, 0, 150);
            style.BorderRadius = new CornerRadius();
            style.Padding      = new Indents();
            style.Margin       = new Indents();
            style.Spacing      = new Spacing();

            Style windowStyle = Style.GetFrameStyle();

            windowStyle.SetAlignment(ItemAlignment.HCenter, ItemAlignment.VCenter);
            windowStyle.SetPadding(0, 0, 0, 0);
            windowStyle.SetMargin(100, 150, 100, 150);
            windowStyle.SetBackground(45, 45, 45);
            windowStyle.SetShadow(new Shadow(10, 0, 0, Color.Black));
            windowStyle.IsShadowDrop = true;
            style.AddInnerStyle("window", windowStyle);

            Style closeStyle = new Style();

            closeStyle.Background = Color.FromArgb(255, 100, 100, 100);
            closeStyle.SetSize(20, 20);
            closeStyle.SetSizePolicy(SizePolicy.Fixed, SizePolicy.Fixed);
            closeStyle.Alignment = ItemAlignment.Top | ItemAlignment.Right;
            closeStyle.SetMargin(0, 10, 10, 0);
            closeStyle.AddItemState(ItemStateType.Hovered, new ItemState(Color.FromArgb(186, 95, 97)));
            closeStyle.Shape        = GraphicsMathService.GetCross(20, 20, 3, 45);
            closeStyle.IsFixedShape = true;
            style.AddInnerStyle("closebutton", closeStyle);

            return(style);
        }
Пример #5
0
        internal static Style GetComboBoxStyle()
        {
            // Get current style of an item and change it
            Style style = Style.GetComboBoxStyle();

            style.SetBackground(45, 45, 45);
            style.SetForeground(210, 210, 210);
            style.SetBorder(new Border(Color.FromArgb(255, 255, 181, 111), new CornerRadius(10, 0, 0, 10), 2));
            style.SetShadow(new Shadow(10, 3, 3, Color.FromArgb(150, 0, 0, 0)));
            style.IsShadowDrop = true;

            // Note: every complex item has a few inner styles for its children
            // for example ComboBox has drop down area, selection item, drob down button (with arrow)
            // Replace inner style
            style.RemoveInnerStyle("dropdownarea");
            Style dropDownAreaStyle = GetComboBoxDropDownStyle(); // Get our own style

            style.AddInnerStyle("dropdownarea", dropDownAreaStyle);

            // Change inner style
            Style selectionStyle = style.GetInnerStyle("selection");

            if (selectionStyle != null)
            {
                selectionStyle.BorderRadius = new CornerRadius(10, 0, 0, 10);
                selectionStyle.SetBackground(0, 0, 0, 0);
                selectionStyle.SetPadding(25, 0, 0, 0);
                selectionStyle.AddItemState(ItemStateType.Hovered, new ItemState(Color.FromArgb(20, 255, 255, 255)));
            }

            // Change inner style
            Style dropDownButtonStyle = style.GetInnerStyle("dropdownbutton");

            if (dropDownButtonStyle != null)
            {
                dropDownButtonStyle.BorderRadius = new CornerRadius(0, 0, 0, 10);
            }

            return(style);
        }
Пример #6
0
        internal static Style GetTitleBarStyle()
        {
            Style style = new Style();

            style.Font          = new Font(DefaultsService.GetDefaultFont().FontFamily, 14, FontStyle.Bold);
            style.Background    = Color.FromArgb(255, 32, 34, 37);
            style.Foreground    = Color.FromArgb(255, 166, 167, 168);
            style.Height        = 22;
            style.WidthPolicy   = SizePolicy.Expand;
            style.HeightPolicy  = SizePolicy.Fixed;
            style.Alignment     = ItemAlignment.Left | ItemAlignment.Top;
            style.TextAlignment = ItemAlignment.Left | ItemAlignment.VCenter;
            style.Padding       = new Indents(5, 4, 10, 0);
            style.Spacing       = new Spacing(10);

            Style close_style = new Style();

            close_style.Background = Color.FromArgb(255, 166, 167, 168);
            close_style.SetSize(10, 10);
            close_style.SetSizePolicy(SizePolicy.Fixed, SizePolicy.Fixed);
            close_style.Alignment = ItemAlignment.VCenter | ItemAlignment.Right;
            close_style.AddItemState(ItemStateType.Hovered, new ItemState()
            {
                Background = Color.FromArgb(255, 186, 95, 97)
            });
            close_style.Shape = GraphicsMathService.GetCross(15, 15, 1, 45);
            style.AddInnerStyle("closebutton", close_style);

            Style minimize_style = new Style();

            minimize_style.Background = Color.FromArgb(255, 166, 167, 168);
            minimize_style.SetSize(10, 10);
            minimize_style.SetSizePolicy(SizePolicy.Fixed, SizePolicy.Fixed);
            minimize_style.Alignment = ItemAlignment.VCenter | ItemAlignment.Right;
            minimize_style.AddItemState(ItemStateType.Hovered, new ItemState()
            {
                Background = Color.FromArgb(80, 255, 255, 255)
            });
            minimize_style.Shape        = GraphicsMathService.GetRectangle(10, 1, 0, 5);
            minimize_style.IsFixedShape = true;
            style.AddInnerStyle("minimizebutton", minimize_style);

            Style maximize_style = new Style();

            maximize_style.SetSize(10, 10);
            maximize_style.SetSizePolicy(SizePolicy.Fixed, SizePolicy.Fixed);
            maximize_style.BorderThickness = 1;
            maximize_style.BorderFill      = Color.FromArgb(255, 166, 167, 168);
            maximize_style.Alignment       = ItemAlignment.VCenter | ItemAlignment.Right;
            maximize_style.Padding         = new Indents(2, 2, 2, 2);

            ItemState hovered = new ItemState();

            hovered.Border.SetFill(Color.FromArgb(255, 84, 124, 94));
            maximize_style.AddItemState(ItemStateType.Hovered, hovered);
            maximize_style.Shape = GraphicsMathService.GetRectangle();
            style.AddInnerStyle("maximizebutton", maximize_style);

            Style title_style = new Style();

            title_style.Margin = new Indents(10, 0, 0, 0);
            style.AddInnerStyle("title", title_style);

            return(style);
        }