From 8d116d9cfb6ad4ba8c530f5a66f147f92d03ba05 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Mon, 9 Sep 2019 08:08:47 +0200 Subject: [PATCH] Add XAML icons in toolbar. --- ILSpy/Analyzers/AnalyzeCommand.cs | 2 +- ILSpy/Commands/BrowseBackCommand.cs | 2 +- ILSpy/Commands/BrowseForwardCommand.cs | 2 +- ILSpy/Commands/OpenCommand.cs | 4 +- ILSpy/Commands/RefreshCommand.cs | 4 +- ILSpy/Commands/SortAssemblyListCommand.cs | 8 ++-- ILSpy/ILSpy.csproj | 36 ++++++++++++++- ILSpy/Images/Back.png | Bin 779 -> 243 bytes ILSpy/Images/Back.xaml | 20 ++++++++ ILSpy/Images/CollapseAll.png | Bin 436 -> 196 bytes ILSpy/Images/CollapseAll.xaml | 21 +++++++++ ILSpy/Images/Find.png | Bin 700 -> 0 bytes ILSpy/Images/Forward.png | Bin 776 -> 252 bytes ILSpy/Images/Forward.xaml | 20 ++++++++ ILSpy/Images/Images.cs | 54 ++++++++++++++++++++-- ILSpy/Images/Open.png | Bin 748 -> 457 bytes ILSpy/Images/Open.xaml | 20 ++++++++ ILSpy/Images/Refresh.png | Bin 835 -> 591 bytes ILSpy/Images/Refresh.xaml | 19 ++++++++ ILSpy/Images/Search.png | Bin 700 -> 529 bytes ILSpy/Images/Search.xaml | 20 ++++++++ ILSpy/Images/Sort.png | Bin 380 -> 356 bytes ILSpy/Images/Sort.xaml | 21 +++++++++ ILSpy/MainWindow.xaml.cs | 30 +++++++----- ILSpy/Search/SearchPane.cs | 4 +- 25 files changed, 257 insertions(+), 30 deletions(-) create mode 100644 ILSpy/Images/Back.xaml create mode 100644 ILSpy/Images/CollapseAll.xaml delete mode 100644 ILSpy/Images/Find.png create mode 100644 ILSpy/Images/Forward.xaml create mode 100644 ILSpy/Images/Open.xaml create mode 100644 ILSpy/Images/Refresh.xaml create mode 100644 ILSpy/Images/Search.xaml create mode 100644 ILSpy/Images/Sort.xaml diff --git a/ILSpy/Analyzers/AnalyzeCommand.cs b/ILSpy/Analyzers/AnalyzeCommand.cs index 72117338b..7d73e9039 100644 --- a/ILSpy/Analyzers/AnalyzeCommand.cs +++ b/ILSpy/Analyzers/AnalyzeCommand.cs @@ -25,7 +25,7 @@ using ICSharpCode.ILSpy.TreeNodes; namespace ICSharpCode.ILSpy.Analyzers { - [ExportContextMenuEntry(Header = nameof(Resources.Analyze), Icon = "images/Search.png", Category = nameof(Resources.Analyze), InputGestureText = "Ctrl+R", Order = 100)] + [ExportContextMenuEntry(Header = nameof(Resources.Analyze), Icon = "images/Search", Category = nameof(Resources.Analyze), InputGestureText = "Ctrl+R", Order = 100)] internal sealed class AnalyzeCommand : SimpleCommand, IContextMenuEntry { public bool IsVisible(TextViewContext context) diff --git a/ILSpy/Commands/BrowseBackCommand.cs b/ILSpy/Commands/BrowseBackCommand.cs index a79f11855..e3fe411b5 100644 --- a/ILSpy/Commands/BrowseBackCommand.cs +++ b/ILSpy/Commands/BrowseBackCommand.cs @@ -21,7 +21,7 @@ using ICSharpCode.ILSpy.Properties; namespace ICSharpCode.ILSpy { - [ExportToolbarCommand(ToolTip = nameof(Resources.Back), ToolbarIcon = "Images/Back.png", ToolbarCategory = nameof(Resources.Navigation), ToolbarOrder = 0)] + [ExportToolbarCommand(ToolTip = nameof(Resources.Back), ToolbarIcon = "Images/Back", ToolbarCategory = nameof(Resources.Navigation), ToolbarOrder = 0)] sealed class BrowseBackCommand : CommandWrapper { public BrowseBackCommand() diff --git a/ILSpy/Commands/BrowseForwardCommand.cs b/ILSpy/Commands/BrowseForwardCommand.cs index 583ddede1..e16b871fc 100644 --- a/ILSpy/Commands/BrowseForwardCommand.cs +++ b/ILSpy/Commands/BrowseForwardCommand.cs @@ -21,7 +21,7 @@ using ICSharpCode.ILSpy.Properties; namespace ICSharpCode.ILSpy { - [ExportToolbarCommand(ToolTip = nameof(Resources.Forward), ToolbarIcon = "Images/Forward.png", ToolbarCategory = nameof(Resources.Navigation), ToolbarOrder = 1)] + [ExportToolbarCommand(ToolTip = nameof(Resources.Forward), ToolbarIcon = "Images/Forward", ToolbarCategory = nameof(Resources.Navigation), ToolbarOrder = 1)] sealed class BrowseForwardCommand : CommandWrapper { public BrowseForwardCommand() diff --git a/ILSpy/Commands/OpenCommand.cs b/ILSpy/Commands/OpenCommand.cs index 0f5e86ca9..88a632610 100644 --- a/ILSpy/Commands/OpenCommand.cs +++ b/ILSpy/Commands/OpenCommand.cs @@ -21,8 +21,8 @@ using ICSharpCode.ILSpy.Properties; namespace ICSharpCode.ILSpy { - [ExportToolbarCommand(ToolTip = nameof(Resources.Open), ToolbarIcon = "Images/Open.png", ToolbarCategory = nameof(Resources.Open), ToolbarOrder = 0)] - [ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources._Open), MenuIcon = "Images/Open.png", MenuCategory = nameof(Resources.Open), MenuOrder = 0)] + [ExportToolbarCommand(ToolTip = nameof(Resources.Open), ToolbarIcon = "Images/Open", ToolbarCategory = nameof(Resources.Open), ToolbarOrder = 0)] + [ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources._Open), MenuIcon = "Images/Open", MenuCategory = nameof(Resources.Open), MenuOrder = 0)] sealed class OpenCommand : CommandWrapper { public OpenCommand() diff --git a/ILSpy/Commands/RefreshCommand.cs b/ILSpy/Commands/RefreshCommand.cs index 96e421882..bf92dc491 100644 --- a/ILSpy/Commands/RefreshCommand.cs +++ b/ILSpy/Commands/RefreshCommand.cs @@ -21,8 +21,8 @@ using ICSharpCode.ILSpy.Properties; namespace ICSharpCode.ILSpy { - [ExportToolbarCommand(ToolTip = nameof(Resources.RefreshCommand_ReloadAssemblies), ToolbarIcon = "Images/Refresh.png", ToolbarCategory = nameof(Resources.Open), ToolbarOrder = 2)] - [ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources._Reload), MenuIcon = "Images/Refresh.png", MenuCategory = nameof(Resources.Open), MenuOrder = 2)] + [ExportToolbarCommand(ToolTip = nameof(Resources.RefreshCommand_ReloadAssemblies), ToolbarIcon = "Images/Refresh", ToolbarCategory = nameof(Resources.Open), ToolbarOrder = 2)] + [ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources._Reload), MenuIcon = "Images/Refresh", MenuCategory = nameof(Resources.Open), MenuOrder = 2)] sealed class RefreshCommand : CommandWrapper { public RefreshCommand() diff --git a/ILSpy/Commands/SortAssemblyListCommand.cs b/ILSpy/Commands/SortAssemblyListCommand.cs index b205cc03a..5347f61cc 100644 --- a/ILSpy/Commands/SortAssemblyListCommand.cs +++ b/ILSpy/Commands/SortAssemblyListCommand.cs @@ -23,8 +23,8 @@ using ICSharpCode.TreeView; namespace ICSharpCode.ILSpy { - [ExportMainMenuCommand(Menu = nameof(Resources._View), Header = nameof(Resources.SortAssembly_listName), MenuIcon = "Images/Sort.png", MenuCategory = nameof(Resources.View))] - [ExportToolbarCommand(ToolTip = nameof(Resources.SortAssemblyListName), ToolbarIcon = "Images/Sort.png", ToolbarCategory = nameof(Resources.View))] + [ExportMainMenuCommand(Menu = nameof(Resources._View), Header = nameof(Resources.SortAssembly_listName), MenuIcon = "Images/Sort", MenuCategory = nameof(Resources.View))] + [ExportToolbarCommand(ToolTip = nameof(Resources.SortAssemblyListName), ToolbarIcon = "Images/Sort", ToolbarCategory = nameof(Resources.View))] sealed class SortAssemblyListCommand : SimpleCommand, IComparer { public override void Execute(object parameter) @@ -39,8 +39,8 @@ namespace ICSharpCode.ILSpy } } - [ExportMainMenuCommand(Menu = nameof(Resources._View), Header = nameof(Resources._CollapseTreeNodes), MenuIcon = "Images/CollapseAll.png", MenuCategory = nameof(Resources.View))] - [ExportToolbarCommand(ToolTip = nameof(Resources.CollapseTreeNodes), ToolbarIcon = "Images/CollapseAll.png", ToolbarCategory = nameof(Resources.View))] + [ExportMainMenuCommand(Menu = nameof(Resources._View), Header = nameof(Resources._CollapseTreeNodes), MenuIcon = "Images/CollapseAll", MenuCategory = nameof(Resources.View))] + [ExportToolbarCommand(ToolTip = nameof(Resources.CollapseTreeNodes), ToolbarIcon = "Images/CollapseAll", ToolbarCategory = nameof(Resources.View))] sealed class CollapseAllCommand : SimpleCommand { public override void Execute(object parameter) diff --git a/ILSpy/ILSpy.csproj b/ILSpy/ILSpy.csproj index 85086edcd..dc5fc15fb 100644 --- a/ILSpy/ILSpy.csproj +++ b/ILSpy/ILSpy.csproj @@ -312,6 +312,13 @@ + + + + + + + @@ -345,7 +352,6 @@ - @@ -389,6 +395,34 @@ + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + MSBuild:Compile diff --git a/ILSpy/Images/Back.png b/ILSpy/Images/Back.png index e3f39762ccb45f8c929e8ae597602a1ce08502e6..9f597cd910df7651a31edcfc9f3cc3e7326d768e 100644 GIT binary patch delta 215 zcmV;|04V>92J-=sB!3BTNLh0L01m?d01m?e$8V@)0001`NklgoUh002ovPDHLkV1kE$UCICe delta 755 zcmV zK@`P6^k^{9)qfcbzj>P$cXm~%nlKgC3G+VB_{i{yxLha-vRrb(=MRp+tH&{rBnf0$ z0ZmbbOBcH1{yJuyGBpF+N(}UcW3pTn6h#G1)8NI!PWRTQc?oFHv_|jgnkGcMf-%bM zZ^5zf>GqJ&R@jwYXl8N{bX|uJ-`3&U{qJtg!j^mWuzw!1rKUE@kma*V1~!g(7~n0- zf~jO5WV2ZkTnWOB3`~A(P3tBhzM%;|{^Dyo5z8 zqD;-e!Ylc0O;rq!FnV_#UOwt@;qtuO%{@!ubLaXgLNW6C18cJnAPO zC + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ILSpy/Images/CollapseAll.png b/ILSpy/Images/CollapseAll.png index 5e23dbc8101d5b29ea77efc18dcb648e729250bb..d5b3ed03b2a00761e0ffa4dd115531eb131366ba 100644 GIT binary patch delta 168 zcmV;Z09XIC1H=K4B!7!ZL_t(|UZs;U4#O}AMNPzFPdS*EB+3nXtlXe#yZB(8yb`HW ziXsF^_)kdS{{Y)SL}^5L1pshM^xj?PoHL+RP-|6ltu^jIkh#b;#u%A}F)|B-WPOD9 z>m!QRZBdP<6qCKg`SJY6-(%Oukp_IoQYq#4>WIi2!CxfW3n7zaVPF${jsC{*Ydit% WSu7I&SukI zw+pY=L*RJ^8@`XA--k!JN9%i&$w^Zrlu}K;dlkpn9-r1z=I1rO#~qILX*mDsz>T5^ zVmQQNv1s+)B?qV;9OGbFpe#!iMS(O;TLr=}B!SXx6#&6;9E?VzmEtVRQ17t{bo6}? zT-QaO=PLrt>wi6^vI|Hl0S0)G)+1=XO`vhWM_76t6Ndi>2c2IX=q|80Fno)E_`3sX zJ%VT)R8?hlV0b0J9K1b3Fv*w0P1f`Qb2_&OXkJNy_b1>s)((7H7|=N2ML}=PpQbIi z7x0k>RJ=peTni9*a-Af}F>bb=*M8>t>q}iDKLr>7`V%_8Q|(AFK>z>%07*qoM6N<$ Ef*y;mSO5S3 diff --git a/ILSpy/Images/CollapseAll.xaml b/ILSpy/Images/CollapseAll.xaml new file mode 100644 index 000000000..8fefbcf4f --- /dev/null +++ b/ILSpy/Images/CollapseAll.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ILSpy/Images/Find.png b/ILSpy/Images/Find.png deleted file mode 100644 index 7a5ae62e3271a19c14d2721b0d7d13bcb29f7fac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 700 zcmV;t0z>_YP)RpX(gF%<-hsT33u0tE}|wXKJq?NulUy=lRVDD@B!=|RwgAA~|7P#aAt zy`&L?CaE#WZZ^B?ypUqEZoz>c?}Pu$o0<0>5s5^QnNbvl5eR}9fMpxN0VN=#>v}>} z)jWV`bg*^W?EJ;^qmkY-gXenML}zPNmUHoV{Og-nFT0AnxwoL%ro3J+f{0Ck37pe4 zHgS74*nRSp-+ja>(j-B%4CC;0ba-03`W(r`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RPW iaup#{V}v#T3NQe4SU_8cuSX#O0000 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ILSpy/Images/Images.cs b/ILSpy/Images/Images.cs index 61ed764d8..2433c7d30 100644 --- a/ILSpy/Images/Images.cs +++ b/ILSpy/Images/Images.cs @@ -21,6 +21,9 @@ using System.Windows.Media.Imaging; using System.Windows.Media; using System.Windows; using System.Collections.Generic; +using System.Windows.Controls; +using System.Windows.Markup; +using System.IO; namespace ICSharpCode.ILSpy { @@ -100,21 +103,62 @@ namespace ICSharpCode.ILSpy private static readonly BitmapImage OverlayStatic = LoadBitmap("OverlayStatic"); + public static object Load(object part, string icon) + { + if (icon.EndsWith(".png", StringComparison.OrdinalIgnoreCase)) + return LoadImage(part, icon); + Uri uri = GetUri(part, icon + ".xaml"); + if (ResourceExists(uri)) { + return LoadVector(part, icon); + } + return LoadImage(part, icon + ".png"); + } + public static BitmapImage LoadImage(object part, string icon) + { + Uri uri = GetUri(part, icon); + BitmapImage image = new BitmapImage(uri); + image.Freeze(); + return image; + } + + public static Viewbox LoadVector(object part, string icon) + { + return (Viewbox)Application.LoadComponent(GetUri(part, icon + ".xaml", absolute: false)); + } + + private static Uri GetUri(object part, string icon, bool absolute = true) { Uri uri; var assembly = part.GetType().Assembly; + string prefix; + UriKind kind; + if (absolute) { + prefix = "pack://application:,,,/"; + kind = UriKind.Absolute; + } else { + prefix = "/"; + kind = UriKind.Relative; + } if (assembly == typeof(Images).Assembly) { - uri = new Uri("pack://application:,,,/" + icon); + uri = new Uri(prefix + icon, kind); } else { var name = assembly.GetName(); - uri = new Uri("pack://application:,,,/" + name.Name + ";v" + name.Version + ";component/" + icon); + uri = new Uri(prefix + name.Name + ";v" + name.Version + ";component/" + icon, kind); } - BitmapImage image = new BitmapImage(uri); - image.Freeze(); - return image; + + return uri; } + private static bool ResourceExists(Uri uri) + { + try { + Application.GetResourceStream(uri); + return true; + } catch (IOException) { + return false; + } + } private static readonly TypeIconCache typeIconCache = new TypeIconCache(); private static readonly MemberIconCache memberIconCache = new MemberIconCache(); diff --git a/ILSpy/Images/Open.png b/ILSpy/Images/Open.png index 02ea253941419f6bf3879a3c5ff199b057b3bba2..77f4645fc6e1793e3845867d37277cb5cde14dec 100644 GIT binary patch delta 431 zcmV;g0Z{(z1<3=DB!3BTNLh0L01m_e01m_fl`9S#0004dNklD0# zg~m#&Sh0hs=%9p~(Y3-ZyvTxsSv_2!U2KO$%blVs%lRW>!(*zE{b%_9G-pvCm?j?_{x-F`v}|qc;^dz zAlYdJQydNG~SGy74nSJ~CQty@8H{F3Dg>;O~A;1KO=?5l=r*7#)yBGxQ zGcLL^ARn#4#@ra#0gph~9W?7zpbY#LpqM=aE67*-;Gc~eeF<30ji6pjofL zPelT&xQ9ZtBy@rDb_Z7J>KUYwIF8FwL6r_@@}rH_XDDdl0ddl%KN#L^C?$`b9Uuun Z{s5eg6&oSq3gb1)nse!BRaoJhfPvdW8AUDHyawV`HRr z8@MYVX2S|>4}VA-Sg^o9Q^^9J8rUmNVaYCGeW(P1VFTN6l|#&i6|}1<*FRT<_2~*G zaA_H zEfe{<`hOst@03W+E63^dI(9}?kNwJzIAH_!DjGvOsJ=y&i;i5(b*q`kwdoOXzD;9` zJ-N*5D8inU*EkSgG`~CE5;_Cp4SM0}lYiw-74yiuuqY!iEPsOV(_X-S$p?Atiee(- ze6qO8UBN?CoTbthDQbDN>E_yxFKR6GXpk36o=v+k)FI@@QR@~lD;91E24gbC7_O7i za&Mot``LwwoNM&q-@*UoP}An`RTxi^`LUFyy-K>B6#N128KO=kFWz + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ILSpy/Images/Refresh.png b/ILSpy/Images/Refresh.png index 6d68b75b8602be2f952fc56925f0c3b382b98aa4..23ffe551e16623a12f0d64942cdf9a1bccbb1acb 100644 GIT binary patch delta 566 zcmV-60?GZu2G0bLB!3BTNLh0L01m_e01m_fl`9S#00063Nkle=YFQ5pf(D_*KIbv zco>l}RAVvTi$=o-J!}HV$TJ{bO#hc?S3Ag6F`CP-o)hDPG&p_d zSr+!64IBzK;eSToez=i+Uwb?VOV8@u+l00CBJRHU2;mY9jy`>}0CMF-5F#YiOukC* zdhApXB>C0?XZaR(%`X=~!fo3sw@=J^A6%qDd#C|&`Bfe*G+3ALLeLKn%Bx#K1*|x7 zr8V%@)_}A8wORvPKr*@SJi`2N9HCGF$Fv4|#-c&0yMJRR$Z#?XrEpVjcRO6L#vV09 z&!pH0%`SXX{<9+rJ@-}Y!IUZ#?9Wn6IiX%f$)Wp=R znqU0EV9r{lPc3K4{{_+?IlQ}_`^QFRF!^DL0XKecEru_IAlfu%+&h|d9=OnZMS0^A&AMz!q$KXiTbY4_zY(bq(p`5Y*Z=?k07*qoM6N<$ Ef{{@N4FCWD delta 812 zcmV+{1JnG^1j7c9B!3xnMObuGZ)S9NVRB^vL1b@YWgtmyVP|DhWnpA_ami&o0008z zNklT~8B16uqxjYubtnEC+9#i z3fwN_HwE|!7*Ne7A*N|`DLfrd=~N#rSQ9{!Brh-Z{iox;t+$P$>uWKaPV>dB7w`P? z_8L>B`HP^2t{5Jyt`P_vTIg=~gYz2CJ{$$99gily^;Cm#a z@sO*^c7G_yP~aDb;bgyaW0TEPbE#0*YUxObc5 zAO=qUK}1Pk4?>v;IDMqF1zAr^5mjIQK+(1guu^8 zT35CBRtsP%F~Q*7$G+O@U2;TaAjr+`$|Jm!A%B_G*z7E0A(uq}-=kMaHIwsW%dZoO z;Mfm_<2Oe(?(HoxnU2{Hc=kx{dKT|HH37c>0000 + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ILSpy/Images/Search.png b/ILSpy/Images/Search.png index 7a5ae62e3271a19c14d2721b0d7d13bcb29f7fac..06da21465d0c24f3470b657e8fd317c8eef138e6 100644 GIT binary patch delta 503 zcmV%HO!K0F?G-|roFXMzEmrbz(y$$uB5i^#8cwGZ$M28v@l-`L z8bh^OMK+s#uv{+BX`yYCV0G7cJpK`n$B{mI4MkB_$8R*GQilkILI{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+++ b/ILSpy/Images/Search.xaml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ILSpy/Images/Sort.png b/ILSpy/Images/Sort.png index b508e9a49354ef12a8c27ae9a17163c958d6a265..7c6ea30e5750121bdab943ab4272a0adac8e749c 100644 GIT binary patch delta 329 zcmV-P0k;190^|aaB!3BTNLh0L01m_e01m_fl`9S#0003NNklpnGS#g80JCK*mMx}ZQ{JDP} b8(sVYCBVKsm<}Ca00000NkvXXu0mjf{STO2 delta 353 zcmV-n0iOQk0{jAyB!2{FK}|sb0I`n?{9y$E000SaNLh0L01mp-4umUuI zGZ2XdSPfXwH{<`3f~x;88iW_mnNPe6KpLP-hHg8H{~!$IVgS5e0J#99dClte7>YnK z1BxY(0U+05#9GwB{l~zXkzIofK!$=e!|;sd`%%?_G$K14WFV9Y2i6|3V9g*JDg*&A zry~a(HkZI$ffB$lr^B2Na|tf5;7g@s00ssCi>bK~k1(5T00000NkvXXu0mjfz3qmH diff --git a/ILSpy/Images/Sort.xaml b/ILSpy/Images/Sort.xaml new file mode 100644 index 000000000..440c50a3d --- /dev/null +++ b/ILSpy/Images/Sort.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ILSpy/MainWindow.xaml.cs b/ILSpy/MainWindow.xaml.cs index 5732b5673..d65111a11 100644 --- a/ILSpy/MainWindow.xaml.cs +++ b/ILSpy/MainWindow.xaml.cs @@ -139,15 +139,19 @@ namespace ICSharpCode.ILSpy Button MakeToolbarItem(Lazy command) { + object image = Images.Load(command.Value, command.Metadata.ToolbarIcon); + if (!(image is Viewbox)) { + image = new Image { + Width = 16, + Height = 16, + Source = (ImageSource)image + }; + } return new Button { Command = CommandWrapper.Unwrap(command.Value), - ToolTip =Properties.Resources.ResourceManager.GetString( command.Metadata.ToolTip), + ToolTip = Properties.Resources.ResourceManager.GetString(command.Metadata.ToolTip), Tag = command.Metadata.Tag, - Content = new Image { - Width = 16, - Height = 16, - Source = Images.LoadImage(command.Value, command.Metadata.ToolbarIcon) - } + Content = image }; } #endregion @@ -173,11 +177,15 @@ namespace ICSharpCode.ILSpy if (!string.IsNullOrEmpty(GetResourceString(entry.Metadata.Header))) menuItem.Header = GetResourceString(entry.Metadata.Header); if (!string.IsNullOrEmpty(entry.Metadata.MenuIcon)) { - menuItem.Icon = new Image { - Width = 16, - Height = 16, - Source = Images.LoadImage(entry.Value, entry.Metadata.MenuIcon) - }; + object image = Images.Load(entry.Value, entry.Metadata.MenuIcon); + if (!(image is Viewbox)) { + image = new Image { + Width = 16, + Height = 16, + Source = (ImageSource)image + }; + } + menuItem.Icon = image; } menuItem.IsEnabled = entry.Metadata.IsEnabled; diff --git a/ILSpy/Search/SearchPane.cs b/ILSpy/Search/SearchPane.cs index 501c2aade..5bb2b7c70 100644 --- a/ILSpy/Search/SearchPane.cs +++ b/ILSpy/Search/SearchPane.cs @@ -398,8 +398,8 @@ namespace ICSharpCode.ILSpy } } - [ExportMainMenuCommand(Menu = nameof(Properties.Resources._View), Header =nameof(Properties.Resources.Search), MenuIcon = "Images/Find.png", MenuCategory = nameof(Properties.Resources.View), MenuOrder = 100)] - [ExportToolbarCommand(ToolTip = nameof(Properties.Resources.SearchCtrlShiftFOrCtrlE), ToolbarIcon = "Images/Find.png", ToolbarCategory = nameof(Properties.Resources.View), ToolbarOrder = 100)] + [ExportMainMenuCommand(Menu = nameof(Properties.Resources._View), Header =nameof(Properties.Resources.Search), MenuIcon = "Images/Search", MenuCategory = nameof(Properties.Resources.View), MenuOrder = 100)] + [ExportToolbarCommand(ToolTip = nameof(Properties.Resources.SearchCtrlShiftFOrCtrlE), ToolbarIcon = "Images/Search", ToolbarCategory = nameof(Properties.Resources.View), ToolbarOrder = 100)] sealed class ShowSearchCommand : CommandWrapper { public ShowSearchCommand()