Skip to content
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

Tiny nits for winget #378

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public partial class ProgressViewModel : ExtensionObjectViewModel

public uint ProgressPercent { get; private set; }

public double ProgressValue => ProgressPercent / 100.0;

public ProgressViewModel(IProgressState progress, IPageContext context)
: base(context)
{
Expand Down Expand Up @@ -64,7 +62,6 @@ protected virtual void FetchProperty(string propertyName)
break;
case nameof(ProgressPercent):
this.ProgressPercent = model.ProgressPercent;
UpdateProperty(nameof(ProgressValue));
break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@
Margin="0,-20,0,0"
IsIndeterminate="{x:Bind ViewModel.CurrentPage.MostRecentStatusMessage.Progress.IsIndeterminate, Mode=OneWay}"
Visibility="{x:Bind ViewModel.CurrentPage.MostRecentStatusMessage.HasProgress, Mode=OneWay}"
Value="{x:Bind ViewModel.CurrentPage.MostRecentStatusMessage.Progress.ProgressValue, Mode=OneWay}" />
Value="{x:Bind ViewModel.CurrentPage.MostRecentStatusMessage.Progress.ProgressPercent, Mode=OneWay}" />
<!-- Margin="0,0,0,6" MaxWidth="200"/> -->
</InfoBar.Content>
</InfoBar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ private void OnInstallProgress(
{
downloadText += $"{FormatBytes(progress.BytesDownloaded)} of {FormatBytes(progress.BytesRequired)}";
_installBanner.Progress ??= new ProgressState() { IsIndeterminate = false };
((ProgressState)_installBanner.Progress).ProgressPercent = (uint)(progress.BytesDownloaded / progress.BytesRequired * 100);
var downloaded = (float)progress.BytesDownloaded / (float)progress.BytesRequired;
var percent = downloaded * 100.0f;
((ProgressState)_installBanner.Progress).ProgressPercent = (uint)percent;
_installBanner.Message = downloadText;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ public InstallPackageListItem(CatalogPackage package)
{
var description = string.IsNullOrEmpty(metadata.Description) ? metadata.ShortDescription : metadata.Description;
var detailsBody = $"""
## {metadata.Publisher}

{metadata.Description}
{description}
""";
IconInfo heroIcon = new(string.Empty);
var icons = metadata.Icons;
Expand All @@ -64,7 +63,7 @@ public InstallPackageListItem(CatalogPackage package)

private List<IDetailsElement> GetDetailsMetadata(CatalogPackageMetadata metadata)
{
List<IDetailsElement> detailsElements = new();
List<IDetailsElement> detailsElements = [];

// key -> {text, url}
Dictionary<string, (string, string)> simpleData = new()
Expand Down
Loading