From 0085f953750583a3a2145058ad310456de3047cd Mon Sep 17 00:00:00 2001 From: brilliantkid87 Date: Sat, 29 Aug 2026 10:31:45 +0700 Subject: [PATCH] Fix: Fixed pinned network computers not showing an icon in the sidebar --- src/Files.App/Data/Models/PinnedFoldersManager.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Files.App/Data/Models/PinnedFoldersManager.cs b/src/Files.App/Data/Models/PinnedFoldersManager.cs index 3ae8fcf8e342..ca829834dc16 100644 --- a/src/Files.App/Data/Models/PinnedFoldersManager.cs +++ b/src/Files.App/Data/Models/PinnedFoldersManager.cs @@ -148,6 +148,16 @@ private async Task LoadIconForLocationItemAsync(LocationItem locationItem, strin isFolder, IconOptions.ReturnIconOnly); + // Shell icon APIs cannot resolve icons for bare network machine roots (e.g. "\\server"); fall back to the sidebar resource icons like DriveItem does. + if (result is null) + { + var isMachineRoot = path.StartsWith(@"\\", StringComparison.Ordinal) && + path.Split('\\', StringSplitOptions.RemoveEmptyEntries).Length == 1; + result = UIHelpers.GetSidebarIconResourceInfo(isMachineRoot + ? Constants.ImageRes.Network + : Constants.ImageRes.Folder)?.IconData; + } + locationItem.IconData = result; // Assign Icon on the UI thread: it raises PropertyChanged, which builds a XAML IconElement in a realized SidebarItem.