Add UI to select browser engine

This commit is contained in:
Vic 2023-02-03 17:07:33 +08:00
parent fe5da58378
commit c7f3283e3a
4 changed files with 29 additions and 18 deletions

View file

@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
using Flow.Launcher.Plugin.BrowserBookmark.Models;
namespace Flow.Launcher.Plugin.BrowserBookmark

View file

@ -22,4 +22,5 @@
<system:String x:Key="flowlauncher_plugin_browserbookmark_addBrowserBookmark">Add</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_removeBrowserBookmark">Delete</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_others">Others</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_browserEngine">Browser Engine</system:String>
</ResourceDictionary>

View file

@ -5,6 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Flow.Launcher.Plugin.BrowserBookmark.Models"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="clr-namespace:Flow.Launcher.Infrastructure.UI;assembly=Flow.Launcher.Infrastructure"
Title="{DynamicResource flowlauncher_plugin_browserbookmark_bookmarkDataSetting}"
Width="520"
Background="{DynamicResource PopuBGColor}"
@ -79,6 +80,7 @@
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock
Grid.Row="0"
@ -104,9 +106,28 @@
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource flowlauncher_plugin_browserbookmark_browserEngine}" />
<ComboBox
Grid.Row="1"
Grid.Column="1"
Width="120"
Height="34"
Margin="5,10,10,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
ItemsSource="{Binding Source={ui:EnumBindingSource {x:Type local:BrowserType}}}"
SelectedItem="{Binding BrowserType}">
</ComboBox>
<TextBlock
Grid.Row="2"
Grid.Column="0"
Margin="5,10,20,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource flowlauncher_plugin_browserbookmark_browserBookmarkDataDirectory}" />
<TextBox
Grid.Row="1"
Grid.Row="2"
Grid.Column="1"
Height="34"
Margin="5,10,0,0"

View file

@ -1,17 +1,7 @@
using Flow.Launcher.Plugin.BrowserBookmark.Models;
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.Shapes;
namespace Flow.Launcher.Plugin.BrowserBookmark.Views
{
@ -27,7 +17,9 @@ namespace Flow.Launcher.Plugin.BrowserBookmark.Views
currentCustomBrowser = browser;
DataContext = new CustomBrowser
{
Name = browser.Name, DataDirectoryPath = browser.DataDirectoryPath
Name = browser.Name,
DataDirectoryPath = browser.DataDirectoryPath,
BrowserType = browser.BrowserType,
};
}
@ -39,6 +31,7 @@ namespace Flow.Launcher.Plugin.BrowserBookmark.Views
{
currentCustomBrowser.Name = editBrowser.Name;
currentCustomBrowser.DataDirectoryPath = editBrowser.DataDirectoryPath;
currentCustomBrowser.BrowserType = editBrowser.BrowserType;
Close();
}
}
@ -54,4 +47,4 @@ namespace Flow.Launcher.Plugin.BrowserBookmark.Views
}
}
}
}
}