Browse Source

Fix #3179: Apply auto-size hack to combo boxes in toolbar

pull/3307/head
Siegfried Pammer 7 months ago
parent
commit
9d6c2eb026
  1. 39
      ILSpy/MainWindow.xaml

39
ILSpy/MainWindow.xaml

@ -116,10 +116,13 @@
<Separator /> <Separator />
<!-- 'Open' toolbar category is inserted here --> <!-- 'Open' toolbar category is inserted here -->
<Separator /> <Separator />
<ComboBox Name="assemblyListComboBox" Width="100" MaxDropDownHeight="Auto" <Grid Margin="2,0">
ItemsSource="{Binding AssemblyListManager.AssemblyLists}" <ItemsControl ItemsSource="{Binding AssemblyListManager.AssemblyLists}" Height="0" Margin="15,0" />
ToolTip="{x:Static properties:Resources.SelectAssemblyListDropdownTooltip}" <ComboBox Name="assemblyListComboBox" MaxDropDownHeight="Auto"
SelectedItem="{Binding SessionSettings.ActiveAssemblyList}" /> ItemsSource="{Binding AssemblyListManager.AssemblyLists}"
ToolTip="{x:Static properties:Resources.SelectAssemblyListDropdownTooltip}"
SelectedItem="{Binding SessionSettings.ActiveAssemblyList}" />
</Grid>
<Button Command="{x:Static local:ILSpyCommands.ManageAssemblyListsCommand}" <Button Command="{x:Static local:ILSpyCommands.ManageAssemblyListsCommand}"
ToolTip="{x:Static properties:Resources.ManageAssemblyLists}"> ToolTip="{x:Static properties:Resources.ManageAssemblyLists}">
<Image Width="16" Height="16" Source="{controls:XamlResource Images/AssemblyList}" <Image Width="16" Height="16" Source="{controls:XamlResource Images/AssemblyList}"
@ -142,17 +145,23 @@
Style="{StaticResource DarkModeAwareImageStyle}" /> Style="{StaticResource DarkModeAwareImageStyle}" />
</CheckBox> </CheckBox>
<Separator /> <Separator />
<ComboBox Name="languageComboBox" DisplayMemberPath="Name" Width="100" MaxDropDownHeight="Auto" <Grid Margin="2,0">
IsEnabled="{Binding Workspace.ActiveTabPage.SupportsLanguageSwitching}" <ItemsControl ItemsSource="{x:Static local:Languages.AllLanguages}" DisplayMemberPath="Name" Height="0" Margin="15,0" />
ItemsSource="{x:Static local:Languages.AllLanguages}" <ComboBox Name="languageComboBox" DisplayMemberPath="Name" MaxDropDownHeight="Auto"
ToolTip="{x:Static properties:Resources.SelectLanguageDropdownTooltip}" IsEnabled="{Binding Workspace.ActiveTabPage.SupportsLanguageSwitching}"
SelectedItem="{Binding SessionSettings.LanguageSettings.Language}" /> ItemsSource="{x:Static local:Languages.AllLanguages}"
<ComboBox Name="languageVersionComboBox" DisplayMemberPath="DisplayName" Width="120" MaxDropDownHeight="Auto" ToolTip="{x:Static properties:Resources.SelectLanguageDropdownTooltip}"
ToolTip="{x:Static properties:Resources.SelectVersionDropdownTooltip}" SelectedItem="{Binding SessionSettings.LanguageSettings.Language}" />
Visibility="{Binding SelectedItem.HasLanguageVersions, ElementName=languageComboBox, Converter={toms:BooleanToVisibilityConverter}}" </Grid>
IsEnabled="{Binding Workspace.ActiveTabPage.SupportsLanguageSwitching}" <Grid Margin="2,0">
ItemsSource="{Binding SelectedItem.LanguageVersions, ElementName=languageComboBox, UpdateSourceTrigger=PropertyChanged}" <ItemsControl ItemsSource="{Binding SelectedItem.LanguageVersions, ElementName=languageComboBox, UpdateSourceTrigger=PropertyChanged}" DisplayMemberPath="DisplayName" Height="0" Margin="15,0" />
SelectedItem="{Binding SessionSettings.LanguageSettings.LanguageVersion, UpdateSourceTrigger=PropertyChanged}" /> <ComboBox Name="languageVersionComboBox" DisplayMemberPath="DisplayName" MaxDropDownHeight="Auto"
ToolTip="{x:Static properties:Resources.SelectVersionDropdownTooltip}"
Visibility="{Binding SelectedItem.HasLanguageVersions, ElementName=languageComboBox, Converter={toms:BooleanToVisibilityConverter}}"
IsEnabled="{Binding Workspace.ActiveTabPage.SupportsLanguageSwitching}"
ItemsSource="{Binding SelectedItem.LanguageVersions, ElementName=languageComboBox, UpdateSourceTrigger=PropertyChanged}"
SelectedItem="{Binding SessionSettings.LanguageSettings.LanguageVersion, UpdateSourceTrigger=PropertyChanged}" />
</Grid>
</ToolBar> </ToolBar>
<!-- Update panel --> <!-- Update panel -->
<Border DockPanel.Dock="Top" BorderBrush="Black" BorderThickness="1" Name="updatePanel" Visibility="Collapsed"> <Border DockPanel.Dock="Top" BorderBrush="Black" BorderThickness="1" Name="updatePanel" Visibility="Collapsed">

Loading…
Cancel
Save