diff --git a/Text-Grab/Controls/BottomBarSettings.xaml b/Text-Grab/Controls/BottomBarSettings.xaml index 906121bf..113a0121 100644 --- a/Text-Grab/Controls/BottomBarSettings.xaml +++ b/Text-Grab/Controls/BottomBarSettings.xaml @@ -74,7 +74,8 @@ Margin="0,0,8,0" d:Symbol="Diamond24" FontSize="24" - Symbol="{Binding Path=SymbolIcon, Mode=TwoWay}" /> + Symbol="{Binding Path=SymbolIcon, + Mode=TwoWay}" /> @@ -173,7 +174,8 @@ Margin="0,0,8,0" d:Symbol="Diamond24" FontSize="24" - Symbol="{Binding Path=SymbolIcon, Mode=TwoWay}" /> + Symbol="{Binding Path=SymbolIcon, + Mode=TwoWay}" /> diff --git a/Text-Grab/Models/WebSearchUrlModel.cs b/Text-Grab/Models/WebSearchUrlModel.cs index ef59bbbc..7053d22f 100644 --- a/Text-Grab/Models/WebSearchUrlModel.cs +++ b/Text-Grab/Models/WebSearchUrlModel.cs @@ -26,6 +26,7 @@ public WebSearchUrlModel DefaultSearcher } } + public override string ToString() => Name; private List webSearchers = []; diff --git a/Text-Grab/Pages/GeneralSettings.xaml b/Text-Grab/Pages/GeneralSettings.xaml index ae144ccf..b9769448 100644 --- a/Text-Grab/Pages/GeneralSettings.xaml +++ b/Text-Grab/Pages/GeneralSettings.xaml @@ -6,6 +6,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Text_Grab.Pages" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:models="clr-namespace:Text_Grab.Models" xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" Title="GeneralSettings" d:DesignHeight="1450" @@ -212,6 +213,24 @@ Disabling may speed up results + + + + + + + + + searcherSettings = Singleton.Instance.WebSearchers; + + foreach (WebSearchUrlModel searcher in searcherSettings) + WebSearchersComboBox.Items.Add(searcher); + + WebSearchersComboBox.SelectedItem = Singleton.Instance.DefaultSearcher; + ShowToastCheckBox.IsChecked = DefaultSettings.ShowToast; RunInBackgroundChkBx.IsChecked = DefaultSettings.RunInTheBackground; @@ -356,4 +366,14 @@ private void ShowToastCheckBox_Unchecked(object sender, RoutedEventArgs e) DefaultSettings.ShowToast = false; } + + private void WebSearchersComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + if (!settingsSet + || sender is not ComboBox comboBox + || comboBox.SelectedItem is not WebSearchUrlModel newDefault) + return; + + Singleton.Instance.DefaultSearcher = newDefault; + } }