Skip to content

Commit d65e2fd

Browse files
committed
Improvements to PhotoAlbum grid
1 parent 98eecc7 commit d65e2fd

File tree

5 files changed

+33
-36
lines changed

5 files changed

+33
-36
lines changed

Files UWP/App.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
55
<Application.Resources>
6-
76
<ResourceDictionary>
87
<ResourceDictionary.MergedDictionaries>
98
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"/>

Files UWP/GenericFileBrowser.xaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@
1111
xmlns:local1="using:Files.Navigation"
1212
xmlns:local2="using:Files.Filesystem"
1313
xmlns:local3="using:Files.Interacts"
14+
xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)"
1415
Name="GenericItemView"
1516
mc:Ignorable="d" NavigationCacheMode="Required" PointerReleased="GenericItemView_PointerReleased" Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
1617
<Page.Resources>
18+
<Style x:Key="MenuFlyoutFluentThemeResources" TargetType="MenuFlyoutPresenter">
19+
<Setter Property="CornerRadius" Value="5" />
20+
<Setter Property="Background" Value="{ThemeResource FlyoutBackgroundThemeBrush}" />
21+
</Style>
22+
1723
<Style x:Key="TextBoxStyleForPathBar" TargetType="TextBox">
1824
<Setter Property="Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}"/>
1925
<Setter Property="Background" Value="{ThemeResource ApplicationPageBackgroundThemeBrush}"/>
@@ -148,7 +154,7 @@
148154

149155
<Grid Background="Transparent" Name="RootGrid">
150156
<Grid.ContextFlyout>
151-
<MenuFlyout>
157+
<MenuFlyout MenuFlyoutPresenterStyle="{StaticResource MenuFlyoutFluentThemeResources}">
152158
<MenuFlyout.Items>
153159
<MenuFlyoutItem Text="Refresh" Name="RefreshEmptySpace">
154160
<MenuFlyoutItem.Icon>
@@ -182,7 +188,7 @@
182188
<Style TargetType="controlsprimitives:DataGridColumnHeader">
183189
<Setter Property="ContextFlyout">
184190
<Setter.Value>
185-
<MenuFlyout x:Name="HeaderRightClickMenu">
191+
<MenuFlyout x:Name="HeaderRightClickMenu" MenuFlyoutPresenterStyle="{StaticResource MenuFlyoutFluentThemeResources}">
186192
<MenuFlyoutItem Text="Edit Columns" Name="EditColumn">
187193
<MenuFlyoutItem.Icon>
188194
<FontIcon Glyph="&#xE70F;"/>
@@ -203,7 +209,7 @@
203209
<Style TargetType="controls:DataGridRow">
204210
<Setter Property="ContextFlyout">
205211
<Setter.Value>
206-
<MenuFlyout x:Name="RightClickContextMenu">
212+
<MenuFlyout x:Name="RightClickContextMenu" MenuFlyoutPresenterStyle="{StaticResource MenuFlyoutFluentThemeResources}">
207213
<MenuFlyout.Items>
208214
<MenuFlyoutItem Text="Open With..." Name="OpenItem">
209215
<MenuFlyoutItem.Icon>

Files UWP/Interacts/Interaction.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ public Interaction(PageType contentPageInstance)
3333
type = contentPageInstance;
3434
}
3535

36-
public static MessageDialog message;
37-
3836
public async void List_ItemClick(object sender, DoubleTappedRoutedEventArgs e)
3937
{
4038

Files UWP/PhotoAlbum.xaml

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
PointerReleased="PhotoAlbumViewer_PointerReleased">
1717

1818
<Page.Resources>
19-
<navigation:BackState x:Key="BackObject"/>
20-
<navigation:ForwardState x:Key="ForwardObject"/>
19+
<Style x:Key="MenuFlyoutFluentThemeResources" TargetType="MenuFlyoutPresenter">
20+
<Setter Property="CornerRadius" Value="5" />
21+
<Setter Property="Background" Value="{ThemeResource FlyoutBackgroundThemeBrush}" />
22+
</Style>
2123

2224
<Style x:Key="TextBoxStyleForPathBar" TargetType="TextBox">
2325
<Setter Property="Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}"/>
@@ -374,7 +376,7 @@
374376

375377
<Grid Tag="{x:Bind Tag, Mode=OneWay}" Background="{StaticResource ApplicationPageBackgroundThemeBrush}" Padding="0,0,0,0" VerticalAlignment="Stretch">
376378
<Grid.ContextFlyout>
377-
<MenuFlyout x:Name="GridRightClickContextMenu">
379+
<MenuFlyout x:Name="GridRightClickContextMenu" MenuFlyoutPresenterStyle="{StaticResource MenuFlyoutFluentThemeResources}">
378380
<MenuFlyout.Items>
379381
<MenuFlyoutItem Click="RefreshGrid_Click" Text="Refresh" Name="RefreshGrid">
380382
<MenuFlyoutItem.Icon>
@@ -398,12 +400,12 @@
398400
<ProgressBar Name="ProgBar" Height="10" VerticalAlignment="Top" IsIndeterminate="True"/>
399401
<TextBlock Visibility="{x:Bind TextState.isVisible, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Name="EmptyText" HorizontalAlignment="Center" Text="This folder is empty." TextWrapping="Wrap" VerticalAlignment="Top" Margin="0,125,0,0" Grid.Row="3" Canvas.ZIndex="0"/>
400402

401-
<controls:AdaptiveGridView animations:ReorderGridAnimation.Duration="300" ShowsScrollingPlaceholders="True" Margin="24,24,24,0" Grid.Row="3" SelectionMode="Extended" IsRightTapEnabled="True" IsDoubleTapEnabled="True" Name="FileList" Padding="0, 0, 0, 0" >
403+
<controls:AdaptiveGridView StretchContentForSingleRow="False" DesiredWidth="150" VerticalContentAlignment="Stretch" ItemHeight="150" animations:ReorderGridAnimation.Duration="300" ShowsScrollingPlaceholders="True" Margin="24,24,24,0" Grid.Row="3" SelectionMode="Extended" IsRightTapEnabled="True" IsDoubleTapEnabled="True" Name="FileList" Padding="0, 0, 0, 0" >
402404
<controls:AdaptiveGridView.ItemTemplate>
403405
<DataTemplate>
404-
<Grid ToolTipService.ToolTip="{Binding FileName}" Background="Transparent" IsRightTapEnabled="True" Margin="0, 0, 0, 0" Padding="5, 5, 5, 5" Width="150" Height="150" HorizontalAlignment="Center" VerticalAlignment="Center">
405-
<Grid.ContextFlyout>
406-
<MenuFlyout x:Name="RightClickContextMenu">
406+
<StackPanel Orientation="Vertical" Padding="0" ToolTipService.ToolTip="{Binding FileName}" Background="Transparent" IsRightTapEnabled="True" Margin="0, 0, 0, 0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
407+
<StackPanel.ContextFlyout>
408+
<MenuFlyout x:Name="RightClickContextMenu" MenuFlyoutPresenterStyle="{StaticResource MenuFlyoutFluentThemeResources}">
407409
<MenuFlyout.Items>
408410
<MenuFlyoutItem Click="OpenItem_Click" Text="Open With..." Name="OpenItem">
409411
<MenuFlyoutItem.Icon>
@@ -447,32 +449,24 @@
447449
</MenuFlyout.Items>
448450

449451
</MenuFlyout>
450-
</Grid.ContextFlyout>
451-
452-
<Grid.RowDefinitions>
453-
<RowDefinition Height="75*"/>
454-
<RowDefinition Height="25*"/>
455-
</Grid.RowDefinitions>
456-
<Grid Padding="2" Grid.Row="0" Name="Picture" Visibility="{Binding FileIconVis}">
457-
<controls:DropShadowPanel OffsetY="5">
452+
</StackPanel.ContextFlyout>
453+
<Grid Width="150" Height="100">
454+
<Grid Padding="12" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Name="Picture" Visibility="{Binding FileIconVis}">
458455
<Image Stretch="Uniform" Source="{Binding FileImg}"/>
459-
</controls:DropShadowPanel>
460-
</Grid>
461-
462-
<Grid Grid.Row="0" Name="Album" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="{Binding FolderImg}">
463-
464-
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
465-
<FontIcon FontSize="92" Glyph="&#xE8D5;" FontFamily="Segoe MDL2 Assets" Foreground="#ffe793"/>
466456
</Grid>
467-
</Grid>
468-
<Grid Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="{Binding EmptyImgVis}">
469-
470-
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
471-
<FontIcon FontSize="92" Glyph="&#xE7C3;" FontFamily="Segoe MDL2 Assets"/>
457+
<Grid Name="Album" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="{Binding FolderImg}">
458+
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
459+
<FontIcon FontSize="72" Glyph="&#xE8D5;" FontFamily="Segoe MDL2 Assets" Foreground="#ffe793"/>
460+
</Grid>
461+
</Grid>
462+
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="{Binding EmptyImgVis}">
463+
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
464+
<FontIcon FontSize="72" Glyph="&#xE7C3;" FontFamily="Segoe MDL2 Assets"/>
465+
</Grid>
472466
</Grid>
473467
</Grid>
474-
<TextBlock Grid.Row="1" VerticalAlignment="Top" Text="{Binding FileName}" TextWrapping="Wrap" TextAlignment="Center"/>
475-
</Grid>
468+
<TextBlock MaxWidth="150" HorizontalTextAlignment="Center" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Text="{Binding FileName}" TextWrapping="Wrap"/>
469+
</StackPanel>
476470

477471
</DataTemplate>
478472
</controls:AdaptiveGridView.ItemTemplate>

Files UWP/PhotoAlbum.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace Files
2121

2222
public sealed partial class PhotoAlbum : Page
2323
{
24-
public AdaptiveGridView gv;
24+
public GridView gv;
2525
public Image largeImg;
2626
public MenuFlyout context;
2727
public MenuFlyout gridContext;

0 commit comments

Comments
 (0)