diff --git a/src/MpvNet.Windows/WinForms/MainForm.cs b/src/MpvNet.Windows/WinForms/MainForm.cs index c94ab137..577db368 100644 --- a/src/MpvNet.Windows/WinForms/MainForm.cs +++ b/src/MpvNet.Windows/WinForms/MainForm.cs @@ -48,7 +48,7 @@ public MainForm() { 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 diff --git a/src/MpvNet/Binding.cs b/src/MpvNet/Binding.cs index 4ac30aed..4a9db2d7 100644 --- a/src/MpvNet/Binding.cs +++ b/src/MpvNet/Binding.cs @@ -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 = ""; diff --git a/src/MpvNet/InputHelp.cs b/src/MpvNet/InputHelp.cs index e40396a6..a8eeb72c 100644 --- a/src/MpvNet/InputHelp.cs +++ b/src/MpvNet/InputHelp.cs @@ -221,7 +221,12 @@ public static string ConvertToString(List bindings) 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 string ConvertToString(List bindings) 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 List Parse(string content) 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();