diff --git a/ILSpy/AboutPage.cs b/ILSpy/AboutPage.cs index 36795bcba..8e3b2fc77 100644 --- a/ILSpy/AboutPage.cs +++ b/ILSpy/AboutPage.cs @@ -134,7 +134,7 @@ namespace ICSharpCode.ILSpy static void AddUpdateCheckButton(StackPanel stackPanel, DecompilerTextView textView) { - Button button = new Button(); + Button button = ThemeManager.Current.CreateButton(); button.Content = Resources.CheckUpdates; button.Cursor = Cursors.Arrow; stackPanel.Children.Add(button); @@ -186,7 +186,7 @@ namespace ICSharpCode.ILSpy }); if (availableVersion.DownloadUrl != null) { - Button button = new Button(); + Button button = ThemeManager.Current.CreateButton(); button.Content = Resources.Download; button.Cursor = Cursors.Arrow; button.Click += delegate { diff --git a/ILSpy/ISmartTextOutput.cs b/ILSpy/ISmartTextOutput.cs index be15a929a..1ca9dcebd 100644 --- a/ILSpy/ISmartTextOutput.cs +++ b/ILSpy/ISmartTextOutput.cs @@ -55,7 +55,7 @@ namespace ICSharpCode.ILSpy { output.AddUIElement( delegate { - Button button = new Button(); + Button button = ThemeManager.Current.CreateButton(); button.Cursor = Cursors.Arrow; button.Margin = new Thickness(2); button.Padding = new Thickness(9, 1, 9, 1); diff --git a/ILSpy/MainWindow.xaml.cs b/ILSpy/MainWindow.xaml.cs index 731cb324b..c45596064 100644 --- a/ILSpy/MainWindow.xaml.cs +++ b/ILSpy/MainWindow.xaml.cs @@ -198,6 +198,7 @@ namespace ICSharpCode.ILSpy Button MakeToolbarItem(Lazy command) { return new Button { + Style = ThemeManager.Current.CreateToolBarButtonStyle(), Command = CommandWrapper.Unwrap(command.Value), ToolTip = Properties.Resources.ResourceManager.GetString(command.Metadata.ToolTip), Tag = command.Metadata.Tag, diff --git a/ILSpy/ThemeManager.cs b/ILSpy/ThemeManager.cs index ea0357e2d..43c9127c9 100644 --- a/ILSpy/ThemeManager.cs +++ b/ILSpy/ThemeManager.cs @@ -1,5 +1,6 @@ using System; using System.Windows; +using System.Windows.Controls; namespace ICSharpCode.ILSpy { @@ -28,5 +29,22 @@ namespace ICSharpCode.ILSpy _themeDictionaryContainer.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri($"themes/{theme}Theme.xaml", UriKind.Relative) }); } } + + public Button CreateButton() + { + return new Button { + Style = CreateButtonStyle() + }; + } + + public Style CreateButtonStyle() + { + return new Style(typeof(Button), (Style)Application.Current.FindResource(typeof(Button))); + } + + public Style CreateToolBarButtonStyle() + { + return new Style(typeof(Button), (Style)Application.Current.FindResource(ToolBar.ButtonStyleKey)); + } } } diff --git a/ILSpy/themes/DarkTheme.xaml b/ILSpy/themes/DarkTheme.xaml index 2e33879db..cdc036519 100644 --- a/ILSpy/themes/DarkTheme.xaml +++ b/ILSpy/themes/DarkTheme.xaml @@ -14,7 +14,7 @@ - +