Browse Source

Fix inline buttons

pull/2334/head
tom-englert 4 years ago
parent
commit
dbebc035e9
  1. 4
      ILSpy/AboutPage.cs
  2. 2
      ILSpy/ISmartTextOutput.cs
  3. 1
      ILSpy/MainWindow.xaml.cs
  4. 18
      ILSpy/ThemeManager.cs
  5. 2
      ILSpy/themes/DarkTheme.xaml

4
ILSpy/AboutPage.cs

@ -134,7 +134,7 @@ namespace ICSharpCode.ILSpy @@ -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 @@ -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 {

2
ILSpy/ISmartTextOutput.cs

@ -55,7 +55,7 @@ namespace ICSharpCode.ILSpy @@ -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);

1
ILSpy/MainWindow.xaml.cs

@ -198,6 +198,7 @@ namespace ICSharpCode.ILSpy @@ -198,6 +198,7 @@ namespace ICSharpCode.ILSpy
Button MakeToolbarItem(Lazy<ICommand, IToolbarCommandMetadata> 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,

18
ILSpy/ThemeManager.cs

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
using System;
using System.Windows;
using System.Windows.Controls;
namespace ICSharpCode.ILSpy
{
@ -28,5 +29,22 @@ 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));
}
}
}

2
ILSpy/themes/DarkTheme.xaml

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#3399FF" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="#FFFFFF" />
<SolidColorBrush x:Key="{x:Static SystemColors.InfoTextBrushKey}" Color="#F1F1F1" />
<SolidColorBrush x:Key="{x:Static SystemColors.InfoBrushKey}" Color="#252526" />
<SolidColorBrush x:Key="{x:Static SystemColors.InfoBrushKey}" Color="#333337" />
<SolidColorBrush x:Key="{x:Static SystemColors.MenuBrushKey}" Color="#1B1B1C" />
<SolidColorBrush x:Key="{x:Static SystemColors.MenuBarBrushKey}" Color="#1B1B1C" />
<SolidColorBrush x:Key="{x:Static SystemColors.MenuTextBrushKey}" Color="#F1F1F1" />

Loading…
Cancel
Save