From e8ccd46589e9c9efd6be1620df6a8299c8afb7b7 Mon Sep 17 00:00:00 2001 From: DB p Date: Fri, 2 Sep 2022 14:35:25 +0900 Subject: [PATCH] - Add Preview Toggle (F2 Key) - Fix Seperate line for toggle - Block preview when nothing result --- Flow.Launcher/MainWindow.xaml | 8 ++++---- Flow.Launcher/MainWindow.xaml.cs | 26 ++++++++++++++++++++++++-- Flow.Launcher/ResultListBox.xaml | 1 + Flow.Launcher/Themes/Base.xaml | 32 +++++++++++++++++++++++++++++++- 4 files changed, 60 insertions(+), 7 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 17dccc893..545dba94f 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -237,7 +237,7 @@ + Style="{DynamicResource SeparatorStyle}" Visibility="Visible" /> - + @@ -303,8 +303,8 @@ - - + + diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 2b7db38cf..8adc788cc 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Threading.Tasks; using System.Windows; @@ -531,12 +531,34 @@ namespace Flow.Launcher } } break; + case Key.F2: + PreviewToggle(); + e.Handled = true; + break; + default: break; } } + public void PreviewToggle() + { + + if (Preview.Visibility == Visibility.Collapsed) + { + ResultArea.SetValue(Grid.ColumnSpanProperty, 1); + //HotkeyArea.SetValue(Visibility, Visibility.Collapsed); + Preview.Visibility = Visibility.Visible; + } + else + { + ResultArea.SetValue(Grid.ColumnSpanProperty, 2); + //HotkeyArea.SetValue(Visibility, Visibility.Visible); + Preview.Visibility = Visibility.Collapsed; + } + } + private void MoveQueryTextToEnd() { // QueryTextBox seems to be update with a DispatcherPriority as low as ContextIdle. @@ -556,4 +578,4 @@ namespace Flow.Launcher } } } -} \ No newline at end of file +} diff --git a/Flow.Launcher/ResultListBox.xaml b/Flow.Launcher/ResultListBox.xaml index f7e820050..646a43eda 100644 --- a/Flow.Launcher/ResultListBox.xaml +++ b/Flow.Launcher/ResultListBox.xaml @@ -56,6 +56,7 @@ - @@ -268,6 +282,22 @@ +