-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PowerRename] Show UI info if item cannot be renamed (#19934)
* PowerRename cleanup * Extract ExplorerItem as a UserControl * Add VisualStateManager * UI fixes * Implement error UI logic Highlight items that couldn't be renamed and add error message flyout * Update src/modules/powerrename/lib/PowerRenameManager.cpp Address PR comment Co-authored-by: Jay <65828559+Jay-o-Way@users.noreply.github.com> * Update src/modules/powerrename/lib/PowerRenameManager.cpp Address PR comment Co-authored-by: Jay <65828559+Jay-o-Way@users.noreply.github.com> * Folder max path is 247 * Implement State() properly Co-authored-by: Niels Laute <niels.laute@live.nl> Co-authored-by: Jay <65828559+Jay-o-Way@users.noreply.github.com>
- Loading branch information
1 parent
c26e23b
commit 13db857
Showing
15 changed files
with
688 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 123 additions & 0 deletions
123
src/modules/powerrename/PowerRenameUILib/ExplorerItem.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
<UserControl | ||
x:Class="PowerRenameUI.ExplorerItem" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="using:PowerRenameUI" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
|
||
<Grid Height="28" Padding="0,0,0,0"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="4" /> | ||
<!-- Some spacing in between --> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="Auto" /> | ||
<!-- Error tooltip --> | ||
</Grid.ColumnDefinitions> | ||
|
||
<Border | ||
Name="HighlightBorder" | ||
Grid.ColumnSpan="4" | ||
Margin="0,0,0,-1" | ||
HorizontalAlignment="Stretch" | ||
VerticalAlignment="Stretch" | ||
Background="Transparent" /> | ||
|
||
<Grid | ||
Grid.Column="0" | ||
Margin="10,4,0,4" | ||
HorizontalAlignment="Left"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition MinWidth="{x:Bind Indentation}" /> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition Width="Auto" /> | ||
</Grid.ColumnDefinitions> | ||
|
||
|
||
<CheckBox | ||
Name="{x:Bind IdStr}" | ||
Grid.Column="1" | ||
Width="28" | ||
Height="28" | ||
MinWidth="0" | ||
AutomationProperties.HelpText="{x:Bind Renamed}" | ||
AutomationProperties.Name="{x:Bind Original}" | ||
Content="" | ||
IsChecked="{x:Bind Checked, Mode=TwoWay}" | ||
IsTabStop="True" | ||
TabIndex="0" | ||
XYFocusKeyboardNavigation="Enabled" /> | ||
<Image | ||
Grid.Column="2" | ||
Width="16" | ||
Margin="4,0,0,0" | ||
HorizontalAlignment="Left" | ||
Source="{x:Bind ImagePath}" /> | ||
<TextBlock | ||
Grid.Column="3" | ||
Margin="6,0,4,0" | ||
VerticalAlignment="Center" | ||
FontSize="12" | ||
Foreground="{ThemeResource TextFillColorSecondaryBrush}" | ||
Text="{x:Bind Original, Mode=OneWay}" | ||
TextTrimming="CharacterEllipsis" /> | ||
</Grid> | ||
<TextBlock | ||
Grid.Column="2" | ||
Margin="0,0,4,0" | ||
VerticalAlignment="Center" | ||
FontSize="12" | ||
FontWeight="SemiBold" | ||
Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}" | ||
Text="{x:Bind Renamed, Mode=OneWay}" | ||
TextTrimming="CharacterEllipsis" /> | ||
|
||
<Border | ||
x:Name="ErrorIcon" | ||
Grid.Column="3" | ||
Width="12" | ||
Height="12" | ||
CornerRadius="12" | ||
Margin="4,0,8,0" | ||
Background="{ThemeResource SystemFillColorCriticalBrush}" | ||
Visibility="Collapsed"> | ||
<TextBlock | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
FontFamily="{ThemeResource SymbolThemeFontFamily}" | ||
Foreground="White" | ||
FontSize="8" | ||
Text="" /> | ||
<ToolTipService.ToolTip> | ||
<TextBlock | ||
x:Name="ErrorMessageTxt" | ||
Text="Error message goes here" | ||
TextWrapping="Wrap" /> | ||
</ToolTipService.ToolTip> | ||
</Border> | ||
|
||
<VisualStateManager.VisualStateGroups> | ||
<VisualStateGroup x:Name="CommonStates"> | ||
<VisualState x:Name="Normal" /> | ||
<VisualState x:Name="Highlight"> | ||
<VisualState.Setters> | ||
<Setter Target="HighlightBorder.Opacity" Value="0.1" /> | ||
<Setter Target="HighlightBorder.BorderBrush" Value="{ThemeResource AccentTextFillColorPrimaryBrush}" /> | ||
<Setter Target="HighlightBorder.Background" Value="{ThemeResource AccentTextFillColorPrimaryBrush}" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
<VisualState x:Name="Error"> | ||
<VisualState.Setters> | ||
<Setter Target="HighlightBorder.Opacity" Value="1" /> | ||
<Setter Target="HighlightBorder.BorderBrush" Value="{ThemeResource SystemFillColorCriticalBackgroundBrush}" /> | ||
<Setter Target="HighlightBorder.Background" Value="{ThemeResource SystemFillColorCriticalBackgroundBrush}" /> | ||
<Setter Target="ErrorIcon.Visibility" Value="Visible" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
</VisualStateGroup> | ||
</VisualStateManager.VisualStateGroups> | ||
</Grid> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.