Skip to content

Commit 0881835

Browse files
authored
Preview pane design update and fixes (#5889)
1 parent 36fe823 commit 0881835

34 files changed

+487
-262
lines changed
296 Bytes
Binary file not shown.

Files/BaseLayout.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public CollectionViewSource CollectionViewSource
111111
}
112112
}
113113

114-
private NavigationArguments navigationArguments;
114+
protected NavigationArguments navigationArguments;
115115

116116
private bool isItemSelected = false;
117117

@@ -364,7 +364,7 @@ public virtual void ResetItemOpacity()
364364

365365
protected abstract ListedItem GetItemFromElement(object element);
366366

367-
private void FolderSettings_LayoutModeChangeRequested(object sender, LayoutModeEventArgs e)
367+
protected virtual void BaseFolderSettings_LayoutModeChangeRequested(object sender, LayoutModeEventArgs e)
368368
{
369369
if (ParentShellPageInstance.SlimContentPage != null)
370370
{
@@ -407,7 +407,7 @@ protected override async void OnNavigatedTo(NavigationEventArgs eventArgs)
407407
InitializeCommandsViewModel();
408408

409409
IsItemSelected = false;
410-
FolderSettings.LayoutModeChangeRequested += FolderSettings_LayoutModeChangeRequested;
410+
FolderSettings.LayoutModeChangeRequested += BaseFolderSettings_LayoutModeChangeRequested;
411411
FolderSettings.GroupOptionPreferenceUpdated += FolderSettings_GroupOptionPreferenceUpdated;
412412
ParentShellPageInstance.FilesystemViewModel.EmptyTextType = EmptyTextType.None;
413413
FolderSettings.SetLayoutInformation();
@@ -523,7 +523,7 @@ protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
523523
base.OnNavigatingFrom(e);
524524
// Remove item jumping handler
525525
Window.Current.CoreWindow.CharacterReceived -= Page_CharacterReceived;
526-
FolderSettings.LayoutModeChangeRequested -= FolderSettings_LayoutModeChangeRequested;
526+
FolderSettings.LayoutModeChangeRequested -= BaseFolderSettings_LayoutModeChangeRequested;
527527
FolderSettings.GroupOptionPreferenceUpdated -= FolderSettings_GroupOptionPreferenceUpdated;
528528
ItemContextMenuFlyout.Opening -= ItemContextFlyout_Opening;
529529
BaseContextMenuFlyout.Opening -= BaseContextFlyout_Opening;
@@ -988,7 +988,11 @@ protected void UninitializeDrag(UIElement element)
988988

989989
public readonly VirtualKey MinusKey = (VirtualKey)189;
990990

991-
public abstract void Dispose();
991+
public virtual void Dispose()
992+
{
993+
PreviewPaneViewModel?.Dispose();
994+
UnhookBaseEvents();
995+
}
992996

993997
protected void ItemsLayout_DragOver(object sender, DragEventArgs e)
994998
{

Files/Helpers/ContextFlyoutItemHelper.cs

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseLayoutMenuItems(Curren
205205
Text = "BaseLayoutContextFlyoutSortBy/Text".GetLocalized(),
206206
ColoredIcon = new ColoredIconModel()
207207
{
208-
BaseLayerGlyph = "\u0029",
209-
OverlayLayerGlyph = "\u002A",
208+
BaseLayerGlyph = "\uF029",
209+
OverlayLayerGlyph = "\uF02A",
210210
},
211211
ShowInRecycleBin = true,
212212
ShowInSearchPage = true,
@@ -479,13 +479,13 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseLayoutMenuItems(Curren
479479
new ContextMenuFlyoutItemViewModel()
480480
{
481481
Text = "BaseLayoutContextFlyoutPaste/Text".GetLocalized(),
482-
//Glyph = "\uE16D",
482+
// Glyph = "\uF16D",
483483
ShowInFtpPage = true,
484484
ShowInZipPage = true,
485485
ColoredIcon = new ColoredIconModel()
486486
{
487-
BaseLayerGlyph = "\u0023",
488-
OverlayLayerGlyph = "\u0024",
487+
BaseLayerGlyph = "\uF023",
488+
OverlayLayerGlyph = "\uF024",
489489
},
490490
Command = commandsViewModel.PasteItemsFromClipboardCommand,
491491
IsEnabled = currentInstanceViewModel.CanPasteInPage && App.MainViewModel.IsPasteEnabled,
@@ -499,7 +499,7 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseLayoutMenuItems(Curren
499499
new ContextMenuFlyoutItemViewModel()
500500
{
501501
Text = "BaseLayoutContextFlyoutOpenInTerminal/Text".GetLocalized(),
502-
Glyph = "\uE756",
502+
Glyph = "\uFE56",
503503
Command = commandsViewModel.OpenDirectoryInDefaultTerminalCommand,
504504
},
505505
new ContextMenuFlyoutItemViewModel()
@@ -513,8 +513,8 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseLayoutMenuItems(Curren
513513
Text = "BaseLayoutContextFlyoutNew/Label".GetLocalized(),
514514
ColoredIcon = new ColoredIconModel()
515515
{
516-
BaseLayerGlyph = "\u0037",
517-
OverlayLayerGlyph = "\u0038"
516+
BaseLayerGlyph = "\uF037",
517+
OverlayLayerGlyph = "\uF038"
518518
},
519519
KeyboardAccelerator = new KeyboardAccelerator
520520
{
@@ -565,8 +565,8 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseLayoutMenuItems(Curren
565565
Text = "BaseLayoutContextFlyoutPropertiesFolder/Text".GetLocalized(),
566566
ColoredIcon = new ColoredIconModel()
567567
{
568-
BaseLayerGlyph = "\u0031",
569-
OverlayLayerGlyph = "\u0032"
568+
BaseLayerGlyph = "\uF031",
569+
OverlayLayerGlyph = "\uF032"
570570
},
571571
Command = commandsViewModel.ShowFolderPropertiesCommand,
572572
ShowInFtpPage = true,
@@ -658,7 +658,7 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(BaseLayo
658658
new ContextMenuFlyoutItemViewModel()
659659
{
660660
Text = "BaseLayoutItemContextFlyoutOpenInNewPane/Text".GetLocalized(),
661-
Glyph = "\uF117",
661+
Glyph = "\uE117",
662662
GlyphFontFamilyName = "CustomGlyph",
663663
Command = commandsViewModel.OpenDirectoryInNewPaneCommand,
664664
ShowItem = App.AppSettings.IsDualPaneEnabled && selectedItems.All(i => i.PrimaryItemAttribute == Windows.Storage.StorageItemTypes.Folder),
@@ -742,8 +742,8 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(BaseLayo
742742
Text = "BaseLayoutItemContextFlyoutCut/Text".GetLocalized(),
743743
ColoredIcon = new ColoredIconModel()
744744
{
745-
BaseLayerGlyph = "\u003D",
746-
OverlayLayerGlyph = "\u003E",
745+
BaseLayerGlyph = "\uF03D",
746+
OverlayLayerGlyph = "\uF03E",
747747
},
748748
Command = commandsViewModel.CutItemCommand,
749749
IsPrimary = true,
@@ -760,11 +760,11 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(BaseLayo
760760
new ContextMenuFlyoutItemViewModel()
761761
{
762762
Text = "BaseLayoutItemContextFlyoutCopy/Text".GetLocalized(),
763-
//Glyph = "\uE8C8",
763+
//Glyph = "\uF8C8",
764764
ColoredIcon = new ColoredIconModel()
765765
{
766-
BaseLayerGlyph = "\u0021",
767-
OverlayLayerGlyph = "\u0022",
766+
BaseLayerGlyph = "\uF021",
767+
OverlayLayerGlyph = "\uF022",
768768
},
769769
Command = commandsViewModel.CopyItemCommand,
770770
ShowInRecycleBin = true,
@@ -784,8 +784,8 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(BaseLayo
784784
Text = "BaseLayoutItemContextFlyoutCopyLocation/Text".GetLocalized(),
785785
ColoredIcon = new ColoredIconModel()
786786
{
787-
BaseLayerGlyph = "\u002F",
788-
OverlayLayerGlyph = "\u0030"
787+
BaseLayerGlyph = "\uF02F",
788+
OverlayLayerGlyph = "\uF030"
789789
},
790790
Command = commandsViewModel.CopyPathOfSelectedItemCommand,
791791
SingleItemOnly = true,
@@ -796,12 +796,12 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(BaseLayo
796796
new ContextMenuFlyoutItemViewModel()
797797
{
798798
Text = "BaseLayoutContextFlyoutPaste/Text".GetLocalized(),
799-
//Glyph = "\uE16D",
799+
//Glyph = "\uF16D",
800800
IsPrimary = true,
801801
ColoredIcon = new ColoredIconModel()
802802
{
803-
BaseLayerGlyph = "\u0023",
804-
OverlayLayerGlyph = "\u0024",
803+
BaseLayerGlyph = "\uF023",
804+
OverlayLayerGlyph = "\uF024",
805805
},
806806
Command = commandsViewModel.PasteItemsFromClipboardCommand,
807807
ShowItem = selectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder),
@@ -822,8 +822,8 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(BaseLayo
822822
Text = "BaseLayoutItemContextFlyoutCreateFolderWithSelection/Text".GetLocalized(),
823823
ColoredIcon = new ColoredIconModel()
824824
{
825-
BaseLayerGlyph = "\u0033",
826-
OverlayLayerGlyph = "\u0034"
825+
BaseLayerGlyph = "\uF033",
826+
OverlayLayerGlyph = "\uF034"
827827
},
828828
Command = commandsViewModel.CreateFolderWithSelection,
829829
},
@@ -840,12 +840,12 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(BaseLayo
840840
new ContextMenuFlyoutItemViewModel()
841841
{
842842
Text = "BaseLayoutItemContextFlyoutRename/Text".GetLocalized(),
843-
//Glyph = "\uE8AC",
843+
//Glyph = "\uF8AC",
844844
IsPrimary = true,
845845
ColoredIcon = new ColoredIconModel()
846846
{
847-
BaseLayerGlyph = "\u0027",
848-
OverlayLayerGlyph = "\u0028",
847+
BaseLayerGlyph = "\uF027",
848+
OverlayLayerGlyph = "\uF028",
849849
},
850850
Command = commandsViewModel.RenameItemCommand,
851851
SingleItemOnly = true,
@@ -861,25 +861,25 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(BaseLayo
861861
new ContextMenuFlyoutItemViewModel()
862862
{
863863
Text = "BaseLayoutItemContextFlyoutShare/Text".GetLocalized(),
864-
//Glyph = "\uE72D",
864+
//Glyph = "\uF72D",
865865
IsPrimary = true,
866866
ColoredIcon = new ColoredIconModel()
867867
{
868-
BaseLayerGlyph = "\u0025",
869-
OverlayLayerGlyph = "\u0026",
868+
BaseLayerGlyph = "\uF025",
869+
OverlayLayerGlyph = "\uF026",
870870
},
871871
Command = commandsViewModel.ShareItemCommand,
872872
ShowItem = DataTransferManager.IsSupported() && !selectedItems.Any(i => i.IsHiddenItem || (i.IsShortcutItem && !i.IsLinkItem) || i.PrimaryItemAttribute == StorageItemTypes.Folder),
873873
},
874874
new ContextMenuFlyoutItemViewModel()
875875
{
876876
Text = "BaseLayoutItemContextFlyoutDelete/Text".GetLocalized(),
877-
//Glyph = "\uE74D",
877+
//Glyph = "\uF74D",
878878
IsPrimary = true,
879879
ColoredIcon = new ColoredIconModel()
880880
{
881-
BaseLayerGlyph = "\u0035",
882-
OverlayLayerGlyph = "\u0036"
881+
BaseLayerGlyph = "\uF035",
882+
OverlayLayerGlyph = "\uF036"
883883
},
884884
Command = commandsViewModel.DeleteItemCommand,
885885
ShowInRecycleBin = true,
@@ -895,12 +895,12 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(BaseLayo
895895
new ContextMenuFlyoutItemViewModel()
896896
{
897897
Text = "BaseLayoutItemContextFlyoutProperties/Text".GetLocalized(),
898-
//Glyph = "\uE946",
898+
//Glyph = "\uF946",
899899
IsPrimary = true,
900900
ColoredIcon = new ColoredIconModel()
901901
{
902-
BaseLayerGlyph = "\u0031",
903-
OverlayLayerGlyph = "\u0032"
902+
BaseLayerGlyph = "\uF031",
903+
OverlayLayerGlyph = "\uF032"
904904
},
905905
Command = commandsViewModel.ShowPropertiesCommand,
906906
ShowInRecycleBin = true,
@@ -976,7 +976,7 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(BaseLayo
976976
Glyph = "\uE840",
977977
Command = commandsViewModel.PinItemToStartCommand,
978978
ShowOnShift = true,
979-
ShowItem = selectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder && !x.IsZipItem && !x.IsItemPinnedToStart),
979+
ShowItem = selectedItems.All(x => !x.IsShortcutItem && x.PrimaryItemAttribute == StorageItemTypes.Folder && !x.IsZipItem && !x.IsItemPinnedToStart),
980980
ShowInSearchPage = true,
981981
ShowInFtpPage = true,
982982
SingleItemOnly = true,
@@ -987,7 +987,7 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(BaseLayo
987987
Glyph = "\uE77A",
988988
Command = commandsViewModel.UnpinItemFromStartCommand,
989989
ShowOnShift = true,
990-
ShowItem = selectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder && !x.IsZipItem && x.IsItemPinnedToStart),
990+
ShowItem = selectedItems.All(x => !x.IsShortcutItem && x.PrimaryItemAttribute == StorageItemTypes.Folder && !x.IsZipItem && x.IsItemPinnedToStart),
991991
ShowInSearchPage = true,
992992
ShowInFtpPage = true,
993993
SingleItemOnly = true,

Files/IShellPage.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public interface IShellPage : ITabItemContent, IMultiPaneInfo, IDisposable
5959
public interface IPaneHolder : IDisposable, INotifyPropertyChanged
6060
{
6161
public IShellPage ActivePane { get; set; }
62+
public IShellPage ActivePaneOrColumn { get; } // if column view, returns the last column shell page, otherwise returns the active pane normally
6263
public IFilesystemHelpers FilesystemHelpers { get; }
6364
public TabItemArguments TabItemArguments { get; set; }
6465

Files/Strings/en-US/Resources.resw

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2562,7 +2562,7 @@
25622562
<data name="PropertySyncStatus" xml:space="preserve">
25632563
<value>Sync status</value>
25642564
</data>
2565-
<data name="PreviewPaneLoadCloudItemButton.Content" xml:space="preserve">
2565+
<data name="PreviewPaneLoadCloudItemButton.Text" xml:space="preserve">
25662566
<value>Load full preview</value>
25672567
</data>
25682568
<data name="PreviewPaneLoadCloudItemButton.ToolTipService.ToolTip" xml:space="preserve">
@@ -2788,6 +2788,9 @@ We use App Center to keep track of app usage, find bugs, and fix crashes. All in
27882788
<data name="NoSearchResultsFound" xml:space="preserve">
27892789
<value>No items found</value>
27902790
</data>
2791+
<data name="PreviewPaneShowPreviewOnly.Text" xml:space="preserve">
2792+
<value>Show preview only</value>
2793+
</data>
27912794
<data name="OpenLogLocation.Title" xml:space="preserve">
27922795
<value>Open log location</value>
27932796
</data>

Files/UserControls/FilePreviews/BasicPreview.xaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,18 @@
99
d:DesignWidth="400"
1010
mc:Ignorable="d">
1111

12-
<Grid>
13-
<Viewbox StretchDirection="DownOnly">
14-
<ContentPresenter CornerRadius="{StaticResource ControlCornerRadius}">
15-
<Image Source="{x:Bind Model.FileImage}" />
16-
</ContentPresenter>
12+
<Grid
13+
HorizontalAlignment="Center"
14+
VerticalAlignment="Center"
15+
CornerRadius="{StaticResource ControlCornerRadius}">
16+
<Viewbox
17+
HorizontalAlignment="Stretch"
18+
VerticalAlignment="Stretch"
19+
StretchDirection="DownOnly">
20+
<Image
21+
HorizontalAlignment="Stretch"
22+
VerticalAlignment="Stretch"
23+
Source="{x:Bind Model.FileImage}" />
1724
</Viewbox>
1825
</Grid>
1926
</UserControl>

Files/UserControls/FilePreviews/FolderPreview.xaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
d:DesignWidth="400"
1010
mc:Ignorable="d">
1111

12-
<Grid>
12+
<Grid
13+
HorizontalAlignment="Center"
14+
VerticalAlignment="Center"
15+
CornerRadius="{StaticResource ControlCornerRadius}">
1316
<Viewbox StretchDirection="DownOnly">
14-
<ContentPresenter CornerRadius="{StaticResource ControlCornerRadius}">
15-
<Image Source="{x:Bind Model.Thumbnail}" />
16-
</ContentPresenter>
17+
<Image Source="{x:Bind Model.Thumbnail}" />
1718
</Viewbox>
1819
</Grid>
1920
</UserControl>

Files/UserControls/FilePreviews/HtmlPreview.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
<Grid
1313
x:Name="RootGrid"
1414
HorizontalAlignment="Stretch"
15-
VerticalAlignment="Stretch">
15+
VerticalAlignment="Stretch"
16+
CornerRadius="{StaticResource ControlCornerRadius}">
1617
<WebView
1718
x:Name="WebViewControl"
1819
HorizontalAlignment="Stretch"

Files/UserControls/FilePreviews/ImagePreview.xaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88
d:DesignHeight="300"
99
d:DesignWidth="400"
1010
mc:Ignorable="d">
11-
<Viewbox StretchDirection="DownOnly">
12-
<ContentPresenter CornerRadius="{StaticResource ControlCornerRadius}">
11+
<Grid
12+
HorizontalAlignment="Center"
13+
VerticalAlignment="Center"
14+
CornerRadius="{StaticResource ControlCornerRadius}">
15+
<Viewbox StretchDirection="DownOnly">
1316
<Image Source="{x:Bind ViewModel.ImageSource, Mode=OneWay}" />
14-
</ContentPresenter>
15-
</Viewbox>
17+
</Viewbox>
18+
</Grid>
1619
</UserControl>

Files/UserControls/FilePreviews/MediaPreview.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
Unloaded="{x:Bind ViewModel.PreviewControlBase_Unloaded}"
1111
mc:Ignorable="d">
1212

13-
<Grid>
13+
<Grid CornerRadius="{StaticResource ControlCornerRadius}">
1414
<MediaPlayerElement
1515
x:Name="PlayerContext"
1616
AreTransportControlsEnabled="True"
17+
Background="Transparent"
1718
Foreground="Transparent"
1819
Source="{x:Bind ViewModel.Source, Mode=OneWay}">
1920
<MediaPlayerElement.TransportControls>

0 commit comments

Comments
 (0)