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 517a0c857..51ac87b5a 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 ccd707058..508794127 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 zcmb_cc~Dd57C$$+1Z2HDP?oS<(js(NOh93z0ztz7tpr{~P^lP1q1qy}4=a(UTq(6s zH?XZ$#1iU=Rz&DSpzL|CQbb0QirN%{M4n5PC5$L234HxxXFBa4{ik;3%vpYCz31F} zi{r&nR_4y;0ALjpEs_ARuu7Dfv9S=>TV!KFW<!~v)R&{u#e0m)wwHnD>F?-8v3hX3lt z=I^Q18MSdyivwzQK&=bWcOIzI4K+|ku-g+gE<|0gqBbYg;)MQ7qi-Ehrz>j3@lNP} zG-`4{?Ob%0gK8{MqdjVMG6rw9jc6gY2TXgvq<9N7ToejEVA80tn#fuQ-NW^P^ zAD&;)DOJ*0wK{5(@JReHlPxc)Q*?Lk-?3u)zI)$%lK$dJUG|`&T=#L`6_uuT_`&}b zj8Ih~rM3JzIW?Ib-+Ob^cpPH$n^7VtGI5Q@hG|YrY^3Qu!qr+}9ky(r2Ee30Mih~d zJ1{TP-;G*$CKs;htfW$#ga{%7BJjW}DX2X3P&y&0Ms zYkM#@BzYvSfDKHv!6Ha3U}_Ab0FGhCv6_g zA7oN;vV3PU$(;7eQjOA9buR;TH!EL}pWGAhWgzih_nZakbb!x)%3bd%9C4I zJynhU2c)h$)IFAr`zMyac%JqzgR*W`C!m#dS7Tw$;8 z=EN}2Cdni6WS~fv%VWpc*`(zjOW)_N@tXV7kjp9@zv&OV81)Qu)SX36j0QmzquA5W z(MC$gRtbCTd0$*_+E3|EGCE6-_v;_#tt!&kJdDEpt=S%mH^XZWC{)h~0VpuHkbY0` zg7II8B?L1dXdoF3vtG`KuO-@o3a_+_r}k6LGGm{YEcka70DzZ!vcGE(g2toZui~%m z`^H&VgfD9WBGY(5;gz*eWKBD*yeoO*Ko!;06~uU^6%9(bivI{MXEs|&yBtRvuX9Qg zuX#MSRd~?PZ0R%SBSbYVriws%d$oR4w^Mjyku`j4D(Ya5B?cZSx*2w%(_y8c+Q3#Q z3wS|DH#^8G$bv>j%VqrNSx$*$NVIuvc+33P-=r@t-SCbJyQFOYKfX>6DgBpJzTNA` z;Z^h#wj!2(Y(>j_9Opsn@A!<9>y2#9R3kr)RydRP`E%T27>#3|hQG-yDKys@nn!j1 z)DwfQL3me>igo1N8aY#wc>SYyo}J3RbAFk`%P((P!ns>}#jdv|D}G=#+=xDvw9~`) z>b=@B|0I)rJl}lJjUC&E)=TRu=ALeE*>Gs!s^)c9ViR#wMV>n_HfIo*J`i>p3cmO?Jk;=_36M6S!(lA5zMB<=mJ zSU> - @@ -34,7 +33,6 @@ - diff --git a/src/Ryujinx/Assets/Styles/Styles.xaml b/src/Ryujinx/Assets/Styles/Styles.xaml index f7f64be22..20c435d08 100644 --- a/src/Ryujinx/Assets/Styles/Styles.xaml +++ b/src/Ryujinx/Assets/Styles/Styles.xaml @@ -86,6 +86,38 @@ + + + + + + + +