Added themes

This commit is contained in:
2024-05-27 20:10:52 +03:00
parent d3dd29f4bf
commit 83115d72a4
8 changed files with 261 additions and 22 deletions

View File

@@ -1,27 +1,32 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DiscordBotUI_Windows.WindowsForms
namespace DiscordBotUI_Windows.WindowsForms
{
public partial class MainWindow : Form
{
public MainWindow()
internal MainWindow()
{
InitializeComponent();
Load += (_, _) => MainWindowLoad();
FormClosed += async (_, _) =>
{
await Config.ApplicationSettings.SaveToFile();
};
}
private void MainWindowLoad()
{
pluginListToolStripMenuItem.Click += (_, _) => new PluginListWindow().Show();
pluginListToolStripMenuItem.Click += (_, _) =>
{
var form = new PluginListWindow();
Config.ThemeManager.SetFormTheme(Config.ThemeManager.CurrentTheme, form);
form.Show();
};
themesToolStripMenuItem.Click += (_, _) => {
themesToolStripMenuItem.DropDownItems.Clear();
foreach(var theme in Config.ThemeManager._InstalledThemes)
{
themesToolStripMenuItem.DropDownItems.Add(theme.Name, null, (_, _) => Config.ThemeManager.SetFormTheme(theme, this));
}
};
}
}
}