Merge branch 'rename-file' of https://github.com/Koisu-unavailable/Flow.Launcher into rename-file

This commit is contained in:
Jack251970 2025-06-26 08:49:30 +08:00
commit 0aff9e33de
2 changed files with 11 additions and 2 deletions

View file

@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Flow.Launcher.Plugin.Explorer.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="{DynamicResource plugin_explorer_manageactionkeywords_header}"
Title=""
Height="180"
MaxWidth="600"
Background="{DynamicResource PopuBGColor}"

View file

@ -39,6 +39,14 @@ namespace Flow.Launcher.Plugin.Explorer.Views
ShowInTaskbar = false;
RenameTb.Focus();
var window = Window.GetWindow(this);
window.KeyDown += (s, e) =>
{
if (e.Key == Key.Escape)
{
Close();
}
};
}
/// <summary>
@ -55,10 +63,11 @@ namespace Flow.Launcher.Plugin.Explorer.Views
else if (_info is FileInfo info)
{
string properName = Path.GetFileNameWithoutExtension(info.Name);
Application.Current.Dispatcher.Invoke(textBox.Select, DispatcherPriority.Background, textBox.Text.IndexOf(properName), properName.Length );
Application.Current.Dispatcher.Invoke(textBox.Select, DispatcherPriority.Background, textBox.Text.IndexOf(properName), properName.Length);
}
}
private void OnDoneButtonClick(object sender, RoutedEventArgs e)
{
RenameThing.Rename(NewFileName, _info, _api);