public MainForm() { InitializeComponent(); notificationIcon = notifyIcon1; newTimerDialog = new NewTimerDialog(); settingsDialog = new SettingsDialog(); themeLoader = new ThemeLoader(); themeLoader.LoadThemes(); toolStripRenderer = new HoldTimerToolStripRenderer(); toolStripRenderer.ActiveTheme = themeLoader.ActiveTheme; toolStrip1.Renderer = toolStripRenderer; toolStrip2.Renderer = toolStripRenderer; foreach (Theme theme in themeLoader.LoadedThemes) { ToolStripMenuItem menuItem = new ToolStripMenuItem(); menuItem.Click += ThemeMenuItem_Click; menuItem.Text = theme.Name; menuItem.Tag = theme; if (Properties.Settings.Default.SelectedTheme == theme.Name) { menuItem.Checked = true; toolStripRenderer.ActiveTheme = theme; } themeDropDownMenuItem.DropDownItems.Add(menuItem); } panel1.ControlRemoved += Panel1_ControlRemoved; panel1.ClientSizeChanged += Panel1_ClientSizeChanged; Properties.Settings.Default.PropertyChanged += Default_PropertyChanged; BackColor = Properties.Settings.Default.AppBackColor; TopMost = Properties.Settings.Default.AlwaysOnTop; }
public ThemeLoader() { instance = this; }