/// <summary> /// Setup this instance. /// </summary> public void Setup() { this.lbtitletext.Text = NameChangerBackend.GetName(ParentWindow); if (SaveSystem.CurrentSave != null) { this.pnltitle.Visible = Shiftorium.UpgradeInstalled("wm_titlebar"); this.pnlclose.Visible = Shiftorium.UpgradeInstalled("close_button"); this.pnlminimize.Visible = (IsDialog == false) && Shiftorium.UpgradeInstalled("minimize_button"); this.pnlmaximize.Visible = (IsDialog == false) && Shiftorium.UpgradeInstalled("maximize_button"); SetupSkin(); } else { this.pnltitle.Visible = false; this.pnlclose.Visible = false; this.pnlminimize.Visible = false; this.pnlmaximize.Visible = false; } }
/// <summary> /// Populates the panel buttons. /// </summary> /// <returns>The panel buttons.</returns> public void PopulatePanelButtons() { if (DesktopFunctions.ShowDefaultElements == true) { panelbuttonholder.Controls.Clear(); if (Shiftorium.IsInitiated == true) { if (Shiftorium.UpgradeInstalled("wm_panel_buttons")) { foreach (WindowBorder form in Engine.AppearanceManager.OpenForms) { if (form != null) { if (form.Visible == true) { EventHandler onClick = (o, a) => { if (form == focused) { if (form.IsMinimized) { RestoreWindow(form); } else { MinimizeWindow(form); } } else { form.BringToFront(); focused = form; } HideAppLauncher(); }; var pnlbtn = new Panel(); pnlbtn.Margin = new Padding(2, LoadedSkin.PanelButtonFromTop, 0, 0); pnlbtn.BackColor = LoadedSkin.PanelButtonColor; pnlbtn.BackgroundImage = GetImage("panelbutton"); pnlbtn.BackgroundImageLayout = GetImageLayout("panelbutton"); var pnlbtntext = new Label(); pnlbtntext.Text = NameChangerBackend.GetName(form.ParentWindow); pnlbtntext.AutoSize = true; pnlbtntext.Location = LoadedSkin.PanelButtonFromLeft; pnlbtntext.ForeColor = LoadedSkin.PanelButtonTextColor; pnlbtntext.BackColor = Color.Transparent; pnlbtn.BackColor = LoadedSkin.PanelButtonColor; if (pnlbtn.BackgroundImage != null) { pnlbtntext.BackColor = Color.Transparent; } pnlbtn.Size = LoadedSkin.PanelButtonSize; pnlbtn.Tag = "keepbg"; pnlbtntext.Tag = "keepbg"; pnlbtn.Controls.Add(pnlbtntext); this.panelbuttonholder.Controls.Add(pnlbtn); pnlbtn.Show(); pnlbtntext.Show(); if (Shiftorium.UpgradeInstalled("useful_panel_buttons")) { pnlbtn.Click += onClick; pnlbtntext.Click += onClick; } pnlbtntext.Font = LoadedSkin.PanelButtonFont; } } } } } } LuaInterpreter.RaiseEvent("on_panelbutton_populate", this); }
public string getWindowTitle(IWindowBorder form) { return(NameChangerBackend.GetName(form.ParentWindow)); }