From b5562f20143ab56b6f1257f98501cea04eff17d7 Mon Sep 17 00:00:00 2001 From: Luke44565 Date: Wed, 13 Mar 2024 15:03:07 -0400 Subject: [PATCH] Use font icon instead of image --- src/Ryujinx.UI.Common/App/ApplicationData.cs | 2 ++ .../App/ApplicationLibrary.cs | 8 +++-- .../Resources/Icon_Folder.png | Bin 2091 -> 0 bytes .../Ryujinx.UI.Common.csproj | 2 -- src/Ryujinx/Assets/Styles/Styles.xaml | 32 ++++++++++++++++++ .../UI/Controls/ApplicationGridView.axaml | 9 +++++ .../UI/Controls/ApplicationListView.axaml | 10 ++++++ src/Ryujinx/UI/Helpers/Glyph.cs | 1 + src/Ryujinx/UI/Helpers/GlyphValueConverter.cs | 1 + 9 files changed, 60 insertions(+), 5 deletions(-) delete mode 100644 src/Ryujinx.UI.Common/Resources/Icon_Folder.png diff --git a/src/Ryujinx.UI.Common/App/ApplicationData.cs b/src/Ryujinx.UI.Common/App/ApplicationData.cs index 517a0c857b..51ac87b5a8 100644 --- a/src/Ryujinx.UI.Common/App/ApplicationData.cs +++ b/src/Ryujinx.UI.Common/App/ApplicationData.cs @@ -38,6 +38,8 @@ namespace Ryujinx.UI.App.Common public bool IsGame => FileExtension != "Folder"; + public bool IsFolder => FileExtension == "Folder"; + public static string GetApplicationBuildId(VirtualFileSystem virtualFileSystem, string titleFilePath) { using FileStream file = new(titleFilePath, FileMode.Open, FileAccess.Read); diff --git a/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs b/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs index ccd7070585..508794127d 100644 --- a/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs +++ b/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs @@ -41,7 +41,6 @@ namespace Ryujinx.UI.App.Common private readonly byte[] _ncaIcon; private readonly byte[] _nroIcon; private readonly byte[] _nsoIcon; - private readonly byte[] _folderIcon; private readonly VirtualFileSystem _virtualFileSystem; private Language _desiredTitleLanguage; @@ -59,11 +58,15 @@ namespace Ryujinx.UI.App.Common _ncaIcon = GetResourceBytes("Ryujinx.UI.Common.Resources.Icon_NCA.png"); _nroIcon = GetResourceBytes("Ryujinx.UI.Common.Resources.Icon_NRO.png"); _nsoIcon = GetResourceBytes("Ryujinx.UI.Common.Resources.Icon_NSO.png"); - _folderIcon = GetResourceBytes("Ryujinx.UI.Common.Resources.Icon_Folder.png"); } private static byte[] GetResourceBytes(string resourceName) { + if (resourceName == "") + { + return Array.Empty(); + } + Stream resourceStream = Assembly.GetCallingAssembly().GetManifestResourceStream(resourceName); byte[] resourceByteArray = new byte[resourceStream.Length]; @@ -131,7 +134,6 @@ namespace Ryujinx.UI.App.Common TitleName = fileInfo.Name, FileExtension = "Folder", Path = fullPath, - Icon = _folderIcon, }; OnApplicationAdded(new ApplicationAddedEventArgs { diff --git a/src/Ryujinx.UI.Common/Resources/Icon_Folder.png b/src/Ryujinx.UI.Common/Resources/Icon_Folder.png deleted file mode 100644 index dba7ff44d74db4fbf1ef51bfee016c55d43d1bd7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2091 zcmeAS@N?(olHy`uVBq!ia0y~yU}9ikV4TIl%)r3lx0$lbcS-&~sPKP>`2YQ~|94A+xQ7(}Zx{c+SNi{Qw*PB+ z{%;fczgrTdV4uwY!%F{8Y5YH_@&B~O|C8$fPpN~r=fNVURKX$||IaIc#80dLKdAkD0|R@Br>`sf zQ$|@nLq0px#yboQtd~7q978H@y}ixtJULY6z{BPyjTuWLxhF2mP`G8Ac&98;R&VnW zjn}{HryM)_NQ&pit$Y7J|K|Ar`OTi^Z|(-YTCh;s{5Eg@pYwOUUR9ds_4Pcf>uk7J z_WRt8ig&9yUc{E$OP%~H&bas22ma^(dK%(N@^!xFvXtyyIPuPT!3$5*{~zCZUU|Xn zTBCW!jD`09k}Cz27DW61|7|HOu-&>cL1_Uu?{goA2gm<=oMT~$`+so`=Z1eQ5%o+= zW|NE=&;4g%dFyzNh2>q`ITjZ?hQ4$r83xXdTgxqlA22#NT#)FLI#T|9{dvmNb2~gySo^Zhh`%s7Uua`u6BghBfsDjP8tE?)>Yj6Zw6IIWWuX2>EP`Q_I_{dJN?aH@-Jal4oLh_u7oXz2QLZWwr;d32&SoPKqc^zqGwg;P>o?_dJS4 zn_pHtciiEB>F(TdC+62l0j2LsdyQIde0N}A5MbcqPBwp;mJ@sZKDP<%tOVIZP17lG9s>gd6}?G;Ll_kpK!D8fzOtM_j7PDEo56)W zz_8^+C_@LIf~3=vAg}Ia0^5(8HK-qY{s{U1FOMc2@C|-~mO2 zAA$-?S2?<@-Nk;uSRrfm@7M239j=J+G3;P>*~k1Q%(%Pbs@`e%HU18`IP#MrF$|Pngvvv@*?VVsXNPEcNU6 zofWUu4>P z#ba)GsiMxQr|W0wg|jv)>C~&n?#sFxnXqC0->+G_qIy%~`S^3XPxqGat~IgcV*9Y! z{(g+-_3*8cn}vDKsqeqGW|>~dTAeMc&#(4h{eGSQ(#2czopr0MsoQSpWb4 diff --git a/src/Ryujinx.UI.Common/Ryujinx.UI.Common.csproj b/src/Ryujinx.UI.Common/Ryujinx.UI.Common.csproj index eb84aad61c..387e998b0b 100644 --- a/src/Ryujinx.UI.Common/Ryujinx.UI.Common.csproj +++ b/src/Ryujinx.UI.Common/Ryujinx.UI.Common.csproj @@ -15,7 +15,6 @@ - @@ -34,7 +33,6 @@ - diff --git a/src/Ryujinx/Assets/Styles/Styles.xaml b/src/Ryujinx/Assets/Styles/Styles.xaml index f7f64be22f..20c435d08e 100644 --- a/src/Ryujinx/Assets/Styles/Styles.xaml +++ b/src/Ryujinx/Assets/Styles/Styles.xaml @@ -86,6 +86,38 @@ + + + + + + + +