mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-06-30 03:51:14 +12:00
This commit is contained in:
parent
401e1329f1
commit
db46db002d
|
@ -39,5 +39,5 @@ using System.Runtime.InteropServices;
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.2.0.2")]
|
[assembly: AssemblyVersion("1.2.0.4")]
|
||||||
[assembly: AssemblyFileVersion("1.2.0.2")]
|
[assembly: AssemblyFileVersion("1.2.0.4")]
|
||||||
|
|
|
@ -28,15 +28,8 @@ namespace SystemTrayMenu.Helper
|
||||||
ImageScaling = ToolStripItemImageScaling.SizeToFit,
|
ImageScaling = ToolStripItemImageScaling.SizeToFit,
|
||||||
Text = Translator.GetText("Settings"),
|
Text = Translator.GetText("Settings"),
|
||||||
};
|
};
|
||||||
settings.Click += Settings_Click;
|
|
||||||
static void Settings_Click(object sender, EventArgs e)
|
settings.Click += (sender, e) => SettingsForm.ShowSingleInstance();
|
||||||
{
|
|
||||||
SettingsForm settingsForm = new();
|
|
||||||
if (settingsForm.ShowDialog() == DialogResult.OK)
|
|
||||||
{
|
|
||||||
AppRestart.ByConfigChange();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
menu.Items.Add(settings);
|
menu.Items.Add(settings);
|
||||||
|
|
||||||
|
|
|
@ -893,11 +893,7 @@ namespace SystemTrayMenu.UserInterface
|
||||||
{
|
{
|
||||||
if (e.Button == MouseButtons.Left)
|
if (e.Button == MouseButtons.Left)
|
||||||
{
|
{
|
||||||
SettingsForm settingsForm = new();
|
SettingsForm.ShowSingleInstance();
|
||||||
if (settingsForm.ShowDialog() == DialogResult.OK)
|
|
||||||
{
|
|
||||||
AppRestart.ByConfigChange();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -987,6 +983,13 @@ namespace SystemTrayMenu.UserInterface
|
||||||
private void Menu_MouseUp(object sender, MouseEventArgs e)
|
private void Menu_MouseUp(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
mouseDown = false;
|
mouseDown = false;
|
||||||
|
if (Properties.Settings.Default.UseCustomLocation)
|
||||||
|
{
|
||||||
|
if (!SettingsForm.IsOpen())
|
||||||
|
{
|
||||||
|
Properties.Settings.Default.Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -25,6 +25,7 @@ namespace SystemTrayMenu.UserInterface
|
||||||
private const string Command = @"Software\Classes\directory\shell\SystemTrayMenu_SetAsRootFolder\command";
|
private const string Command = @"Software\Classes\directory\shell\SystemTrayMenu_SetAsRootFolder\command";
|
||||||
|
|
||||||
private static readonly Icon SystemTrayMenu = Resources.SystemTrayMenu;
|
private static readonly Icon SystemTrayMenu = Resources.SystemTrayMenu;
|
||||||
|
private static SettingsForm settingsForm;
|
||||||
private readonly ColorConverter colorConverter = new();
|
private readonly ColorConverter colorConverter = new();
|
||||||
private bool inHotkey;
|
private bool inHotkey;
|
||||||
|
|
||||||
|
@ -441,6 +442,31 @@ namespace SystemTrayMenu.UserInterface
|
||||||
textBoxColorArrowHoverBackgroundDarkMode.Text = Settings.Default.ColorArrowHoverBackgroundDarkMode;
|
textBoxColorArrowHoverBackgroundDarkMode.Text = Settings.Default.ColorArrowHoverBackgroundDarkMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static void ShowSingleInstance()
|
||||||
|
{
|
||||||
|
if (IsOpen())
|
||||||
|
{
|
||||||
|
settingsForm.Activate();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
using (settingsForm = new())
|
||||||
|
{
|
||||||
|
if (settingsForm.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
AppRestart.ByConfigChange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
settingsForm = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static bool IsOpen()
|
||||||
|
{
|
||||||
|
return settingsForm != null;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets NewHotKey.
|
/// Gets NewHotKey.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in a new issue