From b4570e9aaa497037abb8e97be2c3cf8ded7bc723 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 27 Apr 2024 21:57:55 +0900 Subject: [PATCH] - Add Pages --- Flow.Launcher/Flow.Launcher.csproj | 4 - .../Resources/SettingWindowStyle.xaml | 4 + Flow.Launcher/SettingPages/General.xaml | 19 - Flow.Launcher/SettingPages/General.xaml.cs | 22 - .../ViewModels/GeneralViewModel.cs | 49 +- Flow.Launcher/SettingPages/Views/About.xaml | 232 ++ .../SettingPages/Views/About.xaml.cs | 37 + Flow.Launcher/SettingPages/Views/General.xaml | 517 +++ .../SettingPages/Views/General.xaml.cs | 51 + Flow.Launcher/SettingPages/Views/Hotkey.xaml | 471 +++ .../SettingPages/Views/Hotkey.xaml.cs | 28 + .../SettingPages/Views/PluginStore.xaml | 347 ++ .../SettingPages/Views/PluginStore.xaml.cs | 28 + Flow.Launcher/SettingPages/Views/Plugins.xaml | 384 +++ .../SettingPages/Views/Plugins.xaml.cs | 28 + Flow.Launcher/SettingPages/Views/Proxy.xaml | 180 + .../SettingPages/Views/Proxy.xaml.cs | 28 + Flow.Launcher/SettingPages/Views/Theme.xaml | 744 +++++ .../SettingPages/Views/Theme.xaml.cs | 25 + Flow.Launcher/SettingWindow.xaml | 2933 ----------------- Flow.Launcher/SettingWindow.xaml.cs | 166 +- .../ViewModel/SettingWindowViewModel.cs | 23 - 22 files changed, 3235 insertions(+), 3085 deletions(-) delete mode 100644 Flow.Launcher/SettingPages/General.xaml delete mode 100644 Flow.Launcher/SettingPages/General.xaml.cs create mode 100644 Flow.Launcher/SettingPages/Views/About.xaml create mode 100644 Flow.Launcher/SettingPages/Views/About.xaml.cs create mode 100644 Flow.Launcher/SettingPages/Views/General.xaml create mode 100644 Flow.Launcher/SettingPages/Views/General.xaml.cs create mode 100644 Flow.Launcher/SettingPages/Views/Hotkey.xaml create mode 100644 Flow.Launcher/SettingPages/Views/Hotkey.xaml.cs create mode 100644 Flow.Launcher/SettingPages/Views/PluginStore.xaml create mode 100644 Flow.Launcher/SettingPages/Views/PluginStore.xaml.cs create mode 100644 Flow.Launcher/SettingPages/Views/Plugins.xaml create mode 100644 Flow.Launcher/SettingPages/Views/Plugins.xaml.cs create mode 100644 Flow.Launcher/SettingPages/Views/Proxy.xaml create mode 100644 Flow.Launcher/SettingPages/Views/Proxy.xaml.cs create mode 100644 Flow.Launcher/SettingPages/Views/Theme.xaml create mode 100644 Flow.Launcher/SettingPages/Views/Theme.xaml.cs diff --git a/Flow.Launcher/Flow.Launcher.csproj b/Flow.Launcher/Flow.Launcher.csproj index c280c3c7e..53c1bafc7 100644 --- a/Flow.Launcher/Flow.Launcher.csproj +++ b/Flow.Launcher/Flow.Launcher.csproj @@ -111,10 +111,6 @@ - - - - diff --git a/Flow.Launcher/Resources/SettingWindowStyle.xaml b/Flow.Launcher/Resources/SettingWindowStyle.xaml index 97671b088..485a0159d 100644 --- a/Flow.Launcher/Resources/SettingWindowStyle.xaml +++ b/Flow.Launcher/Resources/SettingWindowStyle.xaml @@ -20,6 +20,10 @@ + + + + + + +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +  + + + + + + + + + + + + + + +  + + + + + + + + + + + + +  + + + + + + + + + + + +  + + + + + + + + + + + + +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +  + + + + + + + + + + + + + + + + + + + diff --git a/Flow.Launcher/SettingPages/Views/PluginStore.xaml.cs b/Flow.Launcher/SettingPages/Views/PluginStore.xaml.cs new file mode 100644 index 000000000..3d756f6fa --- /dev/null +++ b/Flow.Launcher/SettingPages/Views/PluginStore.xaml.cs @@ -0,0 +1,28 @@ +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.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Flow.Launcher.SettingPages.Views +{ + /// + /// PluginStore.xaml에 대한 상호 작용 논리 + /// + public partial class PluginStore : Page + { + public PluginStore() + { + InitializeComponent(); + } + } +} diff --git a/Flow.Launcher/SettingPages/Views/Plugins.xaml b/Flow.Launcher/SettingPages/Views/Plugins.xaml new file mode 100644 index 000000000..d0545de11 --- /dev/null +++ b/Flow.Launcher/SettingPages/Views/Plugins.xaml @@ -0,0 +1,384 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +  + + + - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - -  - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - -  - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - -  - - - - - - - - - - - - diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 0bba24997..8f3edc872 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -42,7 +42,7 @@ namespace Flow.Launcher API = api; InitializePosition(); InitializeComponent(); - + NavView.SelectedItem = NavView.MenuItems[0]; /* Set First Page */ } #region General @@ -54,28 +54,28 @@ namespace Flow.Launcher // https://stackoverflow.com/questions/4951058/software-rendering-mode-wpf HwndSource hwndSource = PresentationSource.FromVisual(this) as HwndSource; HwndTarget hwndTarget = hwndSource.CompositionTarget; - hwndTarget.RenderMode = RenderMode.SoftwareOnly; + hwndTarget.RenderMode = RenderMode.Default; - pluginListView = (CollectionView)CollectionViewSource.GetDefaultView(Plugins.ItemsSource); - pluginListView.Filter = PluginListFilter; + //pluginListView = (CollectionView)CollectionViewSource.GetDefaultView(Plugins.ItemsSource); + //pluginListView.Filter = PluginListFilter; - pluginStoreView = (CollectionView)CollectionViewSource.GetDefaultView(StoreListBox.ItemsSource); - pluginStoreView.Filter = PluginStoreFilter; + //pluginStoreView = (CollectionView)CollectionViewSource.GetDefaultView(StoreListBox.ItemsSource); + //pluginStoreView.Filter = PluginStoreFilter; - viewModel.PropertyChanged += new PropertyChangedEventHandler(SettingsWindowViewModelChanged); + //viewModel.PropertyChanged += new PropertyChangedEventHandler(SettingsWindowViewModelChanged); InitializePosition(); } - private void SettingsWindowViewModelChanged(object sender, PropertyChangedEventArgs e) - { - if (e.PropertyName == nameof(viewModel.ExternalPlugins)) - { - pluginStoreView = (CollectionView)CollectionViewSource.GetDefaultView(StoreListBox.ItemsSource); - pluginStoreView.Filter = PluginStoreFilter; - pluginStoreView.Refresh(); - } - } + //private void SettingsWindowViewModelChanged(object sender, PropertyChangedEventArgs e) + //{ + // if (e.PropertyName == nameof(viewModel.ExternalPlugins)) + // { + // pluginStoreView = (CollectionView)CollectionViewSource.GetDefaultView(StoreListBox.ItemsSource); + // pluginStoreView.Filter = PluginStoreFilter; + // pluginStoreView.Refresh(); + // } + //} private void OnSelectPythonPathClick(object sender, RoutedEventArgs e) { @@ -375,75 +375,75 @@ namespace Flow.Launcher private CollectionView pluginListView; private CollectionView pluginStoreView; - private bool PluginListFilter(object item) - { - if (string.IsNullOrEmpty(pluginFilterTxb.Text)) - return true; - if (item is PluginViewModel model) - { - return StringMatcher.FuzzySearch(pluginFilterTxb.Text, model.PluginPair.Metadata.Name).IsSearchPrecisionScoreMet(); - } - return false; - } + //private bool PluginListFilter(object item) + //{ + // if (string.IsNullOrEmpty(pluginFilterTxb.Text)) + // return true; + // if (item is PluginViewModel model) + // { + // return StringMatcher.FuzzySearch(pluginFilterTxb.Text, model.PluginPair.Metadata.Name).IsSearchPrecisionScoreMet(); + // } + // return false; + //} - private bool PluginStoreFilter(object item) - { - if (string.IsNullOrEmpty(pluginStoreFilterTxb.Text)) - return true; - if (item is PluginStoreItemViewModel model) - { - return StringMatcher.FuzzySearch(pluginStoreFilterTxb.Text, model.Name).IsSearchPrecisionScoreMet() - || StringMatcher.FuzzySearch(pluginStoreFilterTxb.Text, model.Description).IsSearchPrecisionScoreMet(); - } - return false; - } + //private bool PluginStoreFilter(object item) + //{ + // if (string.IsNullOrEmpty(pluginStoreFilterTxb.Text)) + // return true; + // if (item is PluginStoreItemViewModel model) + // { + // return StringMatcher.FuzzySearch(pluginStoreFilterTxb.Text, model.Name).IsSearchPrecisionScoreMet() + // || StringMatcher.FuzzySearch(pluginStoreFilterTxb.Text, model.Description).IsSearchPrecisionScoreMet(); + // } + // return false; + //} private string lastPluginListSearch = ""; private string lastPluginStoreSearch = ""; - private void RefreshPluginListEventHandler(object sender, RoutedEventArgs e) - { - if (pluginFilterTxb.Text != lastPluginListSearch) - { - lastPluginListSearch = pluginFilterTxb.Text; - pluginListView.Refresh(); - } - } + //private void RefreshPluginListEventHandler(object sender, RoutedEventArgs e) + //{ + // if (pluginFilterTxb.Text != lastPluginListSearch) + // { + // lastPluginListSearch = pluginFilterTxb.Text; + // pluginListView.Refresh(); + // } + //} - private void RefreshPluginStoreEventHandler(object sender, RoutedEventArgs e) - { - if (pluginStoreFilterTxb.Text != lastPluginStoreSearch) - { - lastPluginStoreSearch = pluginStoreFilterTxb.Text; - pluginStoreView.Refresh(); - } - } + //private void RefreshPluginStoreEventHandler(object sender, RoutedEventArgs e) + //{ + // if (pluginStoreFilterTxb.Text != lastPluginStoreSearch) + // { + // lastPluginStoreSearch = pluginStoreFilterTxb.Text; + // pluginStoreView.Refresh(); + // } + //} - private void PluginFilterTxb_OnKeyDown(object sender, KeyEventArgs e) - { - if (e.Key == Key.Enter) - RefreshPluginListEventHandler(sender, e); - } + //private void PluginFilterTxb_OnKeyDown(object sender, KeyEventArgs e) + //{ + // if (e.Key == Key.Enter) + // RefreshPluginListEventHandler(sender, e); + //} - private void PluginStoreFilterTxb_OnKeyDown(object sender, KeyEventArgs e) - { - if (e.Key == Key.Enter) - RefreshPluginStoreEventHandler(sender, e); - } + //private void PluginStoreFilterTxb_OnKeyDown(object sender, KeyEventArgs e) + //{ + // if (e.Key == Key.Enter) + // RefreshPluginStoreEventHandler(sender, e); + //} - private void OnPluginSettingKeydown(object sender, KeyEventArgs e) - { - if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control && e.Key == Key.F) - pluginFilterTxb.Focus(); - } + //private void OnPluginSettingKeydown(object sender, KeyEventArgs e) + //{ + // if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control && e.Key == Key.F) + // pluginFilterTxb.Focus(); + //} - private void PluginStore_OnKeyDown(object sender, KeyEventArgs e) - { - if (e.Key == Key.F && (Keyboard.Modifiers & ModifierKeys.Control) != 0) - { - pluginStoreFilterTxb.Focus(); - } - } + //private void PluginStore_OnKeyDown(object sender, KeyEventArgs e) + //{ + // if (e.Key == Key.F && (Keyboard.Modifiers & ModifierKeys.Control) != 0) + // { + // pluginStoreFilterTxb.Focus(); + // } + //} public void InitializePosition() { @@ -495,15 +495,15 @@ namespace Flow.Launcher } - private void PluginStore_GotFocus(object sender, RoutedEventArgs e) - { - Keyboard.Focus(pluginStoreFilterTxb); - } + //private void PluginStore_GotFocus(object sender, RoutedEventArgs e) + //{ + // Keyboard.Focus(pluginStoreFilterTxb); + //} - private void Plugin_GotFocus(object sender, RoutedEventArgs e) - { - Keyboard.Focus(pluginFilterTxb); - } + //private void Plugin_GotFocus(object sender, RoutedEventArgs e) + //{ + // Keyboard.Focus(pluginFilterTxb); + //} /** For Navigation View **/ private void NavigationView_SelectionChanged(ModernWpf.Controls.NavigationView sender, ModernWpf.Controls.NavigationViewSelectionChangedEventArgs args) diff --git a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs index efd37b0e1..aa16e7cb7 100644 --- a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs +++ b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs @@ -481,29 +481,6 @@ namespace Flow.Launcher.ViewModel } } - public class SearchWindowScreen - { - public string Display { get; set; } - public SearchWindowScreens Value { get; set; } - } - - public List SearchWindowScreens - { - get - { - List modes = new List(); - var enums = (SearchWindowScreens[])Enum.GetValues(typeof(SearchWindowScreens)); - foreach (var e in enums) - { - var key = $"SearchWindowScreen{e}"; - var display = _translater.GetTranslation(key); - var m = new SearchWindowScreen { Display = display, Value = e, }; - modes.Add(m); - } - - return modes; - } - } public class SearchWindowAlign {