public void AddStyle(Data.Style s) { this.styles.styles.Add(s); Style style = new Style(); style.Load(this, s); this.StyleEditor_Resize(null, null); RefreshStyles(); }
public new void Load(Tabs _tabs) { this.tabs = _tabs; foreach (Tab t in tabs.tabs) { if (t.control is StyleEditor) { tabs.SelectTab(t); return; } } if (File.Exists(Utils.Main.DataDirectory + "Styles.xml")) { styles = Data.Styles.Deserialize(); } else { styles = new Data.Styles(); Data.Style brightGold = new Data.Style(); brightGold.ForeColor = Color.Black; brightGold.ControlBackColor = Color.White; brightGold.WindowBackColor = Color.Gold; brightGold.Name = "Jasne złoto (Wbudowany)"; brightGold.Selected = true; brightGold.BuiltIn = true; Data.Style dark = new Data.Style(); dark.ForeColor = Color.FromArgb(224, 224, 224); dark.ControlBackColor = Color.FromArgb(32, 32, 32); dark.WindowBackColor = Color.Black; dark.Name = "Ciemny (Wbudowany)"; dark.BuiltIn = true; styles.styles.Add(brightGold); styles.styles.Add(dark); } foreach (Data.Style s in styles.styles) { if (s.Selected) this.tabs.mainWindow.SetStyle(s); Style style = new Style(); style.Load(this, s); } newStyle.Load(this); tabs.AddTab("Zarządzaj stylami", this); }
public void SetSelectedStyle(Style style) { foreach (Style s in this.StyleControls) { s.SetChecked(false); s.style.Selected = false; } style.SetChecked(true); style.style.Selected = true; this.tabs.mainWindow.SetStyle(style.style); }
public new void Load(Tabs _tabs) { this.tabs = _tabs; foreach (Tab t in tabs.tabs) { if (t.control is StyleEditor) { tabs.SelectTab(t); return; } } if (File.Exists(Main.DataDirectory + "Styles.xml")) { styles = Data.Styles.Deserialize(); } else { styles = new Data.Styles(); Data.Style brightGold = new Data.Style(); brightGold.ForeColor = Color.Black; brightGold.ControlBackColor = Color.White; brightGold.WindowBackColor = Color.Gold; brightGold.Name = Language.GetString("StyleBrightGold"); brightGold.Selected = true; brightGold.BuiltIn = true; Data.Style dark = new Data.Style(); dark.ForeColor = Color.FromArgb(224, 224, 224); dark.ControlBackColor = Color.FromArgb(32, 32, 32); dark.WindowBackColor = Color.Black; dark.Name = Language.GetString("StyleDark"); dark.BuiltIn = true; styles.styles.Add(brightGold); styles.styles.Add(dark); } foreach (Data.Style s in styles.styles) { if (s.Selected) this.tabs.mainWindow.SetStyle(s); //fix old style names if (s.BuiltIn && (s.Name.ToLower() == "jasne złoto (wbudowany)" || s.Name.ToLower() == "bright gold (built-in)")) s.Name = Language.GetString("StyleBrightGold"); if (s.BuiltIn && (s.Name.ToLower() == "ciemny (wbudowany)" || s.Name.ToLower() == "dark (build-in)")) s.Name = Language.GetString("StyleDark"); //change language of style names if (s.BuiltIn && (s.Name == Resources.LanguagePL.StyleBrightGold || s.Name == Resources.LanguageEN.StyleBrightGold)) s.Name = Language.GetString("StyleBrightGold"); if (s.BuiltIn && (s.Name == Resources.LanguagePL.StyleDark || s.Name == Resources.LanguageEN.StyleDark)) s.Name = Language.GetString("StyleDark"); Style style = new Style(); style.Load(this, s); } newStyle.Load(this); tabs.AddTab(Language.GetString("StyleEditorName"), this); }