From 3beb15626462a7e0a995c30ac8161276f0428c1f Mon Sep 17 00:00:00 2001
From: Yair <39923744+yaira2@users.noreply.github.com>
Date: Mon, 6 Feb 2023 20:25:50 -0500
Subject: [PATCH 1/2] Feature: Cleaned up extra xaml
---
.../UserControls/Widgets/DrivesWidget.xaml | 387 +++++++++---------
.../Widgets/QuickAccessWidget.xaml | 265 ++++++------
.../Widgets/RecentFilesWidget.xaml | 21 +-
.../Widgets/RecentFilesWidget.xaml.cs | 18 +-
src/Files.App/Views/SettingsPages/About.xaml | 8 +-
.../Views/SettingsPages/Appearance.xaml | 2 +-
.../Views/SettingsPages/Preferences.xaml | 2 +-
7 files changed, 346 insertions(+), 357 deletions(-)
diff --git a/src/Files.App/UserControls/Widgets/DrivesWidget.xaml b/src/Files.App/UserControls/Widgets/DrivesWidget.xaml
index 2d3ee26ccbf9..eafed80d7ae7 100644
--- a/src/Files.App/UserControls/Widgets/DrivesWidget.xaml
+++ b/src/Files.App/UserControls/Widgets/DrivesWidget.xaml
@@ -6,208 +6,205 @@
xmlns:helpers="using:Files.App.Helpers"
xmlns:local="using:Files.App.UserControls.Widgets"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- Background="{ThemeResource SolidBackgroundFillColorBaseBrush}"
mc:Ignorable="d">
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/src/Files.App/UserControls/Widgets/QuickAccessWidget.xaml b/src/Files.App/UserControls/Widgets/QuickAccessWidget.xaml
index 7faeb5718242..fa7c734c42db 100644
--- a/src/Files.App/UserControls/Widgets/QuickAccessWidget.xaml
+++ b/src/Files.App/UserControls/Widgets/QuickAccessWidget.xaml
@@ -6,141 +6,134 @@
xmlns:helpers="using:Files.App.Helpers"
xmlns:local="using:Files.App.UserControls.Widgets"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- Background="{ThemeResource SolidBackgroundFillColorBaseBrush}"
mc:Ignorable="d">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml b/src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml
index 41492c90a3dc..c621d15b392f 100644
--- a/src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml
+++ b/src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml
@@ -10,26 +10,28 @@
Background="{ThemeResource SolidBackgroundFillColorBaseBrush}"
mc:Ignorable="d">
-
+
+
+ Severity="Warning" />
+
+
+ TextWrapping="WrapWholeWords" />
+
+
diff --git a/src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml.cs b/src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml.cs
index a161f6215bc2..9338f1284c1b 100644
--- a/src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml.cs
+++ b/src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml.cs
@@ -50,16 +50,16 @@ public sealed partial class RecentFilesWidget : UserControl, IWidgetItemModel, I
public MenuFlyoutItem? MenuFlyoutItem => null;
- private Visibility emptyRecentsTextVisibility = Visibility.Collapsed;
- public Visibility EmptyRecentsTextVisibility
+ private bool isEmptyRecentsTextVisible = false;
+ public bool IsEmptyRecentsTextVisible
{
- get => emptyRecentsTextVisibility;
+ get => isEmptyRecentsTextVisible;
internal set
{
- if (emptyRecentsTextVisibility != value)
+ if (isEmptyRecentsTextVisible != value)
{
- emptyRecentsTextVisibility = value;
- NotifyPropertyChanged(nameof(EmptyRecentsTextVisibility));
+ isEmptyRecentsTextVisible = value;
+ NotifyPropertyChanged(nameof(IsEmptyRecentsTextVisible));
}
}
}
@@ -138,7 +138,7 @@ private async Task UpdateRecentsList(NotifyCollectionChangedEventArgs e)
refreshRecentsCTS.Cancel();
refreshRecentsCTS = new CancellationTokenSource();
- EmptyRecentsTextVisibility = Visibility.Collapsed;
+ IsEmptyRecentsTextVisible = false;
switch (e.Action)
{
@@ -184,7 +184,7 @@ private async Task UpdateRecentsList(NotifyCollectionChangedEventArgs e)
// update chevron if there aren't any items
if (recentItemsCollection.Count == 0 && !IsRecentFilesDisabledInWindows)
{
- EmptyRecentsTextVisibility = Visibility.Visible;
+ IsEmptyRecentsTextVisible = true;
}
}
catch (Exception ex)
@@ -253,7 +253,7 @@ private async void ClearRecentItems_Click(object sender, RoutedEventArgs e)
if (success)
{
- EmptyRecentsTextVisibility = Visibility.Visible;
+ IsEmptyRecentsTextVisible = true;
}
}
finally
diff --git a/src/Files.App/Views/SettingsPages/About.xaml b/src/Files.App/Views/SettingsPages/About.xaml
index adf0b3473c7e..b0e8ae022aeb 100644
--- a/src/Files.App/Views/SettingsPages/About.xaml
+++ b/src/Files.App/Views/SettingsPages/About.xaml
@@ -37,13 +37,11 @@
-
+
-
-
+
+
diff --git a/src/Files.App/Views/SettingsPages/Appearance.xaml b/src/Files.App/Views/SettingsPages/Appearance.xaml
index cc8b9c5159a1..8b59065fdc1a 100644
--- a/src/Files.App/Views/SettingsPages/Appearance.xaml
+++ b/src/Files.App/Views/SettingsPages/Appearance.xaml
@@ -185,7 +185,7 @@
IsOn="{x:Bind ViewModel.DisplayEditTagsMenu, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
-
+
diff --git a/src/Files.App/Views/SettingsPages/Preferences.xaml b/src/Files.App/Views/SettingsPages/Preferences.xaml
index d0c9c1b7d9ef..600627677071 100644
--- a/src/Files.App/Views/SettingsPages/Preferences.xaml
+++ b/src/Files.App/Views/SettingsPages/Preferences.xaml
@@ -245,7 +245,7 @@
IsOn="{x:Bind ViewModel.ShowBundlesWidget, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
-
+
Date: Mon, 6 Feb 2023 22:49:12 -0500
Subject: [PATCH 2/2] Ongoing tasks
---
src/Files.App/Strings/en-US/Resources.resw | 7 +-
.../UserControls/AddressToolbar.xaml | 84 +++--
.../UserControls/OngoingTasksFlyout.xaml | 307 +++++-------------
.../ViewModels/StatusCenterViewModel.cs | 48 +--
4 files changed, 134 insertions(+), 312 deletions(-)
diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw
index 6da36f9ac06a..c11daee4acfa 100644
--- a/src/Files.App/Strings/en-US/Resources.resw
+++ b/src/Files.App/Strings/en-US/Resources.resw
@@ -1893,11 +1893,8 @@
canceling
-
- Dismiss
-
-
- Dismiss
+
+ Clear
Widgets
diff --git a/src/Files.App/UserControls/AddressToolbar.xaml b/src/Files.App/UserControls/AddressToolbar.xaml
index d31f4523b32c..b6734e747c91 100644
--- a/src/Files.App/UserControls/AddressToolbar.xaml
+++ b/src/Files.App/UserControls/AddressToolbar.xaml
@@ -215,50 +215,46 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+ FontSize="10" />
-
-
-
-
-
-
-
-
-
+ FontSize="10" />
+
diff --git a/src/Files.App/ViewModels/StatusCenterViewModel.cs b/src/Files.App/ViewModels/StatusCenterViewModel.cs
index 9c6c87d89d95..f112e9c6b48d 100644
--- a/src/Files.App/ViewModels/StatusCenterViewModel.cs
+++ b/src/Files.App/ViewModels/StatusCenterViewModel.cs
@@ -335,9 +335,7 @@ public ReturnResult Status
public string Message { get; private set; }
- public SolidColorBrush StrokeColor { get; private set; } = new SolidColorBrush(Colors.DeepSkyBlue);
-
- public IconSource GlyphSource { get; private set; }
+ public InfoBarSeverity InfoBarSeverity { get; private set; } = InfoBarSeverity.Informational;
public string PrimaryButtonText { get; set; }
@@ -388,52 +386,26 @@ public StatusBanner(string message, string title, float progress, ReturnResult s
{
case FileOperationType.Extract:
Title = "ExtractInProgress/Title".GetLocalizedResource();
- GlyphSource = new FontIconSource()
- {
- FontFamily = Application.Current.Resources["CustomGlyph"] as FontFamily,
- Glyph = "\xF11A" // Extract glyph
- };
break;
case FileOperationType.Copy:
Title = "CopyInProgress/Title".GetLocalizedResource();
- GlyphSource = new FontIconSource()
- {
- Glyph = "\xE8C8" // Copy glyph
- };
break;
case FileOperationType.Move:
Title = "MoveInProgress".GetLocalizedResource();
- GlyphSource = new FontIconSource()
- {
- Glyph = "\xE77F" // Move glyph
- };
break;
case FileOperationType.Delete:
Title = "DeleteInProgress/Title".GetLocalizedResource();
- GlyphSource = new FontIconSource()
- {
- Glyph = "\xE74D" // Delete glyph
- };
break;
case FileOperationType.Recycle:
Title = "RecycleInProgress/Title".GetLocalizedResource();
- GlyphSource = new FontIconSource()
- {
- FontFamily = Application.Current.Resources["RecycleBinIcons"] as FontFamily,
- Glyph = "\xEF87" // RecycleBin Custom Glyph
- };
break;
case FileOperationType.Prepare:
Title = "PrepareInProgress".GetLocalizedResource();
- GlyphSource = new FontIconSource()
- {
- Glyph = "\xE89A"
- };
break;
}
}
@@ -449,11 +421,7 @@ public StatusBanner(string message, string title, float progress, ReturnResult s
else
{
FullTitle = Title;
- StrokeColor = new SolidColorBrush(Colors.Green);
- GlyphSource = new FontIconSource()
- {
- Glyph = "\xE73E" // CheckMark glyph
- };
+ InfoBarSeverity = InfoBarSeverity.Success;
}
break;
@@ -468,11 +436,7 @@ public StatusBanner(string message, string title, float progress, ReturnResult s
{
// Expanded banner
FullTitle = Title;
- StrokeColor = new SolidColorBrush(Colors.Red);
- GlyphSource = new FontIconSource()
- {
- Glyph = "\xE783" // Error glyph
- };
+ InfoBarSeverity = InfoBarSeverity.Error;
}
break;
}
@@ -509,11 +473,7 @@ public StatusBanner(string message, string title, string primaryButtonText, stri
// Expanded banner
FullTitle = Title;
- StrokeColor = new SolidColorBrush(Colors.Red);
- GlyphSource = new FontIconSource()
- {
- Glyph = "\xE783" // Error glyph
- };
+ InfoBarSeverity = InfoBarSeverity.Error;
}
}