Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize the scrolling experience #3234

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 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 Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<PackageVersion Include="DataGridExtensions" Version="2.6.0" />
<PackageVersion Include="DiffLib" Version="2017.7.26.1241" />
<PackageVersion Include="Dirkster.AvalonDock.Themes.VS2013" Version="4.72.1" />
<PackageVersion Include="EleCho.WpfSuite" Version="0.6.0" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="ILCompiler.Reflection.ReadyToRun.Experimental" Version="8.0.0-rc.2.23471.30" />
<PackageVersion Include="Iced" Version="1.21.0" />
Expand Down Expand Up @@ -45,6 +46,7 @@
<PackageVersion Include="System.Reflection.Metadata" Version="8.0.0" />
<PackageVersion Include="System.Resources.Extensions" Version="8.0.0" />
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageVersion Include="TomsToolbox.Wpf" Version="2.15.0" />
<PackageVersion Include="TomsToolbox.Wpf.Styles" Version="2.15.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
</ItemGroup>
Expand Down
8 changes: 7 additions & 1 deletion ILSpy.sln
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.Decompiler.Test
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.ILSpyX", "ICSharpCode.ILSpyX\ICSharpCode.ILSpyX.csproj", "{F8EFCF9D-B9A3-4BA0-A1B2-B026A71DAC22}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.BamlDecompiler", "ICSharpCode.BamlDecompiler\ICSharpCode.BamlDecompiler.csproj", "{81A30182-3378-4952-8880-F44822390040}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is BamlDecompiler receiving a new GUID and the new project has the old one?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a VS issue, when editing a solution, old guids will be updated, but new projects start with an old guid.

However the plan is to move the behavior as a public available standard item to toms-toolbox, so this change will be reverted anyway.

Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.BamlDecompiler", "ICSharpCode.BamlDecompiler\ICSharpCode.BamlDecompiler.csproj", "{81A30182-3378-4952-8880-F44822390040}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibScrollingOptimization", "LibScrollingOptimization\LibScrollingOptimization.csproj", "{376D29B0-38FE-4517-A1A2-A54FBFEFF56C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -100,6 +102,10 @@ Global
{81A30182-3378-4952-8880-F44822390040}.Debug|Any CPU.Build.0 = Debug|Any CPU
{81A30182-3378-4952-8880-F44822390040}.Release|Any CPU.ActiveCfg = Release|Any CPU
{81A30182-3378-4952-8880-F44822390040}.Release|Any CPU.Build.0 = Release|Any CPU
{376D29B0-38FE-4517-A1A2-A54FBFEFF56C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{376D29B0-38FE-4517-A1A2-A54FBFEFF56C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{376D29B0-38FE-4517-A1A2-A54FBFEFF56C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{376D29B0-38FE-4517-A1A2-A54FBFEFF56C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
26 changes: 13 additions & 13 deletions ILSpy/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
xmlns:ilSpy="clr-namespace:ICSharpCode.ILSpy"
xmlns:themes="clr-namespace:ICSharpCode.ILSpy.Themes"
StartupUri="MainWindow.xaml">
<Application.Resources>
<Style x:Key="DialogWindow" TargetType="{x:Type Window}">
<Setter Property="ShowInTaskbar" Value="False"/>
<Setter Property="UseLayoutRounding" Value="True"/>
<Setter Property="TextOptions.TextFormattingMode" Value="Display"/>
<Setter Property="toms:StyleBindings.Behaviors">
<Setter.Value>
<toms:BehaviorCollection>
<themes:WindowStyleManagerBehavior />
</toms:BehaviorCollection>
</Setter.Value>
</Setter>
</Style>
<Application.Resources>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's hard to review if you completely reformat whole files. (Applies to many others, too)

Copy link
Member

@siegfriedpammer siegfriedpammer Jul 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you append ?w=1 to the GitHub URL, e.g. https://github.com/icsharpcode/ILSpy/pull/3234/files?w=1 then you can review everything without whitespace changes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I agree that this should be reverted, especially because the only change in this file is the indentation.

<Style x:Key="DialogWindow" TargetType="{x:Type Window}">
<Setter Property="ShowInTaskbar" Value="False"/>
<Setter Property="UseLayoutRounding" Value="True"/>
<Setter Property="TextOptions.TextFormattingMode" Value="Display"/>
<Setter Property="toms:StyleBindings.Behaviors">
<Setter.Value>
<toms:BehaviorCollection>
<themes:WindowStyleManagerBehavior />
</toms:BehaviorCollection>
</Setter.Value>
</Setter>
</Style>

<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Static styles:ResourceKeys.ButtonStyle}}">
<Setter Property="MinWidth" Value="73" />
Expand Down
5 changes: 3 additions & 2 deletions ILSpy/Controls/ZoomScrollViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static void CalculateZoomButtonCollapsed(DependencyObject d, DependencyPropertyC
z.ComputedZoomButtonCollapsed = (z.AlwaysShowZoomButtons == false) && (z.CurrentZoom == 1.0);
}

protected override void OnMouseWheel(MouseWheelEventArgs e)
protected override void OnPreviewMouseWheel(MouseWheelEventArgs e)
{
if (!e.Handled && Keyboard.Modifiers == ModifierKeys.Control && MouseWheelZoom)
{
Expand Down Expand Up @@ -165,7 +165,8 @@ protected override void OnMouseWheel(MouseWheelEventArgs e)

e.Handled = true;
}
base.OnMouseWheel(e);

base.OnPreviewMouseWheel(e);
}

internal static double RoundToOneIfClose(double val)
Expand Down
1 change: 1 addition & 0 deletions ILSpy/ILSpy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
<ItemGroup>
<ProjectReference Include="..\ICSharpCode.ILSpyX\ICSharpCode.ILSpyX.csproj" />
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" />
<ProjectReference Include="..\LibScrollingOptimization\LibScrollingOptimization.csproj" />
<ProjectReference Include="..\SharpTreeView\ICSharpCode.TreeView.csproj" />
</ItemGroup>

Expand Down
5 changes: 5 additions & 0 deletions ILSpy/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:themes="clr-namespace:ICSharpCode.ILSpy.Themes"
xmlns:toms="urn:TomsToolbox"
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
xmlns:scroll="clr-namespace:LibScrollingOptimization;assembly=LibScrollingOptimization"
d:DataContext="{d:DesignInstance local:MainWindowViewModel}"
>
<Window.Resources>
Expand All @@ -34,6 +36,9 @@
AllowDropOrder="True"
AllowDrop="True"
BorderThickness="0" Visibility="Visible">
<behaviors:Interaction.Behaviors>
<scroll:SmoothScrollingBehavior/>
</behaviors:Interaction.Behaviors>
<tv:SharpTreeView.ItemContainerStyle>
<Style TargetType="tv:SharpTreeViewItem">

Expand Down
129 changes: 69 additions & 60 deletions ILSpy/Options/DecompilerSettingsPanel.xaml
Original file line number Diff line number Diff line change
@@ -1,63 +1,72 @@
<UserControl x:Class="ICSharpCode.ILSpy.Options.DecompilerSettingsPanel"
x:ClassModifier="internal"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:properties="clr-namespace:ICSharpCode.ILSpy.Properties"
xmlns:options="clr-namespace:ICSharpCode.ILSpy.Options">
<UserControl.Resources>
<CollectionViewSource x:Key="SettingsCollection" Source="{Binding Settings}">
<CollectionViewSource.GroupDescriptions>
<PropertyGroupDescription PropertyName="Category" />
</CollectionViewSource.GroupDescriptions>
</CollectionViewSource>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Margin="3" Grid.ColumnSpan="3" TextWrapping="Wrap" Text="{x:Static properties:Resources.DecompilerSettingsPanelLongText}" />
<ListBox Grid.Row="1" ItemsSource="{Binding Source={StaticResource SettingsCollection}}">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Focusable" Value="False"/>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.GroupStyle>
<GroupStyle>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Vertical" />
</ItemsPanelTemplate>
</GroupStyle.Panel>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}" BasedOn="{StaticResource {x:Type GroupItem}}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Expander Padding="0" BorderThickness="0" IsExpanded="True">
<Expander.Header>
<CheckBox Checked="OnGroupChecked" Unchecked="OnGroupUnchecked" Loaded="OnGroupLoaded" VerticalContentAlignment="Center"
FontSize="16" FontWeight="Bold" Content="{Binding Name}" />
</Expander.Header>
<ItemsPresenter/>
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</ListBox.GroupStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox Margin="19,0,0,0" IsChecked="{Binding IsEnabled}" Content="{Binding Description}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:properties="clr-namespace:ICSharpCode.ILSpy.Properties"
xmlns:options="clr-namespace:ICSharpCode.ILSpy.Options"
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
xmlns:scroll="clr-namespace:LibScrollingOptimization;assembly=LibScrollingOptimization">
<UserControl.Resources>
<CollectionViewSource x:Key="SettingsCollection" Source="{Binding Settings}">
<CollectionViewSource.GroupDescriptions>
<PropertyGroupDescription PropertyName="Category" />
</CollectionViewSource.GroupDescriptions>
</CollectionViewSource>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Margin="3" Grid.ColumnSpan="3" TextWrapping="Wrap" Text="{x:Static properties:Resources.DecompilerSettingsPanelLongText}" />
<ListBox Grid.Row="1"
ItemsSource="{Binding Source={StaticResource SettingsCollection}}"
Background="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}"
BorderBrush="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}"
Padding="-1">
<behaviors:Interaction.Behaviors>
<scroll:SmoothScrollingBehavior/>
</behaviors:Interaction.Behaviors>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Focusable" Value="False"/>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.GroupStyle>
<GroupStyle>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Vertical" />
</ItemsPanelTemplate>
</GroupStyle.Panel>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}" BasedOn="{StaticResource {x:Type GroupItem}}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Expander Padding="0" BorderThickness="0" IsExpanded="True">
<Expander.Header>
<CheckBox Checked="OnGroupChecked" Unchecked="OnGroupUnchecked" Loaded="OnGroupLoaded" VerticalContentAlignment="Center"
FontSize="16" FontWeight="Bold" Content="{Binding Name}" />
</Expander.Header>
<ItemsPresenter/>
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</ListBox.GroupStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox Margin="19,0,0,0" IsChecked="{Binding IsEnabled}" Content="{Binding Description}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</UserControl>
Loading
Loading