- Adjust Priority Change Popup Window Design

- Adjust Websearch setting layout
- Change and add Websearch String
- Change Websearch popup design
This commit is contained in:
DB p 2021-10-30 02:31:11 +09:00
parent f47de6b838
commit 0edbcfde2b
4 changed files with 117 additions and 62 deletions

View file

@ -6,52 +6,45 @@
xmlns:local="clr-namespace:Flow.Launcher"
Loaded="PriorityChangeWindow_Loaded"
mc:Ignorable="d"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen"
Title="{DynamicResource changePriorityWindow}" Height="400" Width="350" ResizeMode="NoResize" Background="#f3f3f3">
Title="{DynamicResource changePriorityWindow}" Height="365" Width="350" Background="#F3F3F3" BorderBrush="#cecece">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition Height="80"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" VerticalAlignment="Center">
<TextBlock Grid.Column="0" FontFamily="/Resources/#Segoe Fluent Icons" FontSize="40" TextAlignment="Center"
Margin="0 0 0 0">
&#xe8d0;
</TextBlock>
</StackPanel>
<Border Background="#ffffff" Grid.Row="1" BorderBrush="#cecece" BorderThickness="1" Margin="14 0 14 0" Padding="0 14 0 0" CornerRadius="5">
<StackPanel Orientation="Vertical" >
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="1">
<TextBlock FontSize="14" Grid.Column="1" VerticalAlignment="Center"
<Border BorderThickness="0 0 0 1" BorderBrush="#e5e5e5" Background="#ffffff" Padding="26 26 26 0">
<Grid>
<StackPanel>
<StackPanel Grid.Row="0" Margin="0 0 0 12">
<TextBlock Grid.Column="0" Text="{DynamicResource changePriorityWindow}" FontSize="20" FontWeight="SemiBold" FontFamily="Segoe UI" TextAlignment="Left"
Margin="0 0 0 0" />
</StackPanel>
<StackPanel>
<TextBlock
Text="{DynamicResource priority_tips}" Foreground="#1b1b1b" FontSize="14" TextWrapping="WrapWithOverflow" TextAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0 28 0 0">
<TextBlock FontSize="14" Grid.Column="1" VerticalAlignment="Center"
HorizontalAlignment="Left" Text="{DynamicResource currentPriority}" />
<TextBlock x:Name="OldPriority" Grid.Row="0" Grid.Column="1" Margin="14 0 10 0" FontSize="14"
<TextBlock x:Name="OldPriority" Grid.Row="0" Grid.Column="1" Margin="10 0 10 0" FontSize="14"
VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="Bold" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Center">
<TextBlock FontSize="14" VerticalAlignment="Center"
<StackPanel Orientation="Horizontal" Margin="0 10 0 0">
<TextBlock FontSize="14" VerticalAlignment="Center"
HorizontalAlignment="Right" Text="{DynamicResource newPriority}" />
<TextBox x:Name="tbAction" Margin="14 10 15 10" Width="105" VerticalAlignment="Center" HorizontalAlignment="Left" />
</StackPanel>
</StackPanel>
<TextBox x:Name="tbAction" Margin="10 0 15 0" Width="105" VerticalAlignment="Center" HorizontalAlignment="Left" />
</StackPanel>
</StackPanel>
</Grid>
</Border>
<StackPanel Grid.Row="2" VerticalAlignment="Center">
<TextBlock Foreground="Gray"
Text="{DynamicResource priority_tips}" TextWrapping="WrapWithOverflow" TextAlignment="Center"
Margin="20,0,20,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="3" Grid.Column="1">
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="0 0 10 0" Width="80" Height="30"
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="1">
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="0 0 5 0" Width="100" Height="30"
Content="{DynamicResource cancel}" />
<Button x:Name="btnDone" Margin="10 0 0 0" Width="80" Height="30" Click="btnDone_OnClick">
<Button x:Name="btnDone" Margin="5 0 0 0" Width="100" Height="30" Click="btnDone_OnClick">
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />
</Button>
</StackPanel>

View file

@ -2,6 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<system:String x:Key="flowlauncher_plugin_websearch_window_title">Search Source Setting</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_open_search_in">Open search in:</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_new_window">New Window</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_new_tab">New Tab</system:String>
@ -14,7 +15,8 @@
<system:String x:Key="flowlauncher_plugin_websearch_action_keyword">Action Keyword</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_url">URL</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_search">Search</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_enable_suggestion">Search suggestions</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_enable_suggestion">Use Search Query Autocomplete: </system:String>
<system:String x:Key="flowlauncher_plugin_websearch_enable_suggestion_provider">Autocomplete Data from: </system:String>
<system:String x:Key="flowlauncher_plugin_websearch_pls_select_web_search">Please select a web search</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_delete_warning">Are you sure you want to delete {0}?</system:String>

View file

@ -5,11 +5,11 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:vm="clr-namespace:Flow.Launcher.Plugin.WebSearch"
mc:Ignorable="d"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen"
Title="Search Source Setting" Height="400" Width="500"
d:DataContext="{d:DesignInstance vm:SearchSourceViewModel}">
Title="{DynamicResource flowlauncher_plugin_websearch_window_title}" Height="425" Width="550"
d:DataContext="{d:DesignInstance vm:SearchSourceViewModel}" Background="#F3F3F3" BorderBrush="#cecece">
<Grid>
<!--
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
@ -59,5 +59,60 @@
Margin="10 0 10 0" Width="80" Height="35"
Content="{DynamicResource flowlauncher_plugin_websearch_confirm}" />
</StackPanel>
-->
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="80"/>
</Grid.RowDefinitions>
<Border BorderThickness="0 0 0 1" BorderBrush="#e5e5e5" Background="#ffffff" Padding="26 26 26 0">
<Grid>
<StackPanel>
<StackPanel Grid.Row="0" Margin="0 0 0 12">
<TextBlock Grid.Column="0" Text="{DynamicResource flowlauncher_plugin_websearch_window_title}" FontSize="20" FontWeight="SemiBold" FontFamily="Segoe UI" TextAlignment="Left"
Margin="0 0 0 0" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="10" FontSize="14" VerticalAlignment="Center" Width="100"
HorizontalAlignment="Stretch" Text="{DynamicResource flowlauncher_plugin_websearch_title}" />
<TextBox Text="{Binding SearchSource.Title}" Margin="10" Width="330"
VerticalAlignment="Center" HorizontalAlignment="Left" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="10" FontSize="14" Grid.Row="4" Grid.Column="0" VerticalAlignment="Center"
HorizontalAlignment="Left" Text="{DynamicResource flowlauncher_plugin_websearch_icon}" Width="100" />
<Button Click="OnSelectIconClick" Height="35" VerticalAlignment="Center" Margin="10 0 0 0"
Content="{DynamicResource flowlauncher_plugin_websearch_select_icon}" />
<Image Name="imgPreviewIcon" Width="24" Height="24" Margin="14 0 0 0" VerticalAlignment="Center"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="10" FontSize="14" VerticalAlignment="Center" Width="100"
HorizontalAlignment="Left" Text="{DynamicResource flowlauncher_plugin_websearch_url}" />
<TextBox Text="{Binding SearchSource.Url}" Margin="10" Grid.Row="1" Width="330" Grid.Column="1"
VerticalAlignment="Center" HorizontalAlignment="Left" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="10" FontSize="14" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Width="100"
HorizontalAlignment="Left" Text="{DynamicResource flowlauncher_plugin_websearch_action_keyword}" />
<TextBox Text="{Binding SearchSource.ActionKeyword}" Margin="10 0 10 0" Grid.Row="2" Width="330" Grid.Column="1"
VerticalAlignment="Center" HorizontalAlignment="Left" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="10" FontSize="14" Grid.Row="3" Grid.Column="0" VerticalAlignment="Center" Width="100"
HorizontalAlignment="Left" Text="{DynamicResource flowlauncher_plugin_websearch_enable}" />
<CheckBox IsChecked="{Binding SearchSource.Enabled}" Margin="10" Grid.Row="3" Grid.Column="1"
VerticalAlignment="Center" />
</StackPanel>
</StackPanel>
</Grid>
</Border>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="1">
<Button Click="OnCancelButtonClick"
Margin="10 0 5 0" Width="100" Height="35"
Content="{DynamicResource flowlauncher_plugin_websearch_cancel}" />
<Button Click="OnConfirmButtonClick"
Margin="5 0 10 0" Width="100" Height="35"
Content="{DynamicResource flowlauncher_plugin_websearch_confirm}" />
</StackPanel>
</Grid>
</Window>

View file

@ -32,42 +32,32 @@
</DockPanel>
</DataTemplate>
</UserControl.Resources>
<Grid Margin="14">
<Grid Margin="14 14 14 0">
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition Height="48" />
<RowDefinition Height="45" />
<RowDefinition Height="40" />
<RowDefinition />
<RowDefinition Height="56"/>
<RowDefinition Height="50" />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Grid.Row="0">
<CheckBox IsChecked="{Binding Settings.EnableSuggestion}"
Margin="0 0 20 0"
Name="EnableSuggestion"
Content="{DynamicResource flowlauncher_plugin_websearch_enable_suggestion}" />
<ComboBox ItemsSource="{Binding Settings.Suggestions}"
SelectedItem="{Binding Settings.SelectedSuggestion}"
IsEnabled="{Binding ElementName=EnableSuggestion, Path=IsChecked}" />
<!-- Not sure why binding IsEnabled directly to Settings.EnableWebSaerchSuggestion is not working -->
</StackPanel>
<StackPanel Grid.Row="1" HorizontalAlignment="Left" Orientation="Horizontal">
<StackPanel Grid.Row="0" HorizontalAlignment="Left" Orientation="Horizontal" Margin="14 0 0 0">
<Label Content="{DynamicResource flowlauncher_plugin_websearch_open_search_in}" Margin="0 15 20 0"/>
<RadioButton Name="NewWindowBrowser" GroupName="OpenSearchBehaviour" Content="{DynamicResource flowlauncher_plugin_websearch_new_window}" Click="OnNewBrowserWindowClick"
Margin="0 0 20 0"/>
<RadioButton Name="NewTabInBrowser" GroupName="OpenSearchBehaviour" Content="{DynamicResource flowlauncher_plugin_websearch_new_tab}" Click="OnNewTabClick" />
</StackPanel>
<StackPanel Grid.Row="2" HorizontalAlignment="Left" Margin="0 3 0 0">
<Label Content="{DynamicResource flowlaucnher_plugin_websearch_set_browser_path}" Margin="0 0 350 0" HorizontalAlignment="Left" Width="140"/>
<TextBox x:Name="browserPathBox" HorizontalAlignment="Left" Margin="160,-22,0,0" TextChanged="OnBrowserPathTextChanged"
Width="214" Style="{StaticResource BrowserPathBoxStyle}"/>
<Button x:Name="viewButton" HorizontalAlignment="Left" Margin="400,-30,0,0"
<StackPanel Grid.Row="1" HorizontalAlignment="Left" Margin="14 3 0 0" Orientation="Horizontal">
<Label Content="{DynamicResource flowlaucnher_plugin_websearch_set_browser_path}" Margin="0 0 10 0" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<TextBox x:Name="browserPathBox" HorizontalAlignment="Left" Margin="0,0,0,0" TextChanged="OnBrowserPathTextChanged"
Width="250" Style="{StaticResource BrowserPathBoxStyle}"/>
<Button x:Name="viewButton" HorizontalAlignment="Left" Margin="10,0,0,0"
Click="OnChooseClick" FontSize="13" Content="{DynamicResource flowlauncher_plugin_websearch_choose}" Width="80"/>
</StackPanel>
<ListView ItemsSource="{Binding Settings.SearchSources}"
<ListView Margin="0 18 0 0" ItemsSource="{Binding Settings.SearchSources}"
SelectedItem="{Binding Settings.SelectedSearchSource}"
x:Name="SearchSourcesListView"
Grid.Row="3"
Grid.Row="2"
Style="{StaticResource {x:Static GridView.GridViewStyleKey}}"
BorderBrush="DarkGray"
BorderThickness="1"
@ -95,7 +85,7 @@
</GridViewColumn>
<GridViewColumn Header="{DynamicResource flowlauncher_plugin_websearch_url}"
DisplayMemberBinding="{Binding Url}"
Width="auto">
Width="Auto">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Url}"/>
@ -105,13 +95,28 @@
</GridView>
</ListView.View>
</ListView>
<StackPanel Grid.Row="4" HorizontalAlignment="Right" Orientation="Horizontal">
<StackPanel Grid.Row="3" HorizontalAlignment="Right" Orientation="Horizontal">
<Button Click="OnDeleteSearchSearchClick" Width="100" Margin="10"
Content="{DynamicResource flowlauncher_plugin_websearch_delete}" />
<Button Click="OnEditSearchSourceClick" Width="100" Margin="10"
Content="{DynamicResource flowlauncher_plugin_websearch_edit}" />
<Button Click="OnAddSearchSearchClick" Width="100" Margin="10 10 10 10"
<Button Click="OnAddSearchSearchClick" Width="100" Margin="10 10 0 10"
Content="{DynamicResource flowlauncher_plugin_websearch_add}" />
</StackPanel>
<Border BorderThickness="0 1 0 0" Grid.Row="4" Margin="0 0 0 0" BorderBrush="#cecece" HorizontalAlignment="Stretch">
<DockPanel HorizontalAlignment="Right" Margin="0 14 0 0">
<StackPanel Orientation="Horizontal" DockPanel.Dock="Right">
<Label Content="{DynamicResource flowlauncher_plugin_websearch_enable_suggestion_provider}" Margin="14 0 10 0" HorizontalAlignment="Right" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding Settings.Suggestions}" VerticalAlignment="Center"
SelectedItem="{Binding Settings.SelectedSuggestion}"
IsEnabled="{Binding ElementName=EnableSuggestion, Path=IsChecked}" Margin="0 0 20 0" FontSize="11" Height="30"/>
<Label Content="{DynamicResource flowlauncher_plugin_websearch_enable_suggestion}" Margin="0 0 10 0" HorizontalAlignment="Right" VerticalAlignment="Center"/>
<CheckBox IsChecked="{Binding Settings.EnableSuggestion}"
Margin="0 0 0 0"
Name="EnableSuggestion"/>
</StackPanel>
<!-- Not sure why binding IsEnabled directly to Settings.EnableWebSaerchSuggestion is not working -->
</DockPanel>
</Border>
</Grid>
</UserControl>