Skip to content

Commit

Permalink
Open dropdown box for Species on gaining focus
Browse files Browse the repository at this point in the history
  • Loading branch information
jamckee authored and Rottenbeer committed Aug 4, 2019
1 parent 81fcdbe commit d7c3869
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion LarkatorGUI/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
<Grid Margin="16,0,16,16" Visibility="{Binding NewSearchActive, Converter={StaticResource BoolToVisibilityConverter}}" Background="#44ffffff">
<StackPanel Margin="8" Orientation="Vertical" HorizontalAlignment="Stretch" DataContext="{Binding NewSearch}">
<ComboBox x:Name="groupsCombo" Text="{Binding Group}" IsEditable="True" />
<ComboBox x:Name="speciesCombo" Text="{Binding Species}" IsEditable="True" StaysOpenOnEdit="True"/>
<ComboBox x:Name="speciesCombo" Text="{Binding Species}" IsEditable="True" StaysOpenOnEdit="True" GotFocus="ComboOpen" AllowDrop="True"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="4">
<TextBlock Text="Min "/>
<TextBlock Text="{Binding MinLevel, ConverterParameter=-, Converter={StaticResource OptionalIntConverter}}" MinWidth="64" MouseWheel="AdjustableInteger_MouseWheel"/>
Expand Down
12 changes: 12 additions & 0 deletions LarkatorGUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ public MainWindow()
DiscoverCalibration();

DataContext = this;
this.MouseDown += new MouseButtonEventHandler(window_MouseDown);

InitializeComponent();

Expand Down Expand Up @@ -1005,5 +1006,16 @@ private async Task WaitForNameSearch()
dvm.Highlight = (dvm.Dino.Name != null) && dvm.Dino.Name.Contains(searchText);
}
}

private void ComboOpen(object sender, EventArgs e)
{
//Open the box when we first click into the text
speciesCombo.IsDropDownOpen = true;
}

private void window_MouseDown(object sender, MouseButtonEventArgs e)
{
Keyboard.ClearFocus();
}
}
}

0 comments on commit d7c3869

Please sign in to comment.