예제 #1
0
        public void SetupAdvancedCategory(string cat)
        {
            flapps.Controls.Clear();

            foreach (var app in LauncherItemList[cat])
            {
                var catbtn = new Button();
                catbtn.Font      = LoadedSkin.AdvALItemFont;
                catbtn.FlatStyle = FlatStyle.Flat;
                catbtn.FlatAppearance.BorderSize         = 0;
                catbtn.FlatAppearance.MouseOverBackColor = LoadedSkin.Menu_MenuItemSelected;
                catbtn.FlatAppearance.MouseDownBackColor = LoadedSkin.Menu_MenuItemPressedGradientBegin;
                catbtn.BackColor   = LoadedSkin.Menu_ToolStripDropDownBackground;
                catbtn.ForeColor   = LoadedSkin.Menu_TextColor;
                catbtn.MouseEnter += (o, a) =>
                {
                    catbtn.ForeColor = LoadedSkin.Menu_SelectedTextColor;
                };
                catbtn.MouseLeave += (o, a) =>
                {
                    catbtn.ForeColor = LoadedSkin.Menu_TextColor;
                };
                catbtn.TextAlign  = ContentAlignment.MiddleLeft;
                catbtn.Text       = (app is LuaLauncherItem) ? app.DisplayData.Name : NameChangerBackend.GetNameRaw(app.LaunchType);
                catbtn.Width      = flapps.Width;
                catbtn.ImageAlign = ContentAlignment.MiddleRight;
                catbtn.Height     = 24;
                catbtn.Image      = (app.LaunchType == null) ? null : SkinEngine.GetIcon(app.LaunchType.Name);

                flapps.Controls.Add(catbtn);
                catbtn.Show();
                catbtn.Click += (o, a) =>
                {
                    pnladvancedal.Hide();
                    if (app is LuaLauncherItem)
                    {
                        var interp = new LuaInterpreter();
                        interp.ExecuteFile((app as LuaLauncherItem).LaunchPath);
                    }
                    else
                    {
                        IShiftOSWindow win = Activator.CreateInstance(app.LaunchType) as IShiftOSWindow;
                        AppearanceManager.SetupWindow(win);
                    }
                };
            }
        }