Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        public override void InitWindow()
        {
            SetParameters("Mainwindow", "RadialMenu Example C#", 800, 600, false);
            SetMinSize(300, 300);
            SetBackground(StyleFactory.CommonBackground);
            SetPadding(0, 0, 0, 0);
            SetAntiAliasingQuality(MSAA.MSAA8x);
            IsCentered = true;

            // title
            TitleBar title = new TitleBar(GetWindowTitle());

            // radial menu
            RadialMenu = new RadialMenuItem(this);

            // contact menu
            Menu = new ContactMenu(this, RadialMenu);

            ShowContactsBtn = new ButtonCore("Show");
            ShowContactsBtn.SetStyle(StyleFactory.GetRoundedButtonStyle());

            // adding
            AddItems(title, ShowContactsBtn);
        }