Fix rapid travel mode, universal commands

This commit is contained in:
2022-06-09 17:07:29 +02:00
parent 6e9f6f371f
commit 9d48caaa58
3 changed files with 19 additions and 7 deletions

View File

@@ -146,6 +146,7 @@ public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase
if (_currentSelectedItem is not IContainerViewModel containerViewModel || containerViewModel.Container is null)
return Task.CompletedTask;
_appState.RapidTravelText = "";
_selectedTab?.Tab?.SetCurrentLocation(containerViewModel.Container);
return Task.CompletedTask;
}
@@ -153,7 +154,12 @@ public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase
private async Task GoUp()
{
if (_currentLocation?.Parent is not AbsolutePath parentPath ||
await parentPath.ResolveAsyncSafe() is not IContainer newContainer) return;
await parentPath.ResolveAsyncSafe() is not IContainer newContainer)
{
return;
}
_appState.RapidTravelText = "";
_selectedTab?.Tab?.SetCurrentLocation(newContainer);
}

View File

@@ -1,4 +1,5 @@
using System.Collections.ObjectModel;
using FileTime.App.Core.UserCommand;
using FileTime.GuiApp.Configuration;
using Microsoft.Extensions.Options;
@@ -49,7 +50,12 @@ public class KeyboardConfigurationService : IKeyboardConfigurationService
private static bool IsUniversal(CommandBindingConfiguration keyMapping)
{
return false;
//return keyMapping.Command is ConfigCommand.GoUp or ConfigCommand.Open or ConfigCommand.OpenOrRun or ConfigCommand.MoveCursorUp or ConfigCommand.MoveCursorDown or ConfigCommand.MoveCursorUpPage or ConfigCommand.MoveCursorDownPage;
return keyMapping.Command is
GoUpCommand.CommandName
or OpenSelectedCommand.CommandName
or MoveCursorDownCommand.CommandName
or MoveCursorDownPageCommand.CommandName
or MoveCursorUpCommand.CommandName
or MoveCursorUpPageCommand.CommandName;
}
}