From dfd00ea6fee237a847997f6738240921d9a42651 Mon Sep 17 00:00:00 2001 From: Quaint Mako <110472580+QuaintMako@users.noreply.github.com> Date: Tue, 6 Jun 2023 15:05:58 +0200 Subject: [PATCH 1/7] Using custom font in preview pane + small clean --- src/Files.App/Constants.cs | 5 +++++ src/Files.App/Helpers/AppThemeResourcesHelper.cs | 8 ++++---- src/Files.App/UserControls/Pane/PreviewPane.xaml | 10 +++++++--- .../ViewModels/Previews/FolderPreviewViewModel.cs | 5 ++--- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/Files.App/Constants.cs b/src/Files.App/Constants.cs index 21a49473e83a..9949b8a45786 100644 --- a/src/Files.App/Constants.cs +++ b/src/Files.App/Constants.cs @@ -103,6 +103,11 @@ public static class UI public const double ContextMenuItemsMaxWidth = 250; } + public static class Appearance + { + public const string StandardFont = "Segoe UI Variable"; + } + public static class Browser { public static class GridViewBrowser diff --git a/src/Files.App/Helpers/AppThemeResourcesHelper.cs b/src/Files.App/Helpers/AppThemeResourcesHelper.cs index 1ab2d3a85284..abd162aed5ce 100644 --- a/src/Files.App/Helpers/AppThemeResourcesHelper.cs +++ b/src/Files.App/Helpers/AppThemeResourcesHelper.cs @@ -25,22 +25,22 @@ public static void LoadAppResources(this IResourcesService service, IAppearanceS service.SetCompactSpacing(useCompactStyles); service.SetAppThemeBackgroundColor(appThemeBackgroundColor.FromWindowsColor()); - if (!String.IsNullOrWhiteSpace(appThemeAddressBarBackgroundColor) && appThemeAddressBarBackgroundColor != "#00000000") + if (!string.IsNullOrWhiteSpace(appThemeAddressBarBackgroundColor) && appThemeAddressBarBackgroundColor != "#00000000") service.SetAppThemeAddressBarBackgroundColor(ColorHelper.ToColor(appThemeAddressBarBackgroundColor).FromWindowsColor()); else appearance.AppThemeAddressBarBackgroundColor = ""; //migrate to new default - if (!String.IsNullOrWhiteSpace(appThemeSidebarBackgroundColor) && appThemeAddressBarBackgroundColor != "#00000000") + if (!string.IsNullOrWhiteSpace(appThemeSidebarBackgroundColor) && appThemeAddressBarBackgroundColor != "#00000000") service.SetAppThemeSidebarBackgroundColor(ColorHelper.ToColor(appThemeSidebarBackgroundColor).FromWindowsColor()); else appearance.AppThemeSidebarBackgroundColor = ""; //migrate to new default - if (!String.IsNullOrWhiteSpace(appThemeFileAreaBackgroundColor) && appThemeAddressBarBackgroundColor != "#00000000") + if (!string.IsNullOrWhiteSpace(appThemeFileAreaBackgroundColor) && appThemeAddressBarBackgroundColor != "#00000000") service.SetAppThemeFileAreaBackgroundColor(ColorHelper.ToColor(appThemeFileAreaBackgroundColor).FromWindowsColor()); else appearance.AppThemeFileAreaBackgroundColor = ""; //migrate to new default - if (appThemeFontFamily != "Segoe UI Variable") + if (appThemeFontFamily != Constants.Appearance.StandardFont) service.SetAppThemeFontFamily(appThemeFontFamily); service.ApplyResources(); diff --git a/src/Files.App/UserControls/Pane/PreviewPane.xaml b/src/Files.App/UserControls/Pane/PreviewPane.xaml index f9396d0ab7c3..effd8c58b915 100644 --- a/src/Files.App/UserControls/Pane/PreviewPane.xaml +++ b/src/Files.App/UserControls/Pane/PreviewPane.xaml @@ -112,6 +112,10 @@ + @@ -181,7 +185,7 @@ HorizontalAlignment="Center" VerticalAlignment="Center" Text="{x:Bind GetLocalizedResource('NoItemSelected')}" - TextWrapping="WrapWholeWords" /> + TextWrapping="WrapWholeWords" /> - diff --git a/src/Files.App/ViewModels/Previews/FolderPreviewViewModel.cs b/src/Files.App/ViewModels/Previews/FolderPreviewViewModel.cs index cc94f639b93a..bbac905ac2f3 100644 --- a/src/Files.App/ViewModels/Previews/FolderPreviewViewModel.cs +++ b/src/Files.App/ViewModels/Previews/FolderPreviewViewModel.cs @@ -47,10 +47,9 @@ private async Task LoadPreviewAndDetailsAsync() GetFileProperty("PropertyDateModified", dateTimeFormatter.ToLongLabel(info.DateModified)), GetFileProperty("PropertyDateCreated", dateTimeFormatter.ToLongLabel(info.ItemDate)), GetFileProperty("PropertyItemPathDisplay", Folder.Path), + GetFileProperty("FileTags", + Item.FileTagsUI is not null ? string.Join(',', Item.FileTagsUI.Select(x => x.Name)) : null) }; - - Item.FileDetails.Add(GetFileProperty("FileTags", - Item.FileTagsUI is not null ? string.Join(',', Item.FileTagsUI.Select(x => x.Name)) : null)); } private static FileProperty GetFileProperty(string nameResource, object value) From b1d4d3e73c103b40f86236ec6c498f9d23112c62 Mon Sep 17 00:00:00 2001 From: Quaint Mako <110472580+QuaintMako@users.noreply.github.com> Date: Tue, 6 Jun 2023 16:18:05 +0200 Subject: [PATCH 2/7] Update PreviewPane.xaml --- src/Files.App/UserControls/Pane/PreviewPane.xaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Files.App/UserControls/Pane/PreviewPane.xaml b/src/Files.App/UserControls/Pane/PreviewPane.xaml index effd8c58b915..e9a1d0280eca 100644 --- a/src/Files.App/UserControls/Pane/PreviewPane.xaml +++ b/src/Files.App/UserControls/Pane/PreviewPane.xaml @@ -185,7 +185,7 @@ HorizontalAlignment="Center" VerticalAlignment="Center" Text="{x:Bind GetLocalizedResource('NoItemSelected')}" - TextWrapping="WrapWholeWords" /> + TextWrapping="WrapWholeWords" /> - \ No newline at end of file + From f1ae5c10dd08118f061f383dda415a58545bebc1 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Wed, 7 Jun 2023 16:35:05 -0400 Subject: [PATCH 3/7] Update PreviewPane.xaml --- src/Files.App/UserControls/Pane/PreviewPane.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Files.App/UserControls/Pane/PreviewPane.xaml b/src/Files.App/UserControls/Pane/PreviewPane.xaml index e9a1d0280eca..dcd8fe9e2010 100644 --- a/src/Files.App/UserControls/Pane/PreviewPane.xaml +++ b/src/Files.App/UserControls/Pane/PreviewPane.xaml @@ -209,9 +209,9 @@ Date: Wed, 7 Jun 2023 22:55:21 -0400 Subject: [PATCH 4/7] Update PreviewPane.xaml --- src/Files.App/UserControls/Pane/PreviewPane.xaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Files.App/UserControls/Pane/PreviewPane.xaml b/src/Files.App/UserControls/Pane/PreviewPane.xaml index dcd8fe9e2010..be54a13b66cd 100644 --- a/src/Files.App/UserControls/Pane/PreviewPane.xaml +++ b/src/Files.App/UserControls/Pane/PreviewPane.xaml @@ -112,10 +112,6 @@ - @@ -236,8 +232,8 @@ From 92d142dfe00c88a891706011add4cbb92490ff01 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Wed, 7 Jun 2023 22:56:26 -0400 Subject: [PATCH 5/7] Revert "Update PreviewPane.xaml" This reverts commit c4fd97f77d6bdc47cc067a4e9ba2261bc823ed6c. --- src/Files.App/UserControls/Pane/PreviewPane.xaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Files.App/UserControls/Pane/PreviewPane.xaml b/src/Files.App/UserControls/Pane/PreviewPane.xaml index be54a13b66cd..dcd8fe9e2010 100644 --- a/src/Files.App/UserControls/Pane/PreviewPane.xaml +++ b/src/Files.App/UserControls/Pane/PreviewPane.xaml @@ -112,6 +112,10 @@ + @@ -232,8 +236,8 @@ From 1c2ae81b27cb4a0344b56ba21dc1981c925fd8b7 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Wed, 7 Jun 2023 22:57:14 -0400 Subject: [PATCH 6/7] Update PreviewPane.xaml --- src/Files.App/UserControls/Pane/PreviewPane.xaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Files.App/UserControls/Pane/PreviewPane.xaml b/src/Files.App/UserControls/Pane/PreviewPane.xaml index dcd8fe9e2010..64bbacc1176d 100644 --- a/src/Files.App/UserControls/Pane/PreviewPane.xaml +++ b/src/Files.App/UserControls/Pane/PreviewPane.xaml @@ -112,7 +112,7 @@ - @@ -237,7 +237,7 @@ HorizontalAlignment="Stretch" VerticalAlignment="Center" MaxLines="2" - Style="{StaticResource Local.FileDetailsRepeaterStyle}" + Style="{StaticResource Local.FileDetailsTextBlockStyle}" Text="{x:Bind Name, Mode=OneWay}" /> From c1cfd2c98bacb150bc659bcd0b51f491d392ea41 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Wed, 7 Jun 2023 22:57:29 -0400 Subject: [PATCH 7/7] Update PreviewPane.xaml --- src/Files.App/UserControls/Pane/PreviewPane.xaml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Files.App/UserControls/Pane/PreviewPane.xaml b/src/Files.App/UserControls/Pane/PreviewPane.xaml index 64bbacc1176d..b511fe17a6e8 100644 --- a/src/Files.App/UserControls/Pane/PreviewPane.xaml +++ b/src/Files.App/UserControls/Pane/PreviewPane.xaml @@ -112,6 +112,7 @@ +