Skip to content

Commit 19c22d7

Browse files
committed
Add a description, as well as buttons
1 parent 255214d commit 19c22d7

2 files changed

Lines changed: 40 additions & 7 deletions

File tree

src/UniGetUI/Controls/PackageRanking.xaml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,35 @@
4747
<ColumnDefinition Width="1000*" MaxWidth="350"/>
4848
<ColumnDefinition Width="*"/>
4949
</Grid.ColumnDefinitions>
50-
<StackPanel Orientation="Vertical" Grid.Column="1">
51-
<widgets:TranslatedTextBlock HorizontalAlignment="Center" Text="Popular packages" FontWeight="Bold" FontSize="20" MinHeight="40"/>
50+
<StackPanel Orientation="Vertical" Grid.Column="1" Spacing="8">
51+
<widgets:TranslatedTextBlock HorizontalAlignment="Center" Text="Popular packages" FontWeight="Bold" FontSize="20" MinHeight="32"/>
52+
<RichTextBlock Name="PopularDescription" TextAlignment="Center">
53+
<Paragraph/>
54+
</RichTextBlock>
5255
<ItemsRepeater ItemTemplate="{StaticResource PackageRankingEntry}" ItemsSource="{x:Bind PopularRank}"/>
56+
<HyperlinkButton HorizontalAlignment="Stretch">
57+
<widgets:TranslatedTextBlock Text="View more packages"/>
58+
</HyperlinkButton>
5359
</StackPanel>
54-
<StackPanel Orientation="Vertical" Grid.Column="2">
55-
<widgets:TranslatedTextBlock HorizontalAlignment="Center" Text="The most installed" FontWeight="Bold" FontSize="20" MinHeight="40"/>
60+
<StackPanel Orientation="Vertical" Grid.Column="2" Spacing="8">
61+
<widgets:TranslatedTextBlock HorizontalAlignment="Center" Text="The most installed" FontWeight="Bold" FontSize="20" MinHeight="32"/>
62+
<RichTextBlock Name="InstalledDescription" TextAlignment="Center">
63+
<Paragraph/>
64+
</RichTextBlock>
5665
<ItemsRepeater ItemTemplate="{StaticResource PackageRankingEntry}" ItemsSource="{x:Bind InstalledRank}"/>
57-
66+
<HyperlinkButton HorizontalAlignment="Stretch" >
67+
<widgets:TranslatedTextBlock Text="View more packages"/>
68+
</HyperlinkButton>
5869
</StackPanel>
59-
<StackPanel Orientation="Vertical" Grid.Column="3">
60-
<widgets:TranslatedTextBlock HorizontalAlignment="Center" Text="The most uninstalled" FontWeight="Bold" FontSize="20" MinHeight="40"/>
70+
<StackPanel Orientation="Vertical" Grid.Column="3" Spacing="8">
71+
<widgets:TranslatedTextBlock HorizontalAlignment="Center" Text="The wall of shame" FontWeight="Bold" FontSize="20" MinHeight="32"/>
72+
<RichTextBlock Name="UninstalledDescription" TextAlignment="Center">
73+
<Paragraph/>
74+
</RichTextBlock>
6175
<ItemsRepeater ItemTemplate="{StaticResource PackageRankingEntry}" ItemsSource="{x:Bind WallOfShame}"/>
76+
<HyperlinkButton HorizontalAlignment="Stretch" >
77+
<widgets:TranslatedTextBlock Text="View more packages"/>
78+
</HyperlinkButton>
6279
</StackPanel>
6380
<Button VerticalAlignment="Top" HorizontalAlignment="Right" Grid.Column="4" Name="ReloadButton" Click="ReloadButton_Click">Reload</Button>
6481
<ProgressRing IsIndeterminate="True" Visibility="Collapsed" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="5" Width="100" Height="100" Name="ReloadRing"/>

src/UniGetUI/Controls/PackageRanking.xaml.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
using UniGetUI.Pages.DialogPages;
3030
using UniGetUI.Interface.Telemetry;
3131
using UniGetUI.PackageEngine.Enums;
32+
using Microsoft.UI.Xaml.Documents;
3233

3334
// To learn more about WinUI, the WinUI project structure,
3435
// and more about our project templates, see: http://aka.ms/winui-project-info.
@@ -44,6 +45,21 @@ public sealed partial class PackagesRanking : UserControl
4445
public PackagesRanking()
4546
{
4647
this.InitializeComponent();
48+
49+
(PopularDescription.Blocks[0] as Paragraph)?.Inlines.Add(new Run { Text = CoreTools.Translate("The most popular packages among UniGetUI users.") + " " });
50+
var link = new Hyperlink { NavigateUri = new Uri("about:blank") };
51+
link.Inlines.Add(new Run() { Text = CoreTools.Translate("More info") });
52+
(PopularDescription.Blocks[0] as Paragraph)?.Inlines.Add(link);
53+
54+
(InstalledDescription.Blocks[0] as Paragraph)?.Inlines.Add(new Run { Text = CoreTools.Translate("Packages installed the most through UniGetUI.") + " " });
55+
link = new Hyperlink { NavigateUri = new Uri("about:blank") };
56+
link.Inlines.Add(new Run() { Text = CoreTools.Translate("More info") });
57+
(InstalledDescription.Blocks[0] as Paragraph)?.Inlines.Add(link);
58+
59+
(UninstalledDescription.Blocks[0] as Paragraph)?.Inlines.Add(new Run { Text = CoreTools.Translate("Packages that have been uninstalled the most times through UniGetUI.") + " " });
60+
link = new Hyperlink { NavigateUri = new Uri("about:blank") };
61+
link.Inlines.Add(new Run() { Text = CoreTools.Translate("More info") });
62+
(UninstalledDescription.Blocks[0] as Paragraph)?.Inlines.Add(link);
4763
}
4864

4965
public void ReloadButton_Click(object sender, RoutedEventArgs e)

0 commit comments

Comments
 (0)