Improved File Rename Feature and Icon Update

- ContextMenu.cs: Updated icon paths and glyphs
- en.xaml: Improved readability by refining text and adding comments
- Constants.cs: Added image path constants for the file rename feature
- RenameFile.xaml: Adjusted window size and improved alignment of UI elements
- rename.png: Added new icon image
This commit is contained in:
DB P 2025-06-25 21:14:03 +09:00
parent 54f126ac91
commit f991d91b8f
5 changed files with 29 additions and 35 deletions

View file

@ -215,8 +215,8 @@ namespace Flow.Launcher.Plugin.Explorer
}, },
// placeholder until real image is found // placeholder until real image is found
IcoPath = Constants.ShowContextMenuImagePath, IcoPath = Constants.RenameImagePath,
Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\ue70f") Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\ue8ac")
}); });

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

View file

@ -190,15 +190,15 @@
<system:String x:Key="OneYearAgo">1 year ago</system:String> <system:String x:Key="OneYearAgo">1 year ago</system:String>
<system:String x:Key="YearsAgo">{0} years ago</system:String> <system:String x:Key="YearsAgo">{0} years ago</system:String>
<!--Rename File Dialog--> <!-- Rename File Dialog -->
<system:String x:Key="plugin_explorer_new_file_name">New name:</system:String> <system:String x:Key="plugin_explorer_new_file_name">New name</system:String>
<system:String x:Key="plugin_explorer_rename_file_done">Rename</system:String> <system:String x:Key="plugin_explorer_rename_file_done">Rename</system:String>
<system:String x:Key="plugin_explorer_rename_a_file">Rename</system:String> <system:String x:Key="plugin_explorer_rename_a_file">Rename</system:String>
<system:String x:Key="plugin_explorer_not_a_new_name">The given name: {0} was not new.</system:String> <system:String x:Key="plugin_explorer_not_a_new_name">The given name: {0} was not new.</system:String>
<system:String x:Key="plugin_explorer_field_may_not_be_empty">{0} may not be empty.</system:String> <system:String x:Key="plugin_explorer_field_may_not_be_empty">{0} may not be empty.</system:String>
<system:String x:Key="plugin_explorer_invalid_name">{0} is an invalid name.</system:String> <system:String x:Key="plugin_explorer_invalid_name">{0} is an invalid name.</system:String>
<system:String x:Key="plugin_explorer_file_not_found">The specified item: {0} was not found</system:String> <system:String x:Key="plugin_explorer_file_not_found">The specified item: {0} was not found</system:String>
<system:String x:Key="plugin_explorer_rename_subtitle">Open a dialog to rename this.</system:String> <system:String x:Key="plugin_explorer_rename_subtitle">Open a dialog to rename this</system:String>
<system:String x:Key="plugin_explorer_cannot_rename">This cannot be renamed.</system:String> <system:String x:Key="plugin_explorer_cannot_rename">This cannot be renamed.</system:String>
<system:String x:Key="plugin_explorer_successful_rename">Successfully renamed it to: {0}</system:String> <system:String x:Key="plugin_explorer_successful_rename">Successfully renamed it to: {0}</system:String>
<system:String x:Key="plugin_explorer_element_already_exists">There is already a file with the name: {0} in this location</system:String> <system:String x:Key="plugin_explorer_element_already_exists">There is already a file with the name: {0} in this location</system:String>

View file

@ -17,6 +17,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
internal const string QuickAccessImagePath = "Images\\quickaccess.png"; internal const string QuickAccessImagePath = "Images\\quickaccess.png";
internal const string RemoveQuickAccessImagePath = "Images\\removequickaccess.png"; internal const string RemoveQuickAccessImagePath = "Images\\removequickaccess.png";
internal const string ShowContextMenuImagePath = "Images\\context_menu.png"; internal const string ShowContextMenuImagePath = "Images\\context_menu.png";
internal const string RenameImagePath = "Images\\rename.png";
internal const string EverythingErrorImagePath = "Images\\everything_error.png"; internal const string EverythingErrorImagePath = "Images\\everything_error.png";
internal const string IndexSearchWarningImagePath = "Images\\index_error.png"; internal const string IndexSearchWarningImagePath = "Images\\index_error.png";
internal const string WindowsIndexErrorImagePath = "Images\\index_error2.png"; internal const string WindowsIndexErrorImagePath = "Images\\index_error2.png";

View file

@ -6,8 +6,8 @@
xmlns:local="clr-namespace:Flow.Launcher.Plugin.Explorer.Views" xmlns:local="clr-namespace:Flow.Launcher.Plugin.Explorer.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="{DynamicResource plugin_explorer_manageactionkeywords_header}" Title="{DynamicResource plugin_explorer_manageactionkeywords_header}"
Width="Auto" Height="180"
Height="160" MaxWidth="600"
Background="{DynamicResource PopuBGColor}" Background="{DynamicResource PopuBGColor}"
DataContext="{Binding RelativeSource={RelativeSource Self}}" DataContext="{Binding RelativeSource={RelativeSource Self}}"
Foreground="{DynamicResource PopupTextColor}" Foreground="{DynamicResource PopupTextColor}"
@ -16,24 +16,23 @@
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<WindowChrome.WindowChrome> <WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="32" <WindowChrome CaptionHeight="32" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}"/>
</WindowChrome.WindowChrome> </WindowChrome.WindowChrome>
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition/> <RowDefinition />
<RowDefinition Height="40"/> <RowDefinition Height="60" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<StackPanel Grid.Row="0"> <StackPanel Grid.Row="0">
<StackPanel> <StackPanel>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Button <Button
Grid.Column="4" Grid.Column="4"
@ -48,10 +47,8 @@
<Path.Style> <Path.Style>
<Style TargetType="Path"> <Style TargetType="Path">
<Style.Triggers> <Style.Triggers>
<DataTrigger Binding="{Binding Path=IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" <DataTrigger Binding="{Binding Path=IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
Value="False"> <Setter Property="Opacity" Value="0.5" />
<Setter Property="Opacity"
Value="0.5"/>
</DataTrigger> </DataTrigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
@ -67,27 +64,25 @@
FontSize="20" FontSize="20"
FontWeight="SemiBold" FontWeight="SemiBold"
Text="{DynamicResource plugin_explorer_rename_a_file}" Text="{DynamicResource plugin_explorer_rename_a_file}"
TextAlignment="Center"/> TextAlignment="Left" />
</StackPanel> </StackPanel>
<StackPanel Margin="0 10 0 0" <StackPanel Margin="0 10 0 0" Orientation="Horizontal">
Orientation="Horizontal">
<TextBlock <TextBlock
MinWidth="150" MinWidth="150"
Margin="0 10 5 10" Margin="0 10 5 10"
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Center" VerticalAlignment="Center"
FontSize="14" FontSize="14"
Text="{DynamicResource plugin_explorer_new_file_name}"/> Text="{DynamicResource plugin_explorer_new_file_name}" />
<TextBox <TextBox
Name="RenameTb" Name="RenameTb"
Width="Auto" Width="300"
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Center" VerticalAlignment="Center"
PreviewKeyDown="RenameTb_OnKeyDown"
Text="{Binding NewFileName}"
GotFocus="SelectAll_OnTextBoxGotFocus" GotFocus="SelectAll_OnTextBoxGotFocus"
/> PreviewKeyDown="RenameTb_OnKeyDown"
Text="{Binding NewFileName}" />
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
@ -96,24 +91,22 @@
Background="{DynamicResource PopupButtonAreaBGColor}" Background="{DynamicResource PopupButtonAreaBGColor}"
BorderBrush="{DynamicResource PopupButtonAreaBorderColor}" BorderBrush="{DynamicResource PopupButtonAreaBorderColor}"
BorderThickness="0 1 0 0"> BorderThickness="0 1 0 0">
<StackPanel HorizontalAlignment="Center" <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
Orientation="Horizontal">
<Button <Button
x:Name="btnCancel" x:Name="btnCancel"
Width="145" Width="145"
Height="30" Height="34"
Margin="5 0 5 0" Margin="5 0 5 0"
Click="BtnCancel" Click="BtnCancel"
Content="{DynamicResource cancel}"/> Content="{DynamicResource cancel}" />
<Button <Button
Name="btnDone" Name="btnDone"
Width="145" Width="145"
Height="30" Height="34"
Margin="5 0 5 0" Margin="5 0 5 0"
Click="OnDoneButtonClick" Click="OnDoneButtonClick"
Style="{StaticResource AccentButtonStyle}"> Style="{StaticResource AccentButtonStyle}">
<TextBlock x:Name="lblAdd" <TextBlock x:Name="lblAdd" Text="{DynamicResource plugin_explorer_rename_file_done}" />
Text="{DynamicResource plugin_explorer_rename_file_done}"/>
</Button> </Button>
</StackPanel> </StackPanel>
</Border> </Border>