diff --git a/JL.Windows/GUI/MainWindow.xaml b/JL.Windows/GUI/MainWindow.xaml index 34cd82c7..a712d9f5 100644 --- a/JL.Windows/GUI/MainWindow.xaml +++ b/JL.Windows/GUI/MainWindow.xaml @@ -7,7 +7,7 @@ Title="JL" AllowsTransparency="True" mc:Ignorable="d" MinWidth="100" MinHeight="50" Width="800" Height="200" WindowStyle="None" ResizeMode="NoResize" Topmost="True" - Closing="MainWindow_Closing" PreviewKeyDown="Window_PreviewKeyDown" ScrollViewer.PanningMode="VerticalOnly" + Closing="MainWindow_Closing" PreviewKeyDown="Window_PreviewKeyDown" ScrollViewer.PanningMode="VerticalFirst" SizeChanged="MainWindow_SizeChanged" LocationChanged="Window_LocationChanged" ShowActivated="False" PreviewMouseDown="Window_PreviewMouseDown" DpiChanged="Window_DpiChanged" MouseLeave="Window_MouseLeave" MouseEnter="Window_MouseEnter" StateChanged="Window_StateChanged" x:ClassModifier="internal"> diff --git a/JL.Windows/GUI/PopupWindow.xaml b/JL.Windows/GUI/PopupWindow.xaml index 42dd0c91..9e9c255b 100644 --- a/JL.Windows/GUI/PopupWindow.xaml +++ b/JL.Windows/GUI/PopupWindow.xaml @@ -54,7 +54,7 @@ VirtualizingPanel.IsVirtualizingWhenGrouping="True" VirtualizingPanel.ScrollUnit="Pixel" BorderThickness="0" ScrollViewer.CanContentScroll="True" VirtualizingPanel.IsVirtualizing="True" ScrollViewer.VerticalScrollBarVisibility="Auto" VirtualizingPanel.IsContainerVirtualizable="True" - HorizontalContentAlignment="Stretch" MouseLeave="PopupListView_MouseLeave" + HorizontalContentAlignment="Stretch" MouseLeave="PopupListView_MouseLeave" ScrollViewer.PanningMode="VerticalFirst" Background="Transparent" x:Name="PopupListView"> diff --git a/JL.Windows/Utilities/PopupWindowUtils.cs b/JL.Windows/Utilities/PopupWindowUtils.cs index bc70ccfa..d07aaf48 100644 --- a/JL.Windows/Utilities/PopupWindowUtils.cs +++ b/JL.Windows/Utilities/PopupWindowUtils.cs @@ -44,7 +44,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) { - return new TouchScreenTextBox + TouchScreenTextBox textBox = new() { Name = name, Text = text, @@ -66,6 +66,12 @@ public static TextBox CreateTextBox(string name, string text, Brush foregroundBr BorderThickness = new Thickness(0), Padding = new Thickness(0) }; + + // Scrolling doesn’t work when touching a TextBox inside a ListView + // unless the TextBox's PanningMode is set to None explicitly. + ScrollViewer.SetPanningMode(textBox, PanningMode.None); + + return textBox; } public static Grid CreatePitchAccentGrid(string primarySpelling, string[]? alternativeSpellings,