Skip to content

Commit

Permalink
Show the matched text in results when there's a deconjugation process…
Browse files Browse the repository at this point in the history
… info for it
  • Loading branch information
rampaa committed Jan 23, 2024
1 parent 4cfba19 commit a65e530
Showing 1 changed file with 46 additions and 11 deletions.
57 changes: 46 additions & 11 deletions JL.Windows/GUI/PopupWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -711,18 +711,53 @@ public StackPanel PrepareResultStackPanel(LookupResult result, int index, int re

if (result.DeconjugationProcess is not null)
{
TextBlock deconjugationProcessTextBlock = new()
if (MiningMode)
{
Name = nameof(result.DeconjugationProcess),
Text = result.DeconjugationProcess,
Foreground = ConfigManager.DeconjugationInfoColor,
FontSize = ConfigManager.DeconjugationInfoFontSize,
Margin = new Thickness(5, 0, 0, 0),
TextWrapping = TextWrapping.Wrap,
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top
};
_ = top.Children.Add(deconjugationProcessTextBlock);
TouchScreenTextBox deconjugationProcessTextBox = new()
{
Name = nameof(result.DeconjugationProcess),
Text = string.Create(CultureInfo.InvariantCulture, $"{result.MatchedText} {result.DeconjugationProcess}"),
TextWrapping = TextWrapping.Wrap,
Background = Brushes.Transparent,
Foreground = ConfigManager.DeconjugationInfoColor,
FontSize = ConfigManager.DeconjugationInfoFontSize,
BorderThickness = new Thickness(0, 0, 0, 0),
Margin = new Thickness(5, 0, 0, 0),
Padding = new Thickness(0),
IsReadOnly = true,
IsUndoEnabled = false,
UndoLimit = 0,
Cursor = Cursors.Arrow,
SelectionBrush = ConfigManager.HighlightColor,
IsInactiveSelectionHighlightEnabled = true,
ContextMenu = PopupContextMenu,
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top
};

deconjugationProcessTextBox.PreviewMouseUp += TextBox_PreviewMouseUp;
deconjugationProcessTextBox.MouseMove += TextBox_MouseMove;
deconjugationProcessTextBox.LostFocus += Unselect;
deconjugationProcessTextBox.PreviewMouseRightButtonUp += TextBox_PreviewMouseRightButtonUp;
deconjugationProcessTextBox.MouseLeave += OnMouseLeave;
deconjugationProcessTextBox.PreviewMouseLeftButtonDown += TextBox_PreviewMouseLeftButtonDown;
_ = top.Children.Add(deconjugationProcessTextBox);
}
else
{
TextBlock deconjugationProcessTextBlock = new()
{
Name = nameof(result.DeconjugationProcess),
Text = string.Create(CultureInfo.InvariantCulture, $"{result.MatchedText} {result.DeconjugationProcess}"),
Foreground = ConfigManager.DeconjugationInfoColor,
FontSize = ConfigManager.DeconjugationInfoFontSize,
Margin = new Thickness(5, 0, 0, 0),
TextWrapping = TextWrapping.Wrap,
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top
};
_ = top.Children.Add(deconjugationProcessTextBlock);
}
}

if (result.Frequencies is not null)
Expand Down

0 comments on commit a65e530

Please sign in to comment.