From 04aea73d0cc90bffa1ddc4accf771d4feee0430b Mon Sep 17 00:00:00 2001 From: Dobin Park Date: Thu, 7 Oct 2021 21:34:42 +0900 Subject: [PATCH 1/6] - Fix ProgressBar (Finally!) --- Flow.Launcher/MainWindow.xaml | 4 ++-- Flow.Launcher/MainWindow.xaml.cs | 4 ++-- Flow.Launcher/SettingWindow.xaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index db015392a19..73b13be8c95 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -101,11 +101,11 @@ - + + Y1="0" Y2="0" X1="-150" X2="-50" Height="2" Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}},Path=ActualWidth}" StrokeThickness="1"> diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 95e7ed6a82d..e84a3148e2d 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -207,9 +207,9 @@ private void InitializeNotifyIcon() private void InitProgressbarAnimation() { - var da = new DoubleAnimation(ProgressBar.X2, ActualWidth + 100, + var da = new DoubleAnimation(ProgressBar.X2, ActualWidth + 150, new Duration(new TimeSpan(0, 0, 0, 0, 1600))); - var da1 = new DoubleAnimation(ProgressBar.X1, ActualWidth, new Duration(new TimeSpan(0, 0, 0, 0, 1600))); + var da1 = new DoubleAnimation(ProgressBar.X1, ActualWidth + 50, new Duration(new TimeSpan(0, 0, 0, 0, 1600))); Storyboard.SetTargetProperty(da, new PropertyPath("(Line.X2)")); Storyboard.SetTargetProperty(da1, new PropertyPath("(Line.X1)")); _progressBarStoryboard.Children.Add(da); diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 7dc8829bec7..2a552e7d821 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -447,7 +447,7 @@ - + a From 66eb300eb57c3e80b3505e1817931660e06a7528 Mon Sep 17 00:00:00 2001 From: Dobin Park Date: Fri, 15 Oct 2021 04:01:35 +0900 Subject: [PATCH 2/6] add right ctrl hotkey --- Flow.Launcher/MainWindow.xaml.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index e84a3148e2d..b8d53065820 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -357,5 +357,21 @@ private void MoveQueryTextToEnd() { QueryTextBox.CaretIndex = QueryTextBox.Text.Length; } + + protected override void OnKeyDown(KeyEventArgs e) + { + if (e.SystemKey == Key.RightAlt) + { + QuickView(); + // e.Handled = true; You need to evaluate if you really want to mark this key as handled! + } + + base.OnKeyDown(e); + } + + public void QuickView() + { + QueryTextBox.Text = "hello"; + } } } \ No newline at end of file From 53bffb8644318144b6f771ecb7c5bd663727a3fd Mon Sep 17 00:00:00 2001 From: Dobin Park Date: Sat, 16 Oct 2021 06:23:04 +0900 Subject: [PATCH 3/6] - Change f1 for preview toggle Key - Add QuickView Area --- Flow.Launcher/MainWindow.xaml | 22 ++++++++++++++++------ Flow.Launcher/MainWindow.xaml.cs | 29 +++++++++++++++++++---------- Flow.Launcher/ResultListBox.xaml | 2 +- Flow.Launcher/ResultListBox.xaml.cs | 7 +++++++ 4 files changed, 43 insertions(+), 17 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 73b13be8c95..2b722c25d8a 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -34,7 +34,6 @@ - @@ -108,7 +107,18 @@ Y1="0" Y2="0" X1="-150" X2="-50" Height="2" Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}},Path=ActualWidth}" StrokeThickness="1"> - + + + + + + + + + + + + @@ -134,16 +144,16 @@ - + - - + + - + diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index b8d53065820..1b1cf411630 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -19,6 +19,7 @@ using KeyEventArgs = System.Windows.Input.KeyEventArgs; using MessageBox = System.Windows.MessageBox; using NotifyIcon = System.Windows.Forms.NotifyIcon; +using System.Globalization; namespace Flow.Launcher { @@ -34,6 +35,8 @@ public partial class MainWindow #endregion + + public MainWindow(Settings settings, MainViewModel mainVM) { DataContext = mainVM; @@ -347,6 +350,10 @@ private void OnKeyDown(object sender, KeyEventArgs e) e.Handled = true; } break; + case Key.F1: + QuickPreviewToggle(); + e.Handled = true; + break; default: break; @@ -358,20 +365,22 @@ private void MoveQueryTextToEnd() QueryTextBox.CaretIndex = QueryTextBox.Text.Length; } - protected override void OnKeyDown(KeyEventArgs e) + public void QuickPreviewToggle() { - if (e.SystemKey == Key.RightAlt) + + if (QuickPreview.Visibility == Visibility.Collapsed) + { + QuickPreview.Visibility = Visibility.Visible; + System.Diagnostics.Debug.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + var Selected = ResultListBox.SelectedItem; + System.Diagnostics.Debug.WriteLine(Selected); + } + else { - QuickView(); - // e.Handled = true; You need to evaluate if you really want to mark this key as handled! + QuickPreview.Visibility = Visibility.Collapsed; + System.Diagnostics.Debug.WriteLine("~~~~~~~~~~~~~~~ Hide ~~~~~~~~~~~~~~~~"); } - - base.OnKeyDown(e); } - public void QuickView() - { - QueryTextBox.Text = "hello"; - } } } \ No newline at end of file diff --git a/Flow.Launcher/ResultListBox.xaml b/Flow.Launcher/ResultListBox.xaml index d52474d3f44..86df7842109 100644 --- a/Flow.Launcher/ResultListBox.xaml +++ b/Flow.Launcher/ResultListBox.xaml @@ -18,7 +18,7 @@ VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard" SelectionChanged="OnSelectionChanged" IsSynchronizedWithCurrentItem="True" - PreviewMouseDown="ListBox_PreviewMouseDown"> + PreviewMouseDown="ListBox_PreviewMouseDown" Name="ResultList"> diff --git a/Flow.Launcher/ResultListBox.xaml.cs b/Flow.Launcher/ResultListBox.xaml.cs index fd980e016c1..48699a65b35 100644 --- a/Flow.Launcher/ResultListBox.xaml.cs +++ b/Flow.Launcher/ResultListBox.xaml.cs @@ -6,9 +6,12 @@ namespace Flow.Launcher { public partial class ResultListBox { + public ICommand SelectionChangedCommand { get; set; } + protected object _lock = new object(); private Point _lastpos; private ListBoxItem curItem = null; + public ResultListBox() { InitializeComponent(); @@ -16,10 +19,14 @@ public ResultListBox() private void OnSelectionChanged(object sender, SelectionChangedEventArgs e) { + if (e.AddedItems.Count > 0 && e.AddedItems[0] != null) { ScrollIntoView(e.AddedItems[0]); } + + + } private void OnMouseEnter(object sender, MouseEventArgs e) From c1f1ca0417c572f2ad114d2b6050aa2da028808c Mon Sep 17 00:00:00 2001 From: Dobin Park Date: Sun, 17 Oct 2021 05:09:20 +0900 Subject: [PATCH 4/6] wip --- Flow.Launcher/MainWindow.xaml | 22 ++++++++++++++-------- Flow.Launcher/MainWindow.xaml.cs | 10 ++++++---- Flow.Launcher/ResultListBox.xaml.cs | 5 +++-- Flow.Launcher/Themes/Base.xaml | 28 ++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 14 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 2b722c25d8a..24961ba727e 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -107,17 +107,23 @@ Y1="0" Y2="0" X1="-150" X2="-50" Height="2" Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}},Path=ActualWidth}" StrokeThickness="1"> - - - + + + - - - + + + + + + + + + - - + + diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 1b1cf411630..5b48db10a65 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -371,14 +371,16 @@ public void QuickPreviewToggle() if (QuickPreview.Visibility == Visibility.Collapsed) { QuickPreview.Visibility = Visibility.Visible; - System.Diagnostics.Debug.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); - var Selected = ResultListBox.SelectedItem; - System.Diagnostics.Debug.WriteLine(Selected); + //System.Diagnostics.Debug.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + // string text = ResultListBox.GetItemText(ResultListBox.SelectedItem); + //var Selected = ResultListBox.SelectedItem; + //System.Diagnostics.Debug.WriteLine(Selected); + //PreviewTitle.Text = Selected.ToString } else { QuickPreview.Visibility = Visibility.Collapsed; - System.Diagnostics.Debug.WriteLine("~~~~~~~~~~~~~~~ Hide ~~~~~~~~~~~~~~~~"); + //System.Diagnostics.Debug.WriteLine("~~~~~~~~~~~~~~~ Hide ~~~~~~~~~~~~~~~~"); } } diff --git a/Flow.Launcher/ResultListBox.xaml.cs b/Flow.Launcher/ResultListBox.xaml.cs index 48699a65b35..2b37c5d83af 100644 --- a/Flow.Launcher/ResultListBox.xaml.cs +++ b/Flow.Launcher/ResultListBox.xaml.cs @@ -24,8 +24,9 @@ private void OnSelectionChanged(object sender, SelectionChangedEventArgs e) { ScrollIntoView(e.AddedItems[0]); } - - + //string text = ((sender as ListBox)?.SelectedItem as ListBoxItem).ToString(); + //System.Diagnostics.Debug.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + //System.Diagnostics.Debug.WriteLine(text); } diff --git a/Flow.Launcher/Themes/Base.xaml b/Flow.Launcher/Themes/Base.xaml index fba804b10ec..ed6cd411f21 100644 --- a/Flow.Launcher/Themes/Base.xaml +++ b/Flow.Launcher/Themes/Base.xaml @@ -232,6 +232,9 @@ + + + @@ -240,6 +243,22 @@ + + + @@ -293,5 +312,14 @@ + + \ No newline at end of file From fec00c576f33bc4b44bf496c21bea7fc89d78455 Mon Sep 17 00:00:00 2001 From: Dobin Park Date: Sun, 17 Oct 2021 05:09:20 +0900 Subject: [PATCH 5/6] wip --- Flow.Launcher/MainWindow.xaml | 23 +++++++++++++++-------- Flow.Launcher/MainWindow.xaml.cs | 10 ++++++---- Flow.Launcher/ResultListBox.xaml.cs | 17 ++++++++++++++++- Flow.Launcher/Themes/Base.xaml | 28 ++++++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 13 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 2b722c25d8a..b717bafc3f7 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -107,17 +107,24 @@ Y1="0" Y2="0" X1="-150" X2="-50" Height="2" Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}},Path=ActualWidth}" StrokeThickness="1"> - - - + + + - - - + + + + + + + + + + - - + + diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 1b1cf411630..5b48db10a65 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -371,14 +371,16 @@ public void QuickPreviewToggle() if (QuickPreview.Visibility == Visibility.Collapsed) { QuickPreview.Visibility = Visibility.Visible; - System.Diagnostics.Debug.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); - var Selected = ResultListBox.SelectedItem; - System.Diagnostics.Debug.WriteLine(Selected); + //System.Diagnostics.Debug.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + // string text = ResultListBox.GetItemText(ResultListBox.SelectedItem); + //var Selected = ResultListBox.SelectedItem; + //System.Diagnostics.Debug.WriteLine(Selected); + //PreviewTitle.Text = Selected.ToString } else { QuickPreview.Visibility = Visibility.Collapsed; - System.Diagnostics.Debug.WriteLine("~~~~~~~~~~~~~~~ Hide ~~~~~~~~~~~~~~~~"); + //System.Diagnostics.Debug.WriteLine("~~~~~~~~~~~~~~~ Hide ~~~~~~~~~~~~~~~~"); } } diff --git a/Flow.Launcher/ResultListBox.xaml.cs b/Flow.Launcher/ResultListBox.xaml.cs index 48699a65b35..ac3688fcf26 100644 --- a/Flow.Launcher/ResultListBox.xaml.cs +++ b/Flow.Launcher/ResultListBox.xaml.cs @@ -17,14 +17,29 @@ public ResultListBox() InitializeComponent(); } - private void OnSelectionChanged(object sender, SelectionChangedEventArgs e) + public void OnSelectionChanged(object sender, SelectionChangedEventArgs e) { if (e.AddedItems.Count > 0 && e.AddedItems[0] != null) { ScrollIntoView(e.AddedItems[0]); } + //string text = ((sender as ListBox)?.SelectedItem as ListBoxItem).ToString(); + if (((ListBox)sender).SelectedItem != null) + { + //MessageBox.Show("You have selected " + ((ListBox)sender).SelectedItem); + System.Diagnostics.Debug.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + //var text = ((ListBox)sender).SelectedItem; + //var text = (ListBox)ResultList.SelectedItem; + //System.Diagnostics.Debug.WriteLine(text); + //ListBox lstBox = (ListBox)sender; + //ListBoxItem item = lstBox.SelectedItem; + //var listBox = (ListBox)sender; + //ListBoxItem selectedItem = listBox.SelectedItem; + //someTextBox.Text = selectedItem.id; + + } } diff --git a/Flow.Launcher/Themes/Base.xaml b/Flow.Launcher/Themes/Base.xaml index fba804b10ec..ed6cd411f21 100644 --- a/Flow.Launcher/Themes/Base.xaml +++ b/Flow.Launcher/Themes/Base.xaml @@ -232,6 +232,9 @@ + + + @@ -240,6 +243,22 @@ + + + @@ -293,5 +312,14 @@ + + \ No newline at end of file From 357033c64453d2d29110ab013437709c05d31d34 Mon Sep 17 00:00:00 2001 From: DB p Date: Mon, 18 Oct 2021 11:38:43 +0900 Subject: [PATCH 6/6] Fix wrong width when start Remove comment --- Flow.Launcher/MainWindow.xaml | 4 ++-- Flow.Launcher/MainWindow.xaml.cs | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index dc69ffaf8e9..c122483cd28 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -107,10 +107,10 @@ Y1="0" Y2="0" X1="-150" X2="-50" Height="2" Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}},Path=ActualWidth}" StrokeThickness="1"> - + - + diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 5b48db10a65..5a210706200 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -371,16 +371,10 @@ public void QuickPreviewToggle() if (QuickPreview.Visibility == Visibility.Collapsed) { QuickPreview.Visibility = Visibility.Visible; - //System.Diagnostics.Debug.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); - // string text = ResultListBox.GetItemText(ResultListBox.SelectedItem); - //var Selected = ResultListBox.SelectedItem; - //System.Diagnostics.Debug.WriteLine(Selected); - //PreviewTitle.Text = Selected.ToString } else { QuickPreview.Visibility = Visibility.Collapsed; - //System.Diagnostics.Debug.WriteLine("~~~~~~~~~~~~~~~ Hide ~~~~~~~~~~~~~~~~"); } }