Skip to content

Commit 2601ac6

Browse files
authored
Reduce navigation bar item size to fit long translations (#4741)
1 parent 39fee73 commit 2601ac6

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/UniGetUI/Controls/CustomNavViewItem.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace UniGetUI.Controls;
1010

1111
internal sealed partial class CustomNavViewItem : NavigationViewItem
1212
{
13-
int _iconSize = 24;
13+
int _iconSize = 20;
1414
public IconType LocalIcon
1515
{
1616
set => base.Icon = new LocalIcon(value);
@@ -64,17 +64,17 @@ public string Text
6464

6565
public CustomNavViewItem()
6666
{
67-
Height = 54;
67+
Height = 48;
6868
Resources["NavigationViewItemOnLeftIconBoxHeight"] = _iconSize;
6969
Resources["NavigationViewItemContentPresenterMargin"] = new Thickness(0);
7070

7171
var grid = new Grid { Height = 44 };
7272

7373
_progressRing = new ProgressRing
7474
{
75-
Width = 24,
76-
Height = 24,
77-
Margin = new Thickness(-42, 0, 0, 0),
75+
Width = 20,
76+
Height = 20,
77+
Margin = new Thickness(-32, 0, 0, 0),
7878
HorizontalAlignment = HorizontalAlignment.Left,
7979
VerticalAlignment = VerticalAlignment.Center,
8080
IsIndeterminate = true,

src/UniGetUI/Pages/MainView.xaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@
271271
VerticalAlignment="Stretch"
272272
x:FieldModifier="public"
273273
CompactModeThresholdWidth="800"
274-
CompactPaneLength="68"
274+
CompactPaneLength="52"
275275
ExpandedModeThresholdWidth="1600"
276276
IsBackButtonVisible="Collapsed"
277277
IsPaneOpen="False"
@@ -290,7 +290,7 @@
290290
<NavigationView.MenuItems>
291291
<controls1:CustomNavViewItem
292292
x:Name="DiscoverNavBtn"
293-
FontSize="16"
293+
FontSize="14"
294294
FontWeight="SemiBold"
295295
GlyphIcon="&#xF6FA;"
296296
Tag="Discover"
@@ -299,7 +299,7 @@
299299

300300
<controls1:CustomNavViewItem
301301
x:Name="UpdatesNavBtn"
302-
FontSize="16"
302+
FontSize="14"
303303
FontWeight="SemiBold"
304304
GlyphIcon="&#xE895;"
305305
Tag="Updates"
@@ -311,15 +311,15 @@
311311
</controls1:CustomNavViewItem>
312312
<controls1:CustomNavViewItem
313313
x:Name="InstalledNavBtn"
314-
FontSize="16"
314+
FontSize="14"
315315
FontWeight="SemiBold"
316316
GlyphIcon="&#xE977;"
317317
Tag="Installed"
318318
Text="Installed Packages"
319319
/>
320320
<controls1:CustomNavViewItem
321321
x:Name="BundlesNavBtn"
322-
FontSize="16"
322+
FontSize="14"
323323
FontWeight="SemiBold"
324324
GlyphIcon="&#xF133;"
325325
Tag="Bundles"
@@ -375,7 +375,7 @@
375375
/>
376376
</NavigationView.FooterMenuItems>
377377
<NavigationView.PaneFooter>
378-
<services:UserAvatar Margin="12,4,12,8" />
378+
<services:UserAvatar Margin="6,4,6,8" />
379379
</NavigationView.PaneFooter>
380380

381381
<Grid Name="ContentGrid" Grid.Row="0" Grid.Column="1" Margin="8,8,8,8" RowSpacing="0">

src/UniGetUI/Services/UserAvatar.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private void SetLoading()
120120

121121
private PointButton GenerateLoginControl()
122122
{
123-
var personPicture = new PersonPicture { Width = 36, Height = 36 };
123+
var personPicture = new PersonPicture { Width = 32, Height = 32 };
124124

125125
var translatedTextBlock = new TextBlock
126126
{
@@ -208,8 +208,8 @@ private async Task<PointButton> GenerateLogoutControl()
208208

209209
var personPicture = new PersonPicture
210210
{
211-
Width = 36,
212-
Height = 36,
211+
Width = 32,
212+
Height = 32,
213213
ProfilePicture = new BitmapImage(new Uri(user.AvatarUrl)),
214214
};
215215

0 commit comments

Comments
 (0)