mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
fix bookmark plugin browser edit button logic
This commit is contained in:
parent
7b70386936
commit
db3099ed0e
2 changed files with 13 additions and 7 deletions
|
|
@ -31,8 +31,8 @@
|
|||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding DataDirectoryPath}"
|
||||
HorizontalAlignment="Left" VerticalAlignment="Center" Width="200" Height="30" Margin="50 0 0 0"/>
|
||||
<StackPanel HorizontalAlignment="Center" Grid.Row="2" Orientation="Horizontal" Grid.Column="1" Height="70">
|
||||
<Button Content="Confirm" Margin="15" Click="ConfirmEditCustomBrowser"/>
|
||||
<Button Content="Cancel" Margin="15"/>
|
||||
<Button Name="btnConfirm" Content="Confirm" Margin="15" Click="ConfirmCancelEditCustomBrowser"/>
|
||||
<Button Content="Cancel" Margin="15" Click="ConfirmCancelEditCustomBrowser"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -31,20 +31,26 @@ namespace Flow.Launcher.Plugin.BrowserBookmark.Views
|
|||
};
|
||||
}
|
||||
|
||||
private void ConfirmEditCustomBrowser(object sender, RoutedEventArgs e)
|
||||
private void ConfirmCancelEditCustomBrowser(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is CustomBrowser editedBrowser)
|
||||
if (DataContext is CustomBrowser editBrowser && e.Source is Button button)
|
||||
{
|
||||
currentCustomBrowser.Name = editedBrowser.Name;
|
||||
currentCustomBrowser.DataDirectoryPath = editedBrowser.DataDirectoryPath;
|
||||
if (button.Name == "btnConfirm")
|
||||
{
|
||||
currentCustomBrowser.Name = editBrowser.Name;
|
||||
currentCustomBrowser.DataDirectoryPath = editBrowser.DataDirectoryPath;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
Close();
|
||||
}
|
||||
|
||||
private void WindowKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Enter)
|
||||
{
|
||||
ConfirmEditCustomBrowser(sender, e);
|
||||
ConfirmCancelEditCustomBrowser(sender, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue