Update layout for Url plugin setting + remove apply button

This commit is contained in:
Jeremy Wu 2019-11-12 07:14:58 +11:00
parent 205b505242
commit cd953bc7b9
5 changed files with 12 additions and 27 deletions

View file

@ -10,6 +10,5 @@
<system:String x:Key="wox_plugin_url_plugin_set_tip">Please set your browser path:</system:String> <system:String x:Key="wox_plugin_url_plugin_set_tip">Please set your browser path:</system:String>
<system:String x:Key="wox_plugin_url_plugin_choose">Choose</system:String> <system:String x:Key="wox_plugin_url_plugin_choose">Choose</system:String>
<system:String x:Key="wox_plugin_url_plugin_apply">Apply</system:String>
<system:String x:Key="wox_plugin_url_plugin_filter">Application(*.exe)|*.exe|All files|*.*</system:String> <system:String x:Key="wox_plugin_url_plugin_filter">Application(*.exe)|*.exe|All files|*.*</system:String>
</ResourceDictionary> </ResourceDictionary>

View file

@ -10,6 +10,5 @@
<system:String x:Key="wox_plugin_url_plugin_set_tip">Tarayıcınızın konumunu ayarlayın:</system:String> <system:String x:Key="wox_plugin_url_plugin_set_tip">Tarayıcınızın konumunu ayarlayın:</system:String>
<system:String x:Key="wox_plugin_url_plugin_choose">Seç</system:String> <system:String x:Key="wox_plugin_url_plugin_choose">Seç</system:String>
<system:String x:Key="wox_plugin_url_plugin_apply">Uygula</system:String>
<system:String x:Key="wox_plugin_url_plugin_filter">Programlar (*.exe)|*.exe|Tüm Dosyalar|*.*</system:String> <system:String x:Key="wox_plugin_url_plugin_filter">Programlar (*.exe)|*.exe|Tüm Dosyalar|*.*</system:String>
</ResourceDictionary> </ResourceDictionary>

View file

@ -10,6 +10,5 @@
<system:String x:Key="wox_plugin_url_plugin_set_tip">请设置你的浏览器路径:</system:String> <system:String x:Key="wox_plugin_url_plugin_set_tip">请设置你的浏览器路径:</system:String>
<system:String x:Key="wox_plugin_url_plugin_choose">选择</system:String> <system:String x:Key="wox_plugin_url_plugin_choose">选择</system:String>
<system:String x:Key="wox_plugin_url_plugin_apply">应用</system:String>
<system:String x:Key="wox_plugin_url_plugin_filter">程序文件(*.exe)|*.exe|所有文件|*.*</system:String> <system:String x:Key="wox_plugin_url_plugin_filter">程序文件(*.exe)|*.exe|所有文件|*.*</system:String>
</ResourceDictionary> </ResourceDictionary>

View file

@ -3,29 +3,21 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Wox.Plugin.Url" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="500">
mc:Ignorable="d" Height="300" Width="500"> <Grid Margin="10,10,10,0">
<Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition/> <RowDefinition Height="40" />
<RowDefinition Height="0*"/> <RowDefinition />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="0*"/>
<ColumnDefinition Width="0*"/>
<ColumnDefinition Width="0*"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Grid.Row="0"> <StackPanel Orientation="Horizontal" Grid.Row="0">
<Label Content="Open search in:" Margin="40,3,0,272"/> <Label Content="Open search in:" Margin="40 3 0 8" />
<RadioButton Name="NewWindowBrowser" GroupName="OpenSearchBehaviour" Content="New window" Click="OnNewBrowserWindowClick" Margin="10,10,10,272" /> <RadioButton x:Name="NewWindowBrowser" GroupName="OpenSearchBehaviour" Content="New window" Click="OnNewBrowserWindowClick" Margin="10" />
<RadioButton Name="NewTabInBrowser" GroupName="OpenSearchBehaviour" Content="New tab" Click="OnNewTabClick" Margin="10,10,10,272" /> <RadioButton x:Name="NewTabInBrowser" GroupName="OpenSearchBehaviour" Content="New tab" Click="OnNewTabClick" Margin="10" />
</StackPanel> </StackPanel>
<StackPanel VerticalAlignment="Center"> <StackPanel VerticalAlignment="Top" Grid.Row="1" Height="106" Margin="41,13,0,0">
<Label Content="{DynamicResource wox_plugin_url_plugin_set_tip}" Height="42" Margin="0,0,155,0" HorizontalAlignment="Right" Width="310"/> <Label Content="{DynamicResource wox_plugin_url_plugin_set_tip}" Height="28" Margin="0,0,155,0" HorizontalAlignment="Left" Width="290" />
<TextBox x:Name="browserPathBox" HorizontalAlignment="Left" Height="34" Margin="35,0,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="311" RenderTransformOrigin="0.502,-1.668"/> <TextBox x:Name="browserPathBox" HorizontalAlignment="Left" Height="34" Margin="5,0,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="311" RenderTransformOrigin="0.502,-1.668" />
<Button x:Name="setButton" HorizontalAlignment="Left" Margin="272,5,0,0" Width="73" Height="25" FontSize="10" Click="OnApplyBTClick" Content="{DynamicResource wox_plugin_url_plugin_apply}" /> <Button x:Name="viewButton" HorizontalAlignment="Left" Margin="340,-33,-1,0" Width="100" Height="28" Click="OnChooseClick" FontSize="10" Content="{DynamicResource wox_plugin_url_plugin_choose}" />
<Button x:Name="viewButton" HorizontalAlignment="Left" Margin="180,-25,0,0" Width="73" Height="25" Click="OnChooseClick" FontSize="10" Content="{DynamicResource wox_plugin_url_plugin_choose}" />
</StackPanel> </StackPanel>
</Grid> </Grid>
</UserControl> </UserControl>

View file

@ -35,11 +35,6 @@ namespace Wox.Plugin.Url
NewTabInBrowser.IsChecked = !_settings.OpenInNewBrowserWindow; NewTabInBrowser.IsChecked = !_settings.OpenInNewBrowserWindow;
} }
private void OnApplyBTClick(object sender, RoutedEventArgs e)
{
_settings.BrowserPath = browserPathBox.Text;
}
private void OnChooseClick(object sender, RoutedEventArgs e) private void OnChooseClick(object sender, RoutedEventArgs e)
{ {
var fileBrowserDialog = new OpenFileDialog(); var fileBrowserDialog = new OpenFileDialog();
@ -49,6 +44,7 @@ namespace Wox.Plugin.Url
if (fileBrowserDialog.ShowDialog() == true) if (fileBrowserDialog.ShowDialog() == true)
{ {
browserPathBox.Text = fileBrowserDialog.FileName; browserPathBox.Text = fileBrowserDialog.FileName;
_settings.BrowserPath = fileBrowserDialog.FileName;
} }
} }