
20 changed files with 138 additions and 22 deletions
-
1ILSpy/AboutPage.cs
-
12ILSpy/App.xaml
-
2ILSpy/ILSpy.csproj
-
1ILSpy/ISmartTextOutput.cs
-
6ILSpy/MainWindow.xaml
-
1ILSpy/MainWindow.xaml.cs
-
14ILSpy/Options/DisplaySettings.cs
-
6ILSpy/Options/DisplaySettingsPanel.xaml
-
2ILSpy/Options/DisplaySettingsPanel.xaml.cs
-
24ILSpy/Properties/Resources.Designer.cs
-
3ILSpy/Properties/Resources.resx
-
1ILSpy/SessionSettings.cs
-
3ILSpy/TextView/DecompilerTextView.cs
-
6ILSpy/Themes/DarkTheme.xaml
-
8ILSpy/Themes/LightTheme.xaml
-
2ILSpy/Themes/ResourceKeys.cs
-
2ILSpy/Themes/ThemeManager.cs
-
62ILSpy/Themes/WindowStyleManagerBehavior.cs
-
2ILSpy/Themes/generic.xaml
-
2SharpTreeView/ICSharpCode.TreeView.csproj
@ -1,6 +1,6 @@ |
|||
using System.Windows; |
|||
|
|||
namespace ICSharpCode.ILSpy.themes |
|||
namespace ICSharpCode.ILSpy.Themes |
|||
{ |
|||
public static class ResourceKeys |
|||
{ |
@ -0,0 +1,62 @@ |
|||
using System.ComponentModel; |
|||
using System.Windows; |
|||
|
|||
using ICSharpCode.ILSpy.Options; |
|||
|
|||
using TomsToolbox.Wpf; |
|||
using TomsToolbox.Wpf.Interactivity; |
|||
|
|||
namespace ICSharpCode.ILSpy.Themes |
|||
{ |
|||
public class WindowStyleManagerBehavior : FrameworkElementBehavior<Window> |
|||
{ |
|||
private static readonly DispatcherThrottle restartNotificationThrottle = new DispatcherThrottle(ShowRestartNotification); |
|||
|
|||
protected override void OnAttached() |
|||
{ |
|||
base.OnAttached(); |
|||
|
|||
DisplaySettingsPanel.CurrentDisplaySettings.PropertyChanged += DisplaySettings_PropertyChanged; |
|||
|
|||
UpdateWindowStyle(); |
|||
|
|||
} |
|||
|
|||
protected override void OnDetaching() |
|||
{ |
|||
base.OnDetaching(); |
|||
|
|||
DisplaySettingsPanel.CurrentDisplaySettings.PropertyChanged -= DisplaySettings_PropertyChanged; |
|||
} |
|||
|
|||
private void UpdateWindowStyle() |
|||
{ |
|||
if (!DisplaySettingsPanel.CurrentDisplaySettings.StyleWindowTitleBar) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
var window = AssociatedObject; |
|||
window.Style = (Style)window.FindResource(TomsToolbox.Wpf.Styles.ResourceKeys.WindowStyle); |
|||
} |
|||
|
|||
private static void ShowRestartNotification() |
|||
{ |
|||
MessageBox.Show(Properties.Resources.SettingsChangeRestartRequired); |
|||
} |
|||
|
|||
private void DisplaySettings_PropertyChanged(object sender, PropertyChangedEventArgs e) |
|||
{ |
|||
if (e.PropertyName == nameof(DisplaySettings.StyleWindowTitleBar)) |
|||
{ |
|||
if (!DisplaySettingsPanel.CurrentDisplaySettings.StyleWindowTitleBar) |
|||
{ |
|||
restartNotificationThrottle.Tick(); |
|||
return; |
|||
} |
|||
|
|||
UpdateWindowStyle(); |
|||
} |
|||
} |
|||
} |
|||
} |
@ -1,7 +1,7 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:controls="clr-namespace:ICSharpCode.ILSpy.Controls" |
|||
xmlns:themes="clr-namespace:ICSharpCode.ILSpy.themes"> |
|||
xmlns:themes="clr-namespace:ICSharpCode.ILSpy.Themes"> |
|||
<ResourceDictionary.MergedDictionaries> |
|||
<ResourceDictionary Source="../Controls/SearchBoxStyle.xaml" /> |
|||
</ResourceDictionary.MergedDictionaries> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue