Skip to content

Feature: Updated icons in the Tag column in the Details layout #13060

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 19 additions & 14 deletions src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1099,40 +1099,45 @@
<DataTemplate x:DataType="filetags:TagViewModel">
<UserControl PointerEntered="FileTag_PointerEntered" PointerExited="FileTag_PointerExited">
<StackPanel
x:Name="TagPill"
Height="24"
Padding="8,0"
HorizontalAlignment="Left"
x:Phase="2"
BorderBrush="{x:Bind Color, Mode=OneWay, Converter={StaticResource StringToBrushConverter}}"
BorderThickness="1"
CornerRadius="12"
Orientation="Horizontal"
Spacing="8"
Tapped="TagItem_Tapped"
ToolTipService.ToolTip="{x:Bind Name, Mode=OneWay}">
<FontIcon
x:Name="TagIcon"
FontSize="12"
Foreground="{x:Bind Color, Mode=OneWay, Converter={StaticResource StringToBrushConverter}}"
Glyph="&#xE8EC;"
Tapped="TagIcon_Tapped"
ToolTipService.ToolTip="{helpers:ResourceString Name=Remove}" />
<!-- Tag icon -->
<PathIcon
VerticalAlignment="Center"
Data="{StaticResource ColorIconFilledTag}"
Foreground="{x:Bind Color, Mode=OneWay, Converter={StaticResource StringToBrushConverter}}" />
<!-- Tag name -->
<TextBlock
MaxWidth="200"
Padding="8,0,0,0"
VerticalAlignment="Center"
FontSize="12"
LineHeight="18"
Style="{StaticResource ColumnContentTextBlock}"
Text="{x:Bind Name, Mode=OneWay}"
TextTrimming="CharacterEllipsis" />

<!-- Remove tag icon -->
<FontIcon
x:Name="RemoveTagIcon"
VerticalAlignment="Center"
FontSize="12"
Glyph="&#xE711;"
Tapped="RemoveTagIcon_Tapped"
ToolTipService.ToolTip="{helpers:ResourceString Name=Remove}"
Visibility="Collapsed" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />

<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Target="TagIcon.Glyph" Value="&#xE711;" />
<Setter Target="TagPill.Background" Value="{ThemeResource CardBackgroundFillColorDefault}" />
<Setter Target="RemoveTagIcon.Visibility" Value="Visible" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ private void FileTag_PointerExited(object sender, PointerRoutedEventArgs e)
VisualStateManager.GoToState((UserControl)sender, "Normal", true);
}

private void TagIcon_Tapped(object sender, TappedRoutedEventArgs e)
private void RemoveTagIcon_Tapped(object sender, TappedRoutedEventArgs e)
{
var parent = (sender as FontIcon)?.Parent as StackPanel;
var tagName = (parent?.Children[TAG_TEXT_BLOCK] as TextBlock)?.Text;
Expand Down