From bfee170d0fbeba908d9f228771af7a08351e7a10 Mon Sep 17 00:00:00 2001 From: Sparrkle Date: Wed, 5 Oct 2022 16:20:41 +0900 Subject: [PATCH 0001/1063] Changed ProgressBar Storyboard (No Dispatcher) --- Flow.Launcher/MainWindow.xaml | 1 - Flow.Launcher/MainWindow.xaml.cs | 60 +++++++++++--------------------- 2 files changed, 21 insertions(+), 40 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index dc3b3f145..7d8c195f3 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -250,7 +250,6 @@ Height="2" HorizontalAlignment="Right" StrokeThickness="1" - Style="{DynamicResource PendingLineStyle}" Visibility="{Binding ProgressBarVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" X1="-150" X2="-50" diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 332e0f502..1dd9fe34d 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -28,9 +28,6 @@ namespace Flow.Launcher public partial class MainWindow { #region Private Fields - - private readonly Storyboard _progressBarStoryboard = new Storyboard(); - private bool isProgressBarStoryboardPaused; private Settings _settings; private NotifyIcon _notifyIcon; private ContextMenu contextMenu; @@ -119,39 +116,9 @@ namespace Flow.Launcher _viewModel.LastQuerySelected = true; } - if (_viewModel.ProgressBarVisibility == Visibility.Visible && isProgressBarStoryboardPaused) - { - _progressBarStoryboard.Begin(ProgressBar, true); - isProgressBarStoryboardPaused = false; - } - if(_settings.UseAnimation) WindowAnimator(); } - else if (!isProgressBarStoryboardPaused) - { - _progressBarStoryboard.Stop(ProgressBar); - isProgressBarStoryboardPaused = true; - } - - break; - } - case nameof(MainViewModel.ProgressBarVisibility): - { - Dispatcher.Invoke(() => - { - if (_viewModel.ProgressBarVisibility == Visibility.Hidden && !isProgressBarStoryboardPaused) - { - _progressBarStoryboard.Stop(ProgressBar); - isProgressBarStoryboardPaused = true; - } - else if (_viewModel.MainWindowVisibilityStatus && - isProgressBarStoryboardPaused) - { - _progressBarStoryboard.Begin(ProgressBar, true); - isProgressBarStoryboardPaused = false; - } - }); break; } case nameof(MainViewModel.QueryTextCursorMovedToEnd): @@ -291,17 +258,32 @@ namespace Flow.Launcher } private void InitProgressbarAnimation() { - var da = new DoubleAnimation(ProgressBar.X2, ActualWidth + 150, - new Duration(new TimeSpan(0, 0, 0, 0, 1600))); + var progressBarStoryBoard = new Storyboard(); + + var da = new DoubleAnimation(ProgressBar.X2, ActualWidth + 150, 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); - _progressBarStoryboard.Children.Add(da1); - _progressBarStoryboard.RepeatBehavior = RepeatBehavior.Forever; + progressBarStoryBoard.Children.Add(da); + progressBarStoryBoard.Children.Add(da1); + progressBarStoryBoard.RepeatBehavior = RepeatBehavior.Forever; + + da.Freeze(); + da1.Freeze(); + + var beginStoryboard = new BeginStoryboard(); + beginStoryboard.Storyboard = progressBarStoryBoard; + + var trigger = new Trigger { Property = System.Windows.Shapes.Line.VisibilityProperty, Value = Visibility.Visible }; + trigger.EnterActions.Add(beginStoryboard); + + var progressStyle = new Style(typeof(System.Windows.Shapes.Line)); + progressStyle.BasedOn = FindResource("PendingLineStyle") as Style; + progressStyle.Triggers.Add(trigger); + + ProgressBar.Style = progressStyle; _viewModel.ProgressBarVisibility = Visibility.Hidden; - isProgressBarStoryboardPaused = true; } public void WindowAnimator() { From 9e5cfd2f1c0b0b470ba1bcacf1f591ab91eb889c Mon Sep 17 00:00:00 2001 From: DB p Date: Sun, 13 Nov 2022 03:27:41 +0900 Subject: [PATCH 0002/1063] Add messageBoxEx prototype --- Flow.Launcher/MessageBoxEx.xaml | 105 ++++++++++++++++++++++++++++ Flow.Launcher/MessageBoxEx.xaml.cs | 62 ++++++++++++++++ Flow.Launcher/SettingWindow.xaml | 10 ++- Flow.Launcher/SettingWindow.xaml.cs | 4 ++ 4 files changed, 178 insertions(+), 3 deletions(-) create mode 100644 Flow.Launcher/MessageBoxEx.xaml create mode 100644 Flow.Launcher/MessageBoxEx.xaml.cs diff --git a/Flow.Launcher/MessageBoxEx.xaml b/Flow.Launcher/MessageBoxEx.xaml new file mode 100644 index 000000000..9528b764d --- /dev/null +++ b/Flow.Launcher/MessageBoxEx.xaml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Flow.Launcher/MessageBoxEx.xaml.cs b/Flow.Launcher/MessageBoxEx.xaml.cs new file mode 100644 index 000000000..dccf8131b --- /dev/null +++ b/Flow.Launcher/MessageBoxEx.xaml.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Forms; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; +using Flow.Launcher.Core.Resource; +using YamlDotNet.Core.Tokens; + +namespace Flow.Launcher +{ + /// + /// MessageBoxEx.xaml에 대한 상호 작용 논리 + /// + public partial class MessageBoxEx : Window + { + static MessageBoxEx msgBox; + static string Button_id; + public MessageBoxEx() + { + InitializeComponent(); + } + + + public static string Show(string txtMessage, string txtTitle) + { + msgBox = new MessageBoxEx(); + msgBox.TitleTextBlock.Text = txtTitle; + msgBox.DescTextBlock.Text = txtMessage; + //msgBox.label1.Text = txtMessage; + //msgBox.Text = txtTitle; + msgBox.ShowDialog(); + return Button_id; + } + + private void BtnCancel_OnClick(object sender, RoutedEventArgs e) + { + DialogResult = false; + Close(); + } + + private void BtnAdd_OnClick(object sender, RoutedEventArgs e) + { + + Close(); + } + + private void cmdEsc_OnPress(object sender, ExecutedRoutedEventArgs e) + { + DialogResult = false; + Close(); + } + } +} diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 950694db5..c246db1af 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -48,10 +48,9 @@ - + - + @@ -2906,7 +2905,12 @@ Margin="0,0,12,0" Click="ClearLogFolder" Content="{Binding CheckLogFolder, UpdateSourceTrigger=PropertyChanged}" /> + - + Margin="5,0,5,0" + Click="Button_Click" + Content="{DynamicResource cancel}" /> + @@ -51,7 +51,7 @@ - + - - + + - - + + @@ -75,7 +81,7 @@ Title="{DynamicResource icons}" Margin="0 14 0 0" Icon=""> - + From 41b9068dd7229b9b08d9416f246687f30eb8d5d7 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 1 Jun 2024 04:17:05 +0900 Subject: [PATCH 0059/1063] - Adjust item margins - Add subtext for "hideOnStartup" --- Flow.Launcher/Languages/en.xaml | 1 + .../Views/SettingsPaneGeneral.xaml | 24 +++++++++++-------- .../SettingPages/Views/SettingsPaneTheme.xaml | 17 +++++++------ 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 28b516757..50096b5c1 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -75,6 +75,7 @@ Auto Update Select Hide Flow Launcher on startup + Flow Launcher starts out hidden in the tray. Hide tray icon When the icon is hidden from the tray, the Settings menu can be opened by right-clicking on the search window. Query Search Precision diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml index 6b301e33a..a2b1a58a4 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml @@ -36,14 +36,17 @@ OnContent="{DynamicResource enable}" /> - + - + - + - + - - + + - + - + + + + + + + + + + + + + + +