diff --git a/src/NexusMods.App.UI/Assets/Pictograms/game-3d.svg b/src/NexusMods.App.UI/Assets/Pictograms/game-3d.svg new file mode 100644 index 0000000000..a585fbda7e --- /dev/null +++ b/src/NexusMods.App.UI/Assets/Pictograms/game-3d.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/NexusMods.App.UI/Controls/EmptyState.cs b/src/NexusMods.App.UI/Controls/EmptyState.cs index 9396c7fe7f..bea5fed1b2 100644 --- a/src/NexusMods.App.UI/Controls/EmptyState.cs +++ b/src/NexusMods.App.UI/Controls/EmptyState.cs @@ -1,4 +1,5 @@ using Avalonia; +using Avalonia.Controls; using Avalonia.Controls.Metadata; using Avalonia.Controls.Primitives; using Avalonia.Metadata; @@ -9,6 +10,9 @@ namespace NexusMods.App.UI.Controls; [PseudoClasses(":active", ":icon")] public class EmptyState : TemplatedControl { + private TextBlock? _header; + private UnifiedIcon? _icon; + public static readonly StyledProperty IsActiveProperty = AvaloniaProperty.Register(nameof(IsActive)); public static readonly StyledProperty IconProperty = AvaloniaProperty.Register(nameof(Icon)); @@ -60,7 +64,8 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang { PseudoClasses.Add(":active"); } - } else if (change.Property == IconProperty) + } + else if (change.Property == IconProperty) { PseudoClasses.Remove(":icon"); @@ -68,8 +73,40 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang { PseudoClasses.Add(":icon"); } + + UpdateIconVisibility(); + } + else if (change.Property == HeaderProperty) + { + UpdateHeaderVisibility(); } base.OnPropertyChanged(change); } + + protected override void OnApplyTemplate(TemplateAppliedEventArgs e) + { + _header = e.NameScope.Find("HeaderTextBlock"); + _icon = e.NameScope.Find("Icon"); + + if (_header is not null) + UpdateHeaderVisibility(); + + if (_icon is not null) + UpdateIconVisibility(); + + base.OnApplyTemplate(e); + } + + private void UpdateHeaderVisibility() + { + if (_header is not null) + _header.IsVisible = !string.IsNullOrEmpty(Header); + } + + private void UpdateIconVisibility() + { + if (_icon is not null) + _icon.IsVisible = Icon is not null; + } } diff --git a/src/NexusMods.App.UI/Controls/GameWidget/GameWidget.axaml b/src/NexusMods.App.UI/Controls/GameWidget/GameWidget.axaml index bbb93bc294..444c5f89c6 100644 --- a/src/NexusMods.App.UI/Controls/GameWidget/GameWidget.axaml +++ b/src/NexusMods.App.UI/Controls/GameWidget/GameWidget.axaml @@ -76,7 +76,7 @@ Text="{x:Static resources:Language.GameWidget__Add_game}" LeftIcon="{x:Static icons:IconValues.Add}" ShowIcon="Left" - Type="Secondary" + Type="Primary" Fill="Strong" /> diff --git a/src/NexusMods.App.UI/Pages/LibraryPage/LibraryView.axaml b/src/NexusMods.App.UI/Pages/LibraryPage/LibraryView.axaml index d37a119b2c..8d12e32dd8 100644 --- a/src/NexusMods.App.UI/Pages/LibraryPage/LibraryView.axaml +++ b/src/NexusMods.App.UI/Pages/LibraryPage/LibraryView.axaml @@ -9,6 +9,7 @@ xmlns:resources="clr-namespace:NexusMods.App.UI.Resources" xmlns:icons="clr-namespace:NexusMods.Icons;assembly=NexusMods.Icons" xmlns:controls="clr-namespace:NexusMods.App.UI.Controls" + xmlns:navigation="clr-namespace:NexusMods.App.UI.Controls.Navigation" mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="450" x:Class="NexusMods.App.UI.Pages.LibraryPage.LibraryView"> @@ -79,18 +80,16 @@ - + - - - - More text - - - There is something here - - + + + There is something here + + + + There is something here + + + + + + + There is nothing here, you should better do something about this. + + More text + + + + There is something here + + + + @@ -45,24 +64,31 @@ + - + + + + +