Skip to content

Commit

Permalink
Update Package Bundle's filtered package count on package removel
Browse files Browse the repository at this point in the history
  • Loading branch information
hboyd2003 committed Jul 11, 2024
1 parent d93b91e commit f234569
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/UniGetUI/Interface/SoftwarePages/PackageBundle.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,27 @@ public void UpdateCount()
BackgroundText.Visibility = Packages.Count == 0 ? Visibility.Visible : Visibility.Collapsed;
MainApp.Instance.MainWindow.NavigationPage.BundleBadge.Value = Packages.Count;
MainApp.Instance.MainWindow.NavigationPage.BundleBadge.Visibility = Packages.Count == 0 ? Visibility.Collapsed : Visibility.Visible;
if (FilteredPackages.Count() == 0)
{
if (Packages.Count() == 0)
{
BackgroundText.Text = SourcesPlaceholderText.Text = CoreTools.AutoTranslated("We couldn't find any package");
SourcesPlaceholderText.Text = CoreTools.AutoTranslated("No packages found");
MainSubtitle.Text = CoreTools.AutoTranslated("No packages found");
}
else
{
BackgroundText.Text = CoreTools.AutoTranslated("No results were found matching the input criteria");
SourcesPlaceholderText.Text = CoreTools.AutoTranslated("No packages were found");
MainSubtitle.Text = CoreTools.Translate("{0} packages were found, {1} of which match the specified filters.", Packages.Count, FilteredPackages.Count);
}
BackgroundText.Visibility = Visibility.Visible;
}
else
{
BackgroundText.Visibility = Visibility.Collapsed;
MainSubtitle.Text = CoreTools.Translate("{0} packages were found, {1} of which match the specified filters.", Packages.Count, FilteredPackages.Count);
}
}

public void GenerateToolBar()
Expand Down Expand Up @@ -748,9 +769,7 @@ public void AddPackage(BundledPackage package)
{
Packages.Add(package);
AddPackageToSourcesList(package.Package);
BackgroundText.Visibility = Packages.Count == 0 ? Visibility.Visible : Visibility.Collapsed;
MainApp.Instance.MainWindow.NavigationPage.BundleBadge.Value = Packages.Count;
MainApp.Instance.MainWindow.NavigationPage.BundleBadge.Visibility = Packages.Count == 0 ? Visibility.Collapsed : Visibility.Visible;
UpdateCount();
FilterPackages(QueryBlock.Text.Trim());
}

Expand Down

1 comment on commit f234569

@hboyd2003
Copy link
Owner Author

@hboyd2003 hboyd2003 commented on f234569 Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.