From 09e10c4ce84fdd470801386d437f26feae10373b Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Sat, 4 Dec 2021 02:04:57 -0500 Subject: [PATCH] Initial commit --- Flow.Launcher/MainWindow.xaml | 1 + Flow.Launcher/MainWindow.xaml.cs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index dd8979650..618cee609 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -172,6 +172,7 @@ Background="Transparent" PreviewDragOver="OnPreviewDragOver" Style="{DynamicResource QueryBoxStyle}" + SelectionChanged="TextBox_SelectionChanged" Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Visibility="Visible"> diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index ba0b63a52..749f006c7 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -260,6 +260,14 @@ namespace Flow.Launcher isProgressBarStoryboardPaused = true; } + private void TextBox_SelectionChanged(object sender, RoutedEventArgs e) + { + + // QueryTextSuggestionBox.ScrollToCaret(); + QueryTextSuggestionBox.ScrollToLine(QueryTextBox.GetLineIndexFromCharacterIndex(QueryTextBox.SelectionStart)); + QueryTextSuggestionBox.CaretIndex = QueryTextBox.CaretIndex; + } + public void WindowAnimator() { if (_animating)