Browse Source

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

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

36
ILSpy/Options/DecompilerSettingsPanel.xaml

@ -3,7 +3,10 @@
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,29 +23,21 @@
<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"/>
<Setter Property="Focusable" Value="False"/>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.GroupStyle>
<GroupStyle> <GroupStyle>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Vertical" />
</ItemsPanelTemplate>
</GroupStyle.Panel>
<GroupStyle.ContainerStyle> <GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}" BasedOn="{StaticResource {x:Type GroupItem}}"> <Style TargetType="{x:Type GroupItem}" BasedOn="{StaticResource {x:Type GroupItem}}">
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate> <ControlTemplate TargetType="GroupItem">
<Expander Padding="0" BorderThickness="0" IsExpanded="True"> <Expander Padding="0" BorderThickness="0" IsExpanded="True">
<Expander.Header> <Expander.Header>
<CheckBox Checked="OnGroupChecked" Unchecked="OnGroupUnchecked" Loaded="OnGroupLoaded" VerticalContentAlignment="Center" <CheckBox Checked="OnGroupChecked" Unchecked="OnGroupUnchecked" Loaded="OnGroupLoaded" VerticalContentAlignment="Center"
FontSize="16" FontWeight="Bold" Content="{Binding Name}" /> FontSize="16" FontWeight="Bold"
d:DataContext="{d:DesignInstance GroupItem}"
Content="{Binding Name}" />
</Expander.Header> </Expander.Header>
<ItemsPresenter /> <ItemsPresenter />
</Expander> </Expander>
@ -52,12 +47,13 @@
</Style> </Style>
</GroupStyle.ContainerStyle> </GroupStyle.ContainerStyle>
</GroupStyle> </GroupStyle>
</ListBox.GroupStyle> </ItemsControl.GroupStyle>
<ListBox.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<CheckBox Margin="19,0,0,0" IsChecked="{Binding IsEnabled}" Content="{Binding Description}" /> <CheckBox Margin="19,0,0,0" IsChecked="{Binding IsEnabled}" Content="{Binding Description}" />
</DataTemplate> </DataTemplate>
</ListBox.ItemTemplate> </ItemsControl.ItemTemplate>
</ListBox> </ItemsControl>
</ScrollViewer>
</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