mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
Add user selection option for browserbookmark plugin
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<UserControl x:Class="Wox.Plugin.BrowserBookmark.Views.SettingsControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
Background="White"
|
||||
d:DesignHeight="300" d:DesignWidth="500">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="40" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="0">
|
||||
<Label Content="Open bookmark in:" Margin="40 3 0 8"/>
|
||||
<RadioButton Name="NewWindowBrowser" GroupName="OpenSearchBehaviour" Content="New window" Click="OnNewBrowserWindowClick" Margin="10" />
|
||||
<RadioButton Name="NewTabInBrowser" GroupName="OpenSearchBehaviour" Content="New tab" Click="OnNewTabClick" Margin="10" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using Wox.Plugin.BrowserBookmark.Models;
|
||||
|
||||
namespace Wox.Plugin.BrowserBookmark.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for BrowserBookmark.xaml
|
||||
/// </summary>
|
||||
public partial class SettingsControl : UserControl
|
||||
{
|
||||
private readonly Settings _settings;
|
||||
|
||||
public SettingsControl(Settings settings)
|
||||
{
|
||||
InitializeComponent();
|
||||
_settings = settings;
|
||||
NewWindowBrowser.IsChecked = _settings.OpenInNewBrowserWindow;
|
||||
NewTabInBrowser.IsChecked = !_settings.OpenInNewBrowserWindow;
|
||||
}
|
||||
|
||||
private void OnNewBrowserWindowClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_settings.OpenInNewBrowserWindow = true;
|
||||
}
|
||||
|
||||
private void OnNewTabClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_settings.OpenInNewBrowserWindow = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user