Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Jan 13, 2024
1 parent c68b7d7 commit 7d5b970
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
21 changes: 10 additions & 11 deletions JL.Core/Lookup/LookupUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -364,17 +364,16 @@ private static List<LookupResult> SortLookupResults(IEnumerable<LookupResult> lo

return int.MaxValue;
})
//.ThenBy(static lookupResult =>
//{
// int index = lookupResult.Readings is not null
// ? Array.IndexOf(lookupResult.Readings, lookupResult.MatchedText)
// : -1;

// return index is not -1
// ? index
// : int.MaxValue;
//})
//.ThenByDescending(static lookupResult => lookupResult.PrimarySpelling.Length)
.ThenBy(static lookupResult =>
{
int index = lookupResult.Readings is not null
? Array.IndexOf(lookupResult.Readings, lookupResult.MatchedText)
: -1;

return index is not -1
? index
: int.MaxValue;
})
.ToList();
}

Expand Down
12 changes: 6 additions & 6 deletions JL.Windows/GUI/UserControls/DictOptionsControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,18 @@
<TextBlock Text="Show antonyms" TextWrapping="Wrap" HorizontalAlignment="Left" Style="{StaticResource TextBlockDefault}" />
</CheckBox>

<CheckBox Name="UseDBCheckBox" Margin="10" Visibility="Collapsed" HorizontalAlignment="Left">
<TextBlock Text="Store dictionary in a DB instead of memory"
ToolTip="Not recommended unless you are short on RAM. Enabling this will make lookups slower."
<CheckBox Name="ShowPitchAccentWithDottedLinesCheckBox" Margin="10" Visibility="Collapsed" HorizontalAlignment="Left">
<TextBlock Text="Show pitch accent with dotted lines"
ToolTip="If unchecked, pitch accent will be shown with solid lines"
Cursor="Help"
TextWrapping="Wrap"
HorizontalAlignment="Left"
Style="{StaticResource TextBlockDefault}" />
</CheckBox>

<CheckBox Name="ShowPitchAccentWithDottedLinesCheckBox" Margin="10" Visibility="Collapsed" HorizontalAlignment="Left">
<TextBlock Text="Show pitch accent with dotted lines"
ToolTip="If unchecked, pitch accent will be shown with solid lines"
<CheckBox Name="UseDBCheckBox" Margin="10" Visibility="Collapsed" HorizontalAlignment="Left">
<TextBlock Text="Store dictionary in a DB instead of memory"
ToolTip="Not recommended unless you are short on RAM. Enabling this will make lookups slower."
Cursor="Help"
TextWrapping="Wrap"
HorizontalAlignment="Left"
Expand Down

0 comments on commit 7d5b970

Please sign in to comment.