Skip to content

Feature: Improved animations in the Columns layout #10973

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 2 commits into from
Jan 10, 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
84 changes: 31 additions & 53 deletions src/Files.App/Views/LayoutModes/ColumnViewBase.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@
x:Class="Files.App.Views.LayoutModes.ColumnViewBase"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:animations="using:CommunityToolkit.WinUI.UI.Animations"
xmlns:behaviors="using:CommunityToolkit.WinUI.UI.Behaviors"
xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:converters="using:CommunityToolkit.WinUI.UI.Converters"
xmlns:converters1="using:Files.App.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:helpers="using:Files.App.Helpers"
xmlns:i="using:Microsoft.Xaml.Interactivity"
xmlns:icore="using:Microsoft.Xaml.Interactions.Core"
xmlns:local="using:Files.App"
xmlns:local2="using:Files.App.Filesystem"
xmlns:local3="using:Files.App.Filesystem.Cloud"
Expand All @@ -37,11 +32,7 @@
NotEmptyValue="Visible" />

<converters1:BoolToSelectionMode x:Key="BoolToSelectionModeConverter" />
<Style TargetType="controls:BladeItem">
<Setter Property="Background" Value="Transparent" />
<Setter Property="TitleBarVisibility" Value="Collapsed" />
<Setter Property="BorderThickness" Value="0,0,1,0" />
</Style>

<Style TargetType="ListViewHeaderItem">
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
<Setter Property="FontSize" Value="{ThemeResource GridViewHeaderItemThemeFontSize}" />
Expand Down Expand Up @@ -190,7 +181,7 @@
x:Name="FilesRootGrid"
Height="30"
Margin="0"
Padding="20,0,12,0"
Padding="12,0,12,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
CornerRadius="{StaticResource ControlCornerRadius}"
Expand All @@ -201,28 +192,9 @@
<ColumnDefinition Width="24" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="20" />
</Grid.ColumnDefinitions>
<animations:Explicit.Animations>
<animations:AnimationSet x:Name="FadeAnimation">
<animations:OpacityAnimation
Delay="0"
EasingMode="EaseIn"
EasingType="Linear"
From="0"
To="1"
Duration="0:0:.05" />
<animations:TranslationAnimation
From="0, 5, 0"
To="0"
Duration="0:0:.1" />
</animations:AnimationSet>
</animations:Explicit.Animations>
<i:Interaction.Behaviors>
<icore:EventTriggerBehavior EventName="Loaded">
<behaviors:StartAnimationAction Animation="{Binding ElementName=FadeAnimation}" />
</icore:EventTriggerBehavior>
</i:Interaction.Behaviors>

<!-- Thumbnail -->
<Grid
Grid.Column="0"
Width="24"
Expand Down Expand Up @@ -291,19 +263,19 @@
Glyph="&#xF10A;" />
</Border>
</Grid>
<Grid

<!-- Item Name -->
<TextBlock
x:Name="ItemName"
Grid.Column="1"
Margin="5,0,5,0"
HorizontalAlignment="Left">
<TextBlock
x:Name="ItemName"
Grid.Column="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Text="{x:Bind Name, Mode=OneWay}"
TextTrimming="CharacterEllipsis"
TextWrapping="NoWrap" />
</Grid>
HorizontalAlignment="Left"
VerticalAlignment="Center"
Text="{x:Bind Name, Mode=OneWay}"
TextTrimming="CharacterEllipsis"
TextWrapping="NoWrap" />

<!-- Rename Text Box -->
<TextBox
x:Name="ListViewTextBoxItemName"
Grid.Column="1"
Expand All @@ -314,8 +286,10 @@
TextAlignment="Left"
TextWrapping="Wrap"
Visibility="Collapsed" />

<Grid Grid.Column="2">
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal" Spacing="4">
<!-- Cloud Status -->
<FontIcon
x:Name="CloudDriveSyncStatusGlyph"
HorizontalAlignment="Center"
Expand All @@ -324,6 +298,8 @@
FontSize="12"
Glyph="{x:Bind ((local3:CloudDriveSyncStatusUI)SyncStatusUI).Glyph, Mode=OneWay}"
Visibility="{x:Bind ((local3:CloudDriveSyncStatusUI)SyncStatusUI).LoadSyncStatus, Mode=OneWay}" />

<!-- Tag Ellipse -->
<Ellipse
Width="12"
Height="12"
Expand All @@ -332,17 +308,18 @@
Fill="{x:Bind FileTagsUI[0].ColorModel, Mode=OneWay, Converter={StaticResource ColorModelToColorConverter}}"
ToolTipService.ToolTip="{x:Bind FileTagsUI[0].TagName, Mode=OneWay}"
Visibility="{x:Bind FileTagsUI, Converter={StaticResource EmptyObjectToObjectConverter}, Mode=OneWay}" />

<!-- Open Folder Icon -->
<FontIcon
x:Name="OpenFolderChevron"
HorizontalAlignment="Right"
VerticalAlignment="Center"
x:Load="{x:Bind IsFolder}"
FontSize="12"
Foreground="{ThemeResource TextFillColorSecondary}"
Glyph="&#xE76C;" />
</StackPanel>
</Grid>
<FontIcon
x:Name="OpenFolderChevron"
Grid.Column="3"
HorizontalAlignment="Right"
VerticalAlignment="Center"
x:Load="{x:Bind IsFolder}"
FontSize="12"
Foreground="{ThemeResource TextFillColorSecondary}"
Glyph="&#xE76C;" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
Expand Down Expand Up @@ -458,6 +435,7 @@
</ListView>
</SemanticZoom.ZoomedOutView>
</SemanticZoom>

<Canvas>
<Rectangle
Name="SelectionRectangle"
Expand Down
28 changes: 12 additions & 16 deletions src/Files.App/Views/LayoutModes/ColumnViewBrowser.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:converters="using:CommunityToolkit.WinUI.UI.Converters"
xmlns:converters1="using:Files.App.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="using:Microsoft.Xaml.Interactivity"
xmlns:icore="using:Microsoft.Xaml.Interactions.Core"
xmlns:local="using:Files.App"
xmlns:local2="using:Files.App.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Name="PageRoot"
mc:Ignorable="d">

<i:Interaction.Behaviors>
<icore:EventTriggerBehavior EventName="PointerPressed">
<icore:InvokeCommandAction Command="{x:Bind CommandsViewModel.ItemPointerPressedCommand}" />
</icore:EventTriggerBehavior>
</i:Interaction.Behaviors>

<local:BaseLayout.Resources>
<Style TargetType="controls:BladeItem">
<Setter Property="Background" Value="Transparent" />
Expand All @@ -27,18 +26,15 @@
<Setter Property="Width" Value="300" />
</Style>
</local:BaseLayout.Resources>
<Grid x:Name="RootGrid" ContextFlyout="{x:Bind BaseContextMenuFlyout}">
<controls:BladeView x:Name="ColumnHost">
<controls:BladeView.Transitions>
<TransitionCollection />
</controls:BladeView.Transitions>
<controls:BladeView.ItemContainerTransitions>
<TransitionCollection />
</controls:BladeView.ItemContainerTransitions>

<controls:BladeItem>
<Frame x:Name="MainPageFrame" />
</controls:BladeItem>
</controls:BladeView>
</Grid>
<controls:BladeView x:Name="ColumnHost" ContextFlyout="{x:Bind BaseContextMenuFlyout}">
<controls:BladeView.ItemContainerTransitions>
<TransitionCollection />
</controls:BladeView.ItemContainerTransitions>

<controls:BladeItem>
<Frame x:Name="MainPageFrame" />
</controls:BladeItem>
</controls:BladeView>

</local:BaseLayout>