Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ILSpy/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

using ICSharpCode.ILSpy.AppEnv;
using ICSharpCode.ILSpy.AssemblyTree;
using ICSharpCode.ILSpy.Util;
using ICSharpCode.ILSpyX.Analyzers;

using Medo.Application;
Expand Down Expand Up @@ -109,6 +110,7 @@ public App()
Resources.MergedDictionaries.Add(DataTemplateManager.CreateDynamicDataTemplates(ExportProvider));

var sessionSettings = settingsService.SessionSettings;
MenuPopupAnimationHelper.Apply(settingsService.DisplaySettings.EnableMenuAnimations);
ThemeManager.Current.Theme = sessionSettings.Theme;
if (!string.IsNullOrEmpty(sessionSettings.CurrentCulture))
{
Expand Down
9 changes: 9 additions & 0 deletions ILSpy/Options/DisplaySettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using System.Windows.Media;
using System.Xml.Linq;

using ICSharpCode.ILSpy.Util;
using ICSharpCode.ILSpyX.Settings;

using TomsToolbox.Wpf;
Expand Down Expand Up @@ -156,6 +157,12 @@ public bool EnableSmoothScrolling {
set => SetProperty(ref enableSmoothScrolling, value);
}

private bool enableMenuAnimations;
public bool EnableMenuAnimations {
get => enableMenuAnimations;
set => SetProperty(ref enableMenuAnimations, value);
}

private bool decodeCustomAttributeBlobs;
public bool DecodeCustomAttributeBlobs {
get => decodeCustomAttributeBlobs;
Expand Down Expand Up @@ -187,6 +194,7 @@ public void LoadFromXml(XElement section)
ShowRawOffsetsAndBytesBeforeInstruction = (bool?)section.Attribute("ShowRawOffsetsAndBytesBeforeInstruction") ?? false;
StyleWindowTitleBar = (bool?)section.Attribute("StyleWindowTitleBar") ?? false;
EnableSmoothScrolling = (bool?)section.Attribute("EnableSmoothScrolling") ?? true;
EnableMenuAnimations = (bool?)section.Attribute("EnableMenuAnimations") ?? MenuPopupAnimationHelper.DefaultFromSystem();
DecodeCustomAttributeBlobs = (bool?)section.Attribute("DecodeCustomAttributeBlobs") ?? false;
}

Expand Down Expand Up @@ -215,6 +223,7 @@ public XElement SaveToXml()
section.SetAttributeValue("ShowRawOffsetsAndBytesBeforeInstruction", ShowRawOffsetsAndBytesBeforeInstruction);
section.SetAttributeValue("StyleWindowTitleBar", StyleWindowTitleBar);
section.SetAttributeValue("EnableSmoothScrolling", EnableSmoothScrolling);
section.SetAttributeValue("EnableMenuAnimations", EnableMenuAnimations);
section.SetAttributeValue("DecodeCustomAttributeBlobs", DecodeCustomAttributeBlobs);

return section;
Expand Down
1 change: 1 addition & 0 deletions ILSpy/Options/DisplaySettingsPanel.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
<CheckBox IsChecked="{Binding Settings.SortResults}" Content="{x:Static properties:Resources.SortResultsFitness}"></CheckBox>
<CheckBox IsChecked="{Binding Settings.StyleWindowTitleBar}" Content="{x:Static properties:Resources.StyleTheWindowTitleBar}"></CheckBox>
<CheckBox IsChecked="{Binding Settings.EnableSmoothScrolling}" Content="{x:Static properties:Resources.EnableSmoothScrolling}"></CheckBox>
<CheckBox IsChecked="{Binding Settings.EnableMenuAnimations}" Content="{x:Static properties:Resources.EnableMenuAnimations}"></CheckBox>
</StackPanel>
</GroupBox>
</StackPanel>
Expand Down
9 changes: 9 additions & 0 deletions ILSpy/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions ILSpy/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,9 @@ Are you sure you want to continue?</value>
<data name="EnableSmoothScrolling" xml:space="preserve">
<value>Enable smooth scrolling</value>
</data>
<data name="EnableMenuAnimations" xml:space="preserve">
<value>Enable menu animations</value>
</data>
<data name="EnableWordWrap" xml:space="preserve">
<value>Enable word wrap</value>
</data>
Expand Down
41 changes: 41 additions & 0 deletions ILSpy/Util/MenuPopupAnimationHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright (c) 2026 ILSpy contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

using System.Windows;
using System.Windows.Controls.Primitives;

namespace ICSharpCode.ILSpy.Util
{
internal static class MenuPopupAnimationHelper
{
private static readonly PopupAnimation SystemMenuPopupAnimation = SystemParameters.MenuPopupAnimation;

public static bool DefaultFromSystem()
{
return SystemMenuPopupAnimation != PopupAnimation.None;
}

public static void Apply(bool enableMenuAnimations)
{
var animation = enableMenuAnimations ? SystemMenuPopupAnimation : PopupAnimation.None;
SystemParameters.OverrideMetadata(
SystemParameters.MenuPopupAnimationKey,
new FrameworkPropertyMetadata(animation));
}
}
}
7 changes: 7 additions & 0 deletions ILSpy/Util/SettingsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public void Reload()
finally
{
reloading = false;
MenuPopupAnimationHelper.Apply(DisplaySettings.EnableMenuAnimations);
}
}

Expand Down Expand Up @@ -129,6 +130,12 @@ protected override void Section_PropertyChanged(object? sender, PropertyChangedE
assemblyListManager.UseDebugSymbols = decompilerSettings.UseDebugSymbols;
}

if (sender is DisplaySettings displaySettings
&& e.PropertyName == nameof(DisplaySettings.EnableMenuAnimations))
{
MenuPopupAnimationHelper.Apply(displaySettings.EnableMenuAnimations);
}

MessageBus.Send(sender, new SettingsChangedEventArgs(e));
}

Expand Down