Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Dec 12, 2024
1 parent 8890f50 commit 94b38fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 31 deletions.
28 changes: 1 addition & 27 deletions JL.Windows/GUI/PopupWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
result.PrimarySpelling,
configManager.PrimarySpellingColor,
configManager.PrimarySpellingFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(2, 0, 0, 0));

Expand Down Expand Up @@ -610,7 +609,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
$"({string.Join(", ", result.PrimarySpellingOrthographyInfoList)})",
DictOptionManager.POrthographyInfoColor,
pOrthographyInfoFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(3, 0, 0, 0));

Expand All @@ -629,7 +627,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
TextBox readingTextBox = PopupWindowUtils.CreateTextBox(nameof(result.Readings),
readingsText, configManager.ReadingsColor,
configManager.ReadingsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(5, 0, 0, 0));

Expand Down Expand Up @@ -668,7 +665,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
readingsText,
configManager.ReadingsColor,
configManager.ReadingsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(7, 0, 0, 0));

Expand Down Expand Up @@ -735,7 +731,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
alternativeSpellingsText,
configManager.AlternativeSpellingsColor,
configManager.AlternativeSpellingsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(5, 0, 0, 0));

Expand All @@ -749,7 +744,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
alternativeSpellingsText,
configManager.AlternativeSpellingsColor,
configManager.AlternativeSpellingsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(7, 0, 0, 0));

Expand All @@ -765,7 +759,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
$"{result.MatchedText} {result.DeconjugationProcess}",
configManager.DeconjugationInfoColor,
configManager.DeconjugationInfoFontSize,
PopupContextMenu,
VerticalAlignment.Top,
new Thickness(5, 0, 0, 0));

Expand All @@ -779,7 +772,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
$"{result.MatchedText} {result.DeconjugationProcess}",
configManager.DeconjugationInfoColor,
configManager.DeconjugationInfoFontSize,
PopupContextMenu,
VerticalAlignment.Top,
new Thickness(7, 0, 0, 0));

Expand All @@ -798,7 +790,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
LookupResultUtils.FrequenciesToText(validFrequencies, false, result.Frequencies.Count is 1),
configManager.FrequencyColor,
configManager.FrequencyFontSize,
PopupContextMenu,
VerticalAlignment.Top,
new Thickness(7, 0, 0, 0));

Expand All @@ -812,7 +803,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
result.Dict.Name,
configManager.DictTypeColor,
configManager.DictTypeFontSize,
PopupContextMenu,
VerticalAlignment.Top,
new Thickness(7, 0, 0, 0));

Expand All @@ -827,7 +817,7 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
Name = nameof(duplicateIconTextBlock),
Text = "⚠",
Foreground = configManager.DefinitionsColor,
FontSize = configManager.DictTypeFontSize,
FontSize = 14,
VerticalAlignment = VerticalAlignment.Top,
Margin = new Thickness(7, 0, 0, 0),
HorizontalAlignment = HorizontalAlignment.Left,
Expand All @@ -854,7 +844,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
result.FormattedDefinitions,
configManager.DefinitionsColor,
configManager.DefinitionsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(0, 2, 2, 2));

Expand All @@ -868,7 +857,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
result.FormattedDefinitions,
configManager.DefinitionsColor,
configManager.DefinitionsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(2));

Expand All @@ -885,7 +873,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
$"On: {string.Join('、', result.OnReadings)}",
configManager.DefinitionsColor,
configManager.DefinitionsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(0, 2, 2, 2));

Expand All @@ -900,7 +887,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
$"On: {string.Join('、', result.OnReadings)}",
configManager.DefinitionsColor,
configManager.DefinitionsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(2));

Expand All @@ -916,7 +902,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
$"Kun: {string.Join('、', result.KunReadings)}",
configManager.DefinitionsColor,
configManager.DefinitionsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(0, 2, 2, 2));

Expand All @@ -931,7 +916,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
$"Kun: {string.Join('、', result.KunReadings)}",
configManager.DefinitionsColor,
configManager.DefinitionsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(2));

Expand All @@ -947,7 +931,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
$"Nanori: {string.Join('、', result.NanoriReadings)}",
configManager.DefinitionsColor,
configManager.DefinitionsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(0, 2, 2, 2));

Expand All @@ -962,7 +945,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
$"Nanori: {string.Join('、', result.NanoriReadings)}",
configManager.DefinitionsColor,
configManager.DefinitionsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(2));

Expand All @@ -978,7 +960,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
$"Radical names: {string.Join('、', result.RadicalNames)}",
configManager.DefinitionsColor,
configManager.DefinitionsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(0, 2, 2, 2));

Expand All @@ -993,7 +974,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
$"Radical names: {string.Join('、', result.RadicalNames)}",
configManager.DefinitionsColor,
configManager.DefinitionsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(2));

Expand All @@ -1007,7 +987,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
$"Grade: {LookupResultUtils.GradeToText(result.KanjiGrade)}",
configManager.DefinitionsColor,
configManager.DefinitionsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(2));

Expand All @@ -1020,7 +999,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
string.Create(CultureInfo.InvariantCulture, $"Stroke count: {result.StrokeCount}"),
configManager.DefinitionsColor,
configManager.DefinitionsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(2));

Expand All @@ -1035,7 +1013,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
$"Composition: {result.KanjiComposition}",
configManager.DefinitionsColor,
configManager.DefinitionsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(0, 2, 2, 2));

Expand All @@ -1050,7 +1027,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
$"Composition: {result.KanjiComposition}",
configManager.DefinitionsColor,
configManager.DefinitionsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(2));

Expand All @@ -1066,7 +1042,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
$"Statistics:\n{result.KanjiStats}",
configManager.DefinitionsColor,
configManager.DefinitionsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(0, 2, 2, 2));

Expand All @@ -1081,7 +1056,6 @@ private StackPanel PrepareResultStackPanel(LookupResult result, int index, int r
$"Statistics:\n{result.KanjiStats}",
configManager.DefinitionsColor,
configManager.DefinitionsFontSize,
PopupContextMenu,
VerticalAlignment.Center,
new Thickness(2));

Expand Down
6 changes: 2 additions & 4 deletions JL.Windows/Utilities/PopupWindowUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ internal static class PopupWindowUtils
private static DoubleCollection StrokeDashArray { get; set; } = [1, 1];
public static readonly Timer PopupAutoHideTimer = new();

public static TextBlock CreateTextBlock(string name, string text, Brush foregroundBrush, double fontSize, ContextMenu contextMenu, VerticalAlignment verticalAlignment, Thickness margin)
public static TextBlock CreateTextBlock(string name, string text, Brush foregroundBrush, double fontSize, VerticalAlignment verticalAlignment, Thickness margin)
{
return new TextBlock
{
Name = name,
Text = text,
Foreground = foregroundBrush,
FontSize = fontSize,
ContextMenu = contextMenu,
VerticalAlignment = verticalAlignment,
Margin = margin,
HorizontalAlignment = HorizontalAlignment.Left,
Expand All @@ -42,7 +41,7 @@ public static TextBlock CreateTextBlock(string name, string text, Brush foregrou
};
}

public static TextBox CreateTextBox(string name, string text, Brush foregroundBrush, double fontSize, ContextMenu contextMenu, VerticalAlignment verticalAlignment, Thickness margin)
public static TextBox CreateTextBox(string name, string text, Brush foregroundBrush, double fontSize, VerticalAlignment verticalAlignment, Thickness margin)
{
TouchScreenTextBox textBox = new()
{
Expand All @@ -51,7 +50,6 @@ public static TextBox CreateTextBox(string name, string text, Brush foregroundBr
Foreground = foregroundBrush,
CaretBrush = foregroundBrush,
FontSize = fontSize,
ContextMenu = contextMenu,
VerticalAlignment = verticalAlignment,
Margin = margin,
HorizontalAlignment = HorizontalAlignment.Left,
Expand Down

0 comments on commit 94b38fb

Please sign in to comment.