refactor: use icons from Icons.Avalonia

This commit is contained in:
estrogen elf
2025-06-13 23:31:17 -05:00
parent 79776ab848
commit 53a393ee1a
11 changed files with 21 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 938 B

View File

@@ -1,4 +1,6 @@
using BlossomiShymae.Briar; using Avalonia;
using Avalonia.Media;
using BlossomiShymae.Briar;
using BlossomiShymae.Briar.Utils; using BlossomiShymae.Briar.Utils;
using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input; using CommunityToolkit.Mvvm.Input;
@@ -123,7 +125,19 @@ public partial class MainWindowViewModel
{ {
Content = page.DisplayName, Content = page.DisplayName,
Tag = page, Tag = page,
IconSource = new BitmapIconSource() { UriSource = new Uri($"avares://NeedleworkDotNet/Assets/Icons/{page.Icon}.png") } IconSource = new ImageIconSource
{
Source = new Projektanker.Icons.Avalonia.IconImage()
{
Value = page.Icon,
Brush = new SolidColorBrush(Application.Current!.ActualThemeVariant.Key switch
{
"Light" => Colors.Black,
"Dark" => Colors.White,
_ => Colors.Gray
})
}
}
}; };
partial void OnSelectedNavigationViewItemChanged(NavigationViewItem value) partial void OnSelectedNavigationViewItemChanged(NavigationViewItem value)

View File

@@ -6,7 +6,7 @@ namespace Needlework.Net.ViewModels.Pages.About;
public partial class AboutViewModel : PageBase public partial class AboutViewModel : PageBase
{ {
public AboutViewModel() : base("About", "info-circle") public AboutViewModel() : base("About", "fa-solid fa-circle-info")
{ {
} }

View File

@@ -12,7 +12,7 @@ public partial class ConsoleViewModel : PageBase
{ {
private readonly DocumentService _documentService; private readonly DocumentService _documentService;
public ConsoleViewModel(DocumentService documentService, NotificationService notificationService) : base("Console", "terminal", -200) public ConsoleViewModel(DocumentService documentService, NotificationService notificationService) : base("Console", "fa-solid fa-terminal", -200)
{ {
_request = new(notificationService, Endpoints.Tab.LCU); _request = new(notificationService, Endpoints.Tab.LCU);
_documentService = documentService; _documentService = documentService;

View File

@@ -22,7 +22,7 @@ public partial class EndpointsViewModel : PageBase
private readonly NotificationService _notificationService; private readonly NotificationService _notificationService;
public EndpointsViewModel(DocumentService documentService, NotificationService notificationService) : base("Endpoints", "list-alt", -500) public EndpointsViewModel(DocumentService documentService, NotificationService notificationService) : base("Endpoints", "fa-solid fa-rectangle-list", -500)
{ {
_documentService = documentService; _documentService = documentService;
_notificationService = notificationService; _notificationService = notificationService;

View File

@@ -12,7 +12,7 @@ namespace Needlework.Net.ViewModels.Pages.Home;
public partial class HomeViewModel : PageBase public partial class HomeViewModel : PageBase
{ {
public HomeViewModel() : base("Home", "home", int.MinValue) { } public HomeViewModel() : base("Home", "fa-solid fa-house", int.MinValue) { }
public List<LibraryViewModel> Libraries { get; } = JsonSerializer.Deserialize<List<Library>>(AssetLoader.Open(new Uri($"avares://NeedleworkDotNet/Assets/libraries.json"))) public List<LibraryViewModel> Libraries { get; } = JsonSerializer.Deserialize<List<Library>>(AssetLoader.Open(new Uri($"avares://NeedleworkDotNet/Assets/libraries.json")))
!.Where(library => library.Tags.Contains("lcu") || library.Tags.Contains("ingame")) !.Where(library => library.Tags.Contains("lcu") || library.Tags.Contains("ingame"))

View File

@@ -33,7 +33,7 @@ public partial class WebSocketViewModel : PageBase, IEnableLogger
private readonly object _tokenLock = new(); private readonly object _tokenLock = new();
public WebSocketViewModel(IFlurlClientCache clients, NotificationService notificationService) : base("Event Viewer", "plug", -100) public WebSocketViewModel(IFlurlClientCache clients, NotificationService notificationService) : base("Event Viewer", "fa-solid fa-plug", -100)
{ {
_githubUserContentClient = clients.Get("GithubUserContentClient"); _githubUserContentClient = clients.Get("GithubUserContentClient");
_notificationService = notificationService; _notificationService = notificationService;