fancy new command palette
This commit is contained in:
@@ -12,8 +12,6 @@ namespace mpvnet
|
||||
{
|
||||
public static class App
|
||||
{
|
||||
public static event Action ShowCommandPalette;
|
||||
|
||||
public static List<string> TempFiles { get; } = new List<string>();
|
||||
|
||||
public static string ConfPath { get => Core.ConfigFolder + "mpvnet.conf"; }
|
||||
|
||||
@@ -44,7 +44,6 @@ namespace mpvnet
|
||||
case "show-input-editor": ShowDialog(typeof(InputWindow)); break;
|
||||
case "show-keys": ShowTextWithEditor("input-key-list", Core.get_property_string("input-key-list").Replace(",", BR)); break;
|
||||
case "show-media-info": ShowMediaInfo(args); break;
|
||||
case "show-media-search": ShowDialog(typeof(EverythingWindow)); break;
|
||||
case "show-playlist": ShowPlaylist(); break;
|
||||
case "show-profiles": ShowTextWithEditor("profile-list", mpvHelp.GetProfiles()); break;
|
||||
case "show-properties": ShowProperties(); break;
|
||||
|
||||
@@ -388,7 +388,7 @@ namespace mpvnet
|
||||
if (LogMessage != null || LogMessageAsync != null)
|
||||
{
|
||||
string msg = $"[{ConvertFromUtf8(data.prefix)}] {ConvertFromUtf8(data.text)}";
|
||||
InvokeAsync<mpv_log_level, string>(LogMessageAsync, data.log_level, msg);
|
||||
InvokeAsync(LogMessageAsync, data.log_level, msg);
|
||||
LogMessage?.Invoke(data.log_level, msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,7 +242,14 @@ namespace mpvnet
|
||||
|
||||
public static IEnumerable<CommandPaletteItem> GetItems()
|
||||
{
|
||||
return CommandItem.Items.Select(i => new CommandPaletteItem() { Text = i.Display, SecondaryText = i.Input });
|
||||
var aaa = CommandItem.Items.ToArray();
|
||||
return CommandItem.Items
|
||||
.Where(i => i.Command != "")
|
||||
.Select(i => new CommandPaletteItem() {
|
||||
Text = i.Display,
|
||||
SecondaryText = i.Input,
|
||||
Action = () => Core.command(i.Command)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user