-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Feature: Added speed graph to the status center #13359
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
Changes from all commits
Commits
Show all changes
128 commits
Select commit
Hold shift + click to select a range
91ee304
Initial commit
0x5bfa 96bdacc
Update
0x5bfa 1500997
Update
0x5bfa aecdae3
Merge branch 'main' into 5bfa/Add-TransferGraph
0x5bfa f757935
Update
0x5bfa 42435da
Merge branch 'main' into 5bfa/Add-TransferGraph
0x5bfa fcd3824
Update
0x5bfa 8da86e0
Merge branch '5bfa/Add-TransferGraph' of https://github.com/0x5bfa/Fi…
0x5bfa 67c03fa
Update
0x5bfa d20e14a
Speed calc
gave92 feaeea7
Update
0x5bfa 181552f
Update
0x5bfa 5405899
Update
0x5bfa 80b2e5f
Update src/Files.App/Utils/StatusCenter/StatusCenterItem.cs
0x5bfa 6f9fe76
Remove unncessary comments
0x5bfa 9c92da4
Merge branch '5bfa/Add-TransferGraph' of https://github.com/0x5bfa/Fi…
0x5bfa 7e6a86a
Merge commit 'refs/pull/13359/head' of https://github.com/files-commu…
gave92 9e65a23
Get progress percentage as double
gave92 5a3f7a4
Remove extra class
gave92 f43af45
Fixed build issues
0x5bfa e8322d2
fix
0x5bfa b90dd1f
Update
0x5bfa 80dad8a
Revert "Update"
0x5bfa 19c4d7c
Update
0x5bfa df148fd
Merge commit 'refs/pull/13359/head' of https://github.com/files-commu…
gave92 12840c5
No precalc size
gave92 9b1f9d5
Calc size in parallel
gave92 a672bfe
Fix size calc for files
gave92 6bd7157
Merge pull request #10 from gave92/rev_speed_2
0x5bfa 31687fc
Merge branch 'files-community:main' into 5bfa/Add-TransferGraph
0x5bfa 424c0eb
Fix
0x5bfa d0b5a98
Parallel size computation
hez2010 32261d4
Minor fixes
hez2010 3e9c62e
More fixes
hez2010 1a82f64
Merge pull request #11 from hez2010/parallel-size
0x5bfa 5e467ca
Update
0x5bfa 56ebe88
Fix merge conflicts
0x5bfa c3f9fe2
Update
0x5bfa 2355648
Fix graph
gave92 8f80a00
Removed unused out var
gave92 4eeb9ec
Merge pull request #12 from gave92/rev_speed_2
0x5bfa d86ed24
Update
0x5bfa c9bf35b
Update strings
0x5bfa c642589
Update
0x5bfa 206126f
Update
0x5bfa a2ca145
Fix
0x5bfa dc60e28
Update
0x5bfa 36ad647
Update
0x5bfa 548986e
Update
0x5bfa b815675
Update
0x5bfa f8b9f02
Fix spag errors
0x5bfa a83495c
Merge branch 'main' into 5bfa/Add-TransferGraph
yaira2 0bd9f06
Fix string resources
0x5bfa 2a43a50
Merge branch '5bfa/Add-TransferGraph' of https://github.com/0x5bfa/Fi…
0x5bfa 9e41d66
Update
0x5bfa 6721026
Update
0x5bfa bf64e2c
Update
0x5bfa 5ef9caf
Update
0x5bfa 4030e4a
Update
0x5bfa 9405e46
Update
0x5bfa 084d88f
Update src/Files.App/Strings/en-US/Resources.resw
0x5bfa badc814
Update src/Files.App/Strings/en-US/Resources.resw
0x5bfa 0af6aa8
Update src/Files.App/Strings/en-US/Resources.resw
0x5bfa a0cd7ce
Update src/Files.App/Strings/en-US/Resources.resw
0x5bfa 68bbe89
Update src/Files.App/Strings/en-US/Resources.resw
0x5bfa 743ffe9
Merge branch 'main' into 5bfa/Add-TransferGraph
0x5bfa 182060c
Update src/Files.App/Strings/en-US/Resources.resw
yaira2 3efb831
Update src/Files.App/Strings/en-US/Resources.resw
yaira2 8dabca3
Merge branch 'main' into 5bfa/Add-TransferGraph
yaira2 11fe156
Update
0x5bfa 7d6cf20
Merge branch '5bfa/Add-TransferGraph' of https://github.com/0x5bfa/Fi…
0x5bfa 33bc6fa
Update
0x5bfa f276637
Requested changes 1
0x5bfa 9af32cd
Requested changes
0x5bfa 0ccc821
Update
0x5bfa ef3ec5c
Update
0x5bfa 0dbfc5c
Update
0x5bfa c798203
Remove unused code
gave92 80a58c1
Show progress for extract
gave92 19d3247
Fix graph not updating each percentage
gave92 bd43685
Show progress for compress
gave92 70b5eed
Set icon for compressing
gave92 95b5d2e
Merge pull request #13 from gave92/rev_speed_2
0x5bfa 5a5c2a0
Update
0x5bfa cc242a0
Merge branch '5bfa/Add-TransferGraph' of https://github.com/0x5bfa/Fi…
0x5bfa 1c8910b
Update
0x5bfa 303962f
Fix icons
0x5bfa 27c1d76
Update string resources
0x5bfa f466774
Fix resources
0x5bfa 3d08efc
Update strings
0x5bfa 26ff8f1
Fix canceling when extracting archives
gave92 6e91d71
Added cancel state
0x5bfa cafdb49
Merge branch '5bfa/Add-TransferGraph' of https://github.com/0x5bfa/Fi…
0x5bfa 21cc808
Remove "Complete - " label from resources
0x5bfa 9371402
Merge branch 'main' into 5bfa/Add-TransferGraph
0x5bfa 0bb1c1d
Merge branch 'main' into 5bfa/Add-TransferGraph
yaira2 1992ca9
Merge branch 'main' into 5bfa/Add-TransferGraph
yaira2 04b4e7d
Added status center icon
yaira2 5d68ca4
Requested changes
0x5bfa fd1a074
Merge branch 'main' into 5bfa/Add-TransferGraph
0x5bfa 6f08389
Update strings
0x5bfa ca90ffc
Merge branch '5bfa/Add-TransferGraph' of https://github.com/0x5bfa/Fi…
0x5bfa a1f11fc
Add support for canceling compression. TODO: show proper status card
gave92 6574fbe
Update strings
yaira2 4585781
Merge branch 'main' into 5bfa/Add-TransferGraph
yaira2 92534b5
item(s)
yaira2 c232652
Merge branch '5bfa/Add-TransferGraph' of https://github.com/0x5bfa/Fi…
yaira2 fa475a1
Fix crash
yaira2 ffd91c1
Update Resources.resw
yaira2 c673772
merge main into here
0x5bfa 0e3e304
Update
0x5bfa cc3ccc4
Null check in string resources
0x5bfa aea031d
Fix resource mappings
0x5bfa 3aded1c
merge main into here
0x5bfa 9809a1a
Update StatusCenterItem.cs
0x5bfa 978a1f9
Update StatusCenterHelper.cs
hishitetsu 6f5f6df
Update Resources.resw
yaira2 8730448
Merge branch 'main' into 5bfa/Add-TransferGraph
yaira2 976bc19
Requested changes
0x5bfa a74f5c2
Update brush name
yaira2 d811433
Update icon name
yaira2 5932038
Fix
yaira2 2bbace3
Fix icon name
yaira2 7b43460
Merge remote-tracking branch 'upstream/main' into 5bfa/Add-TransferGraph
0x5bfa b337e2c
merge
0x5bfa 6bc2077
Fixed an issue wherer the backgroud fill and the series fill didn't m…
0x5bfa 463e1d5
merge main into here
0x5bfa 425d1ea
Fix cancellation of compression & extraction (#14)
gave92 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
src/Files.App/Converters/StatusCenterStateToBrushConverter.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
// Copyright (c) 2023 Files Community | ||
// Licensed under the MIT License. See the LICENSE. | ||
|
||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Data; | ||
using Microsoft.UI.Xaml.Media; | ||
|
||
namespace Files.App.Converters | ||
{ | ||
public class StatusCenterStateToBrushConverter : DependencyObject, IValueConverter | ||
{ | ||
public static readonly DependencyProperty InProgressBackgroundBrushProperty = | ||
DependencyProperty.Register(nameof(InProgressBackgroundBrush), typeof(SolidColorBrush), typeof(StatusCenterStateToBrushConverter), new PropertyMetadata(null)); | ||
|
||
public static readonly DependencyProperty InProgressForegroundBrushProperty = | ||
DependencyProperty.Register(nameof(InProgressForegroundBrush), typeof(SolidColorBrush), typeof(StatusCenterStateToBrushConverter), new PropertyMetadata(null)); | ||
|
||
public static readonly DependencyProperty SuccessfulBackgroundBrushProperty = | ||
DependencyProperty.Register(nameof(SuccessfulBackgroundBrush), typeof(SolidColorBrush), typeof(StatusCenterStateToBrushConverter), new PropertyMetadata(null)); | ||
|
||
public static readonly DependencyProperty SuccessfulForegroundBrushProperty = | ||
DependencyProperty.Register(nameof(SuccessfulForegroundBrush), typeof(SolidColorBrush), typeof(StatusCenterStateToBrushConverter), new PropertyMetadata(null)); | ||
|
||
public static readonly DependencyProperty ErrorBackgroundBrushProperty = | ||
DependencyProperty.Register(nameof(ErrorBackgroundBrush), typeof(SolidColorBrush), typeof(StatusCenterStateToBrushConverter), new PropertyMetadata(null)); | ||
|
||
public static readonly DependencyProperty ErrorForegroundBrushProperty = | ||
DependencyProperty.Register(nameof(ErrorForegroundBrush), typeof(SolidColorBrush), typeof(StatusCenterStateToBrushConverter), new PropertyMetadata(null)); | ||
|
||
public static readonly DependencyProperty CanceledBackgroundBrushProperty = | ||
DependencyProperty.Register(nameof(CanceledBackgroundBrush), typeof(SolidColorBrush), typeof(StatusCenterStateToBrushConverter), new PropertyMetadata(null)); | ||
|
||
public static readonly DependencyProperty CanceledForegroundBrushProperty = | ||
DependencyProperty.Register(nameof(CanceledForegroundBrush), typeof(SolidColorBrush), typeof(StatusCenterStateToBrushConverter), new PropertyMetadata(null)); | ||
|
||
public SolidColorBrush InProgressBackgroundBrush | ||
{ | ||
get => (SolidColorBrush)GetValue(InProgressBackgroundBrushProperty); | ||
set => SetValue(InProgressBackgroundBrushProperty, value); | ||
} | ||
|
||
public SolidColorBrush InProgressForegroundBrush | ||
{ | ||
get => (SolidColorBrush)GetValue(InProgressForegroundBrushProperty); | ||
set => SetValue(InProgressForegroundBrushProperty, value); | ||
} | ||
|
||
public SolidColorBrush SuccessfulBackgroundBrush | ||
{ | ||
get => (SolidColorBrush)GetValue(SuccessfulBackgroundBrushProperty); | ||
set => SetValue(SuccessfulBackgroundBrushProperty, value); | ||
} | ||
|
||
public SolidColorBrush SuccessfulForegroundBrush | ||
{ | ||
get => (SolidColorBrush)GetValue(SuccessfulForegroundBrushProperty); | ||
set => SetValue(SuccessfulForegroundBrushProperty, value); | ||
} | ||
|
||
public SolidColorBrush ErrorBackgroundBrush | ||
{ | ||
get => (SolidColorBrush)GetValue(ErrorBackgroundBrushProperty); | ||
set => SetValue(ErrorBackgroundBrushProperty, value); | ||
} | ||
|
||
public SolidColorBrush ErrorForegroundBrush | ||
{ | ||
get => (SolidColorBrush)GetValue(ErrorForegroundBrushProperty); | ||
set => SetValue(ErrorForegroundBrushProperty, value); | ||
} | ||
|
||
public SolidColorBrush CanceledBackgroundBrush | ||
{ | ||
get => (SolidColorBrush)GetValue(CanceledBackgroundBrushProperty); | ||
set => SetValue(CanceledBackgroundBrushProperty, value); | ||
} | ||
|
||
public SolidColorBrush CanceledForegroundBrush | ||
{ | ||
get => (SolidColorBrush)GetValue(CanceledForegroundBrushProperty); | ||
set => SetValue(CanceledForegroundBrushProperty, value); | ||
} | ||
|
||
public object? Convert(object value, Type targetType, object parameter, string language) | ||
{ | ||
if (value is StatusCenterItemKind state) | ||
{ | ||
if (bool.TryParse(parameter?.ToString(), out var isBackground) && isBackground) | ||
{ | ||
return state switch | ||
{ | ||
StatusCenterItemKind.InProgress => InProgressBackgroundBrush, | ||
StatusCenterItemKind.Successful => SuccessfulBackgroundBrush, | ||
StatusCenterItemKind.Error => ErrorBackgroundBrush, | ||
StatusCenterItemKind.Canceled => CanceledBackgroundBrush, | ||
_ => CanceledBackgroundBrush | ||
}; | ||
} | ||
else | ||
{ | ||
return state switch | ||
{ | ||
StatusCenterItemKind.InProgress => InProgressForegroundBrush, | ||
StatusCenterItemKind.Successful => SuccessfulForegroundBrush, | ||
StatusCenterItemKind.Error => ErrorForegroundBrush, | ||
StatusCenterItemKind.Canceled => CanceledForegroundBrush, | ||
_ => CanceledForegroundBrush | ||
}; | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, string language) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
src/Files.App/Converters/StatusCenterStateToStateIconConverter.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright (c) 2023 Files Community | ||
// Licensed under the MIT License. See the LICENSE. | ||
|
||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Data; | ||
using Microsoft.UI.Xaml.Markup; | ||
using Microsoft.UI.Xaml.Media; | ||
using Microsoft.UI.Xaml.Shapes; | ||
|
||
namespace Files.App.Converters | ||
{ | ||
class StatusCenterStateToStateIconConverter : IValueConverter | ||
{ | ||
public object? Convert(object value, Type targetType, object parameter, string language) | ||
{ | ||
if (value is StatusCenterItemIconKind state) | ||
{ | ||
var pathMarkup = state switch | ||
{ | ||
StatusCenterItemIconKind.Copy => Application.Current.Resources["App.Theme.PathIcon.ActionCopy"] as string, | ||
StatusCenterItemIconKind.Move => Application.Current.Resources["App.Theme.PathIcon.ActionMove"] as string, | ||
StatusCenterItemIconKind.Delete => Application.Current.Resources["App.Theme.PathIcon.ActionDelete"] as string, | ||
StatusCenterItemIconKind.Recycle => Application.Current.Resources["App.Theme.PathIcon.ActionDelete"] as string, | ||
StatusCenterItemIconKind.Extract => Application.Current.Resources["App.Theme.PathIcon.ActionExtract"] as string, | ||
StatusCenterItemIconKind.Compress => Application.Current.Resources["App.Theme.PathIcon.ActionExtract"] as string, | ||
StatusCenterItemIconKind.Successful => Application.Current.Resources["App.Theme.PathIcon.ActionSuccess"] as string, | ||
StatusCenterItemIconKind.Error => Application.Current.Resources["App.Theme.PathIcon.ActionInfo"] as string, | ||
_ => "" | ||
}; | ||
|
||
string xaml = @$"<Path xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""><Path.Data>{pathMarkup}</Path.Data></Path>"; | ||
|
||
if (XamlReader.Load(xaml) is not Path path) | ||
return null; | ||
|
||
// Initialize a new instance | ||
Geometry geometry = path.Data; | ||
|
||
// Destroy | ||
path.Data = null; | ||
|
||
return geometry; | ||
} | ||
|
||
return null; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, string language) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.