[Feature] Settings menu - Always on top behavior (#417), version 1.3.0.6

This commit is contained in:
Markus Hofknecht 2022-07-18 23:05:15 +02:00
parent 9c43fb181f
commit 88bdabf5f2
6 changed files with 33 additions and 15 deletions

View file

@ -39,5 +39,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.0.5")]
[assembly: AssemblyFileVersion("1.3.0.5")]
[assembly: AssemblyVersion("1.3.0.6")]
[assembly: AssemblyFileVersion("1.3.0.6")]

View file

@ -275,7 +275,7 @@ Thanks for ideas, reporting issues and contributing!
#285 #286 [dao-net](https://github.com/dao-net),
#288 William P.,
#294 #295 #296 Stefan Mahrer,
#225 #297 #299 #317 #321 #324 #330 #386 #390 #401 #402 #407 #409 #414 [chip33](https://github.com/chip33),
#225 #297 #299 #317 #321 #324 #330 #386 #390 #401 #402 #407 #409 #414 #416 [chip33](https://github.com/chip33),
#298 [phanirithvij](https://github.com/phanirithvij),
#306 [wini2](https://github.com/wini2),
#370 [dna5589](https://github.com/dna5589),

View file

@ -89,7 +89,7 @@ namespace SystemTrayMenu.Helper
aboutBox.AppMoreInfo += "#235 #242 243 #247, #271 Tom, #237 Torsten S., #240 video Patrick, #244 Gunter D., #246 #329 MACE4GITHUB, #259 #310 vanjac, ";
aboutBox.AppMoreInfo += "#262 terencemcdonnell, #269 petersnows25, #272 Peter M., #273 #274 ParasiteDelta, #275 #276 #278 donaldaken, ";
aboutBox.AppMoreInfo += "#277 Jan S., #282 akuznets, #283 #284 #289 RuSieg, #285 #286 dao-net, #288 William P., #294 #295 #296 Stefan Mahrer, ";
aboutBox.AppMoreInfo += "#225 #297 #299 #317 #321 #324 #330 #386 #390 #401 #402 #407 #409 #414 chip33, #298 phanirithvij, #306 wini2, #370 dna5589, #372 not-nef, #376 Michelle H. ";
aboutBox.AppMoreInfo += "#225 #297 #299 #317 #321 #324 #330 #386 #390 #401 #402 #407 #409 #414 #416 chip33, #298 phanirithvij, #306 wini2, #370 dna5589, #372 not-nef, #376 Michelle H. ";
aboutBox.AppMoreInfo += "#377 SoenkeHob, #380 #394 TransLucida, #384 boydfields, #386 visusys, #387 #411 yrctw" + Environment.NewLine;
aboutBox.AppMoreInfo += @"
Sponsors - Thank you!

View file

@ -9,6 +9,7 @@ namespace SystemTrayMenu.UserInterface
using System.Drawing;
using System.Globalization;
using System.Reflection;
using System.Threading;
using System.Windows.Forms;
using SystemTrayMenu.DataClasses;
using SystemTrayMenu.DllImports;
@ -1100,7 +1101,7 @@ namespace SystemTrayMenu.UserInterface
{
if (e.Button == MouseButtons.Left)
{
SettingsForm.ShowSingleInstance(this);
new Thread(SettingsForm.ShowSingleInstance).Start();
}
}

View file

@ -589,23 +589,16 @@ namespace SystemTrayMenu.UserInterface
return RegisterHotkeys(false);
}
public static void ShowSingleInstance(IWin32Window owner = null)
public static void ShowSingleInstance()
{
if (IsOpen())
{
settingsForm.Activate();
settingsForm.HandleInvoke(settingsForm.Activate);
}
else
{
settingsForm = new();
if (owner == null)
{
settingsForm.ShowDialog();
}
else
{
settingsForm.Show(owner);
}
settingsForm.ShowDialog();
}
}

View file

@ -0,0 +1,24 @@
// <copyright file="FormsExtensions.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace SystemTrayMenu.Utilities
{
using System;
using System.Windows.Forms;
internal static class FormsExtensions
{
public static void HandleInvoke(this Control instance, Action action)
{
if (instance.InvokeRequired)
{
instance.Invoke(action);
}
else
{
action();
}
}
}
}