fix new tab not save issue

This commit is contained in:
Kevin Zhang 2021-12-08 10:38:37 -06:00
parent af2277de61
commit 05fd41a104
3 changed files with 10 additions and 9 deletions

View file

@ -18,6 +18,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
{ {
Name = Name, Name = Name,
Path = Path, Path = Path,
OpenInTab = OpenInTab,
PrivateArg = PrivateArg, PrivateArg = PrivateArg,
EnablePrivate = EnablePrivate, EnablePrivate = EnablePrivate,
Editable = Editable Editable = Editable

View file

@ -107,7 +107,7 @@
Margin="10,0,0,0" Margin="10,0,0,0"
Click="btnDelete_Click" Click="btnDelete_Click"
Content="{DynamicResource delete}" Content="{DynamicResource delete}"
IsEnabled="{Binding CustomExplorer.Editable}" /> IsEnabled="{Binding CustomBrowser.Editable}" />
</StackPanel> </StackPanel>
<Rectangle <Rectangle
@ -117,7 +117,7 @@
<StackPanel <StackPanel
Margin="0,0,0,0" Margin="0,0,0,0"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
DataContext="{Binding CustomExplorer}" DataContext="{Binding CustomBrowser}"
Orientation="Horizontal"> Orientation="Horizontal">
<Grid Width="480"> <Grid Width="480">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@ -197,7 +197,7 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Orientation="Horizontal"> Orientation="Horizontal">
<RadioButton GroupName="browser" IsChecked="{Binding OpenInTab}">New Tab</RadioButton> <RadioButton GroupName="browser" IsChecked="{Binding OpenInTab}">New Tab</RadioButton>
<RadioButton GroupName="browser" IsChecked="{Binding OpenInNewWindow, Mode=OneWay}">New Window</RadioButton> <RadioButton GroupName="browser" IsChecked="{Binding OpenInNewWindow, Mode=OneTime}">New Window</RadioButton>
</StackPanel> </StackPanel>
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"

View file

@ -20,7 +20,7 @@ namespace Flow.Launcher
{ {
public partial class SelectBrowserWindow : Window, INotifyPropertyChanged public partial class SelectBrowserWindow : Window, INotifyPropertyChanged
{ {
private int selectedCustomExplorerIndex; private int selectedCustomBrowserIndex;
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged;
@ -28,15 +28,15 @@ namespace Flow.Launcher
public int SelectedCustomBrowserIndex public int SelectedCustomBrowserIndex
{ {
get => selectedCustomExplorerIndex; set get => selectedCustomBrowserIndex; set
{ {
selectedCustomExplorerIndex = value; selectedCustomBrowserIndex = value;
PropertyChanged?.Invoke(this, new(nameof(CustomExplorer))); PropertyChanged?.Invoke(this, new(nameof(CustomBrowser)));
} }
} }
public ObservableCollection<CustomBrowserViewModel> CustomBrowsers { get; set; } public ObservableCollection<CustomBrowserViewModel> CustomBrowsers { get; set; }
public CustomBrowserViewModel CustomExplorer => CustomBrowsers[SelectedCustomBrowserIndex]; public CustomBrowserViewModel CustomBrowser => CustomBrowsers[SelectedCustomBrowserIndex];
public SelectBrowserWindow(Settings settings) public SelectBrowserWindow(Settings settings)
{ {
Settings = settings; Settings = settings;
@ -54,7 +54,7 @@ namespace Flow.Launcher
{ {
Settings.CustomBrowserList = CustomBrowsers.ToList(); Settings.CustomBrowserList = CustomBrowsers.ToList();
Settings.CustomBrowserIndex = SelectedCustomBrowserIndex; Settings.CustomBrowserIndex = SelectedCustomBrowserIndex;
Close(); Cl ose();
} }
private void btnAdd_Click(object sender, RoutedEventArgs e) private void btnAdd_Click(object sender, RoutedEventArgs e)