Browse Source

Fix #3249: Settings panel shows strange hover/selection behavior

pull/3250/head
tom-englert 2 years ago
parent
commit
45cfb8fdbe
  1. 82
      ILSpy/Options/DecompilerSettingsPanel.xaml
  2. 1
      ILSpy/Options/DisplaySettingsPanel.xaml

82
ILSpy/Options/DecompilerSettingsPanel.xaml

@ -1,9 +1,12 @@
<UserControl x:Class="ICSharpCode.ILSpy.Options.DecompilerSettingsPanel" <UserControl x:Class="ICSharpCode.ILSpy.Options.DecompilerSettingsPanel"
x:ClassModifier="internal" x:ClassModifier="internal"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:properties="clr-namespace:ICSharpCode.ILSpy.Properties" xmlns:properties="clr-namespace:ICSharpCode.ILSpy.Properties"
xmlns:toms="urn:TomsToolbox"> xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:options="clr-namespace:ICSharpCode.ILSpy.Options"
d:DataContext="{d:DesignInstance options:DecompilerSettingsViewModel}">
<UserControl.Resources> <UserControl.Resources>
<CollectionViewSource x:Key="SettingsCollection" Source="{Binding Settings}"> <CollectionViewSource x:Key="SettingsCollection" Source="{Binding Settings}">
<CollectionViewSource.GroupDescriptions> <CollectionViewSource.GroupDescriptions>
@ -20,44 +23,37 @@
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Margin="3" Grid.ColumnSpan="3" TextWrapping="Wrap" Text="{x:Static properties:Resources.DecompilerSettingsPanelLongText}" /> <TextBlock Margin="3" Grid.ColumnSpan="3" TextWrapping="Wrap" Text="{x:Static properties:Resources.DecompilerSettingsPanelLongText}" />
<ListBox Grid.Row="1" ItemsSource="{Binding Source={StaticResource SettingsCollection}}"> <ScrollViewer Grid.Row="1">
<ListBox.ItemContainerStyle> <ItemsControl ItemsSource="{Binding Source={StaticResource SettingsCollection}}">
<Style TargetType="ListBoxItem"> <ItemsControl.GroupStyle>
<Setter Property="IsTabStop" Value="False"/> <GroupStyle>
<Setter Property="Focusable" Value="False"/> <GroupStyle.ContainerStyle>
</Style> <Style TargetType="{x:Type GroupItem}" BasedOn="{StaticResource {x:Type GroupItem}}">
</ListBox.ItemContainerStyle> <Setter Property="Template">
<ListBox.GroupStyle> <Setter.Value>
<GroupStyle> <ControlTemplate TargetType="GroupItem">
<GroupStyle.Panel> <Expander Padding="0" BorderThickness="0" IsExpanded="True">
<ItemsPanelTemplate> <Expander.Header>
<VirtualizingStackPanel Orientation="Vertical" /> <CheckBox Checked="OnGroupChecked" Unchecked="OnGroupUnchecked" Loaded="OnGroupLoaded" VerticalContentAlignment="Center"
</ItemsPanelTemplate> FontSize="16" FontWeight="Bold"
</GroupStyle.Panel> d:DataContext="{d:DesignInstance GroupItem}"
<GroupStyle.ContainerStyle> Content="{Binding Name}" />
<Style TargetType="{x:Type GroupItem}" BasedOn="{StaticResource {x:Type GroupItem}}"> </Expander.Header>
<Setter Property="Template"> <ItemsPresenter />
<Setter.Value> </Expander>
<ControlTemplate> </ControlTemplate>
<Expander Padding="0" BorderThickness="0" IsExpanded="True"> </Setter.Value>
<Expander.Header> </Setter>
<CheckBox Checked="OnGroupChecked" Unchecked="OnGroupUnchecked" Loaded="OnGroupLoaded" VerticalContentAlignment="Center" </Style>
FontSize="16" FontWeight="Bold" Content="{Binding Name}" /> </GroupStyle.ContainerStyle>
</Expander.Header> </GroupStyle>
<ItemsPresenter/> </ItemsControl.GroupStyle>
</Expander> <ItemsControl.ItemTemplate>
</ControlTemplate> <DataTemplate>
</Setter.Value> <CheckBox Margin="19,0,0,0" IsChecked="{Binding IsEnabled}" Content="{Binding Description}" />
</Setter> </DataTemplate>
</Style> </ItemsControl.ItemTemplate>
</GroupStyle.ContainerStyle> </ItemsControl>
</GroupStyle> </ScrollViewer>
</ListBox.GroupStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox Margin="19,0,0,0" IsChecked="{Binding IsEnabled}" Content="{Binding Description}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid> </Grid>
</UserControl> </UserControl>

1
ILSpy/Options/DisplaySettingsPanel.xaml

@ -7,7 +7,6 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:themes="clr-namespace:ICSharpCode.ILSpy.Themes" xmlns:themes="clr-namespace:ICSharpCode.ILSpy.Themes"
xmlns:toms="urn:TomsToolbox"
d:DataContext="{d:DesignInstance local:DisplaySettingsViewModel}"> d:DataContext="{d:DesignInstance local:DisplaySettingsViewModel}">
<UserControl.Resources> <UserControl.Resources>
<local:FontSizeConverter x:Key="fontSizeConv" /> <local:FontSizeConverter x:Key="fontSizeConv" />

Loading…
Cancel
Save