RapidTravel display name

This commit is contained in:
2023-07-28 02:21:29 +02:00
parent 0db7949037
commit 12c9aa039a
8 changed files with 27 additions and 27 deletions

View File

@@ -64,17 +64,21 @@ public class RapidTravelModeKeyInputHandler : IRapidTravelModeKeyInputHandler
}
else if (key == Key.Back)
{
if (_appState.RapidTravelText.Length > 0)
if (_appState.RapidTravelText.Value!.Length > 0)
{
setHandled(true);
_appState.RapidTravelText = _appState.RapidTravelText.Substring(0, _appState.RapidTravelText.Length - 1);
await _appState.RapidTravelText.SetValue(
_appState.RapidTravelText.Value![..^1]
);
updateRapidTravelFilter = true;
}
}
else if (keyString.Length == 1)
{
setHandled(true);
_appState.RapidTravelText += keyString.ToLower();
await _appState.RapidTravelText.SetValue(
_appState.RapidTravelText.Value + keyString.ToLower()
);
updateRapidTravelFilter = true;
}
else
@@ -93,7 +97,7 @@ public class RapidTravelModeKeyInputHandler : IRapidTravelModeKeyInputHandler
if (_selectedTab?.Tab is not ITab tab) return;
tab.RemoveItemFilter(RapidTravelFilterName);
tab.AddItemFilter(new ItemFilter(RapidTravelFilterName, i => i.Name.ToLower().Contains(_appState.RapidTravelText)));
tab.AddItemFilter(new ItemFilter(RapidTravelFilterName, i => i.Name.ToLower().Contains(_appState.RapidTravelText.Value!)));
/*var currentLocation = await _appState.SelectedTab.CurrentLocation.Container.WithoutVirtualContainer(MainPageViewModel.RAPIDTRAVEL);
var newLocation = new VirtualContainer(
currentLocation,

View File

@@ -642,7 +642,7 @@
<TextBlock Text="Filter " />
<TextBlock Text="{Binding AppState.RapidTravelText}" />
<TextBlock Text="{Binding AppState.RapidTravelText.Value}" />
</StackPanel>
</Grid>