fix dark mode window title bar color and support uosc exclamation mark menu syntax
This commit is contained in:
@@ -48,7 +48,7 @@ public partial class MainForm : Form
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
if (Environment.OSVersion.Version >= new Version(10, 0, 18985))
|
||||
if (Environment.OSVersion.Version >= new Version(10, 0, 18985) && Theme.DarkMode)
|
||||
DwmSetWindowAttribute(Handle, 20, new[] { 1 }, 4); // DWMWA_USE_IMMERSIVE_DARK_MODE = 20
|
||||
|
||||
try
|
||||
|
||||
@@ -10,6 +10,7 @@ public class Binding : ObservableObject
|
||||
|
||||
public bool IsCustomMenu { get; set; }
|
||||
public bool IsMenu { get; set; }
|
||||
public bool IsShortMenuSyntax { get; set; }
|
||||
|
||||
string _input = "";
|
||||
|
||||
|
||||
@@ -221,7 +221,12 @@ public static class InputHelp
|
||||
string comment;
|
||||
|
||||
if (binding.IsMenu)
|
||||
comment = "menu: " + binding.Comment.Trim();
|
||||
{
|
||||
if (binding.IsShortMenuSyntax)
|
||||
comment = "! " + binding.Comment.Trim();
|
||||
else
|
||||
comment = "menu: " + binding.Comment.Trim();
|
||||
}
|
||||
else if (binding.IsCustomMenu)
|
||||
comment = "custom-menu: " + binding.Comment.Trim();
|
||||
else
|
||||
@@ -229,7 +234,10 @@ public static class InputHelp
|
||||
|
||||
if (comment != "")
|
||||
{
|
||||
if (comment.StartsWith("menu: ") || comment.StartsWith("custom-menu: "))
|
||||
if (comment.StartsWith("menu: ") ||
|
||||
comment.StartsWith("custom-menu: ") ||
|
||||
comment.StartsWith("! "))
|
||||
|
||||
comment = " #" + comment;
|
||||
else
|
||||
comment = " # " + comment;
|
||||
@@ -297,12 +305,13 @@ public static class InputHelp
|
||||
binding.IsMenu = true;
|
||||
line = line[..line.IndexOf("#menu:")];
|
||||
}
|
||||
//else if (line.Contains("#!"))
|
||||
//{
|
||||
// binding.Comment = line[(line.IndexOf("#!") + 2)..].Trim();
|
||||
// binding.IsMenu = true;
|
||||
// line = line[..line.IndexOf("#!")];
|
||||
//}
|
||||
else if (line.Contains("#!"))
|
||||
{
|
||||
binding.Comment = line[(line.IndexOf("#!") + 2)..].Trim();
|
||||
binding.IsMenu = true;
|
||||
binding.IsShortMenuSyntax = true;
|
||||
line = line[..line.IndexOf("#!")];
|
||||
}
|
||||
else if (line.Contains("#custom-menu:"))
|
||||
{
|
||||
binding.Comment = line[(line.IndexOf("#custom-menu:") + 13)..].Trim();
|
||||
|
||||
Reference in New Issue
Block a user