summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Views
diff options
context:
space:
mode:
authorsr55 <[email protected]>2020-05-09 17:19:44 +0100
committersr55 <[email protected]>2020-05-09 17:19:58 +0100
commit41a900a3fff4c02a3d39ddcb5bf6639fe6461a5c (patch)
tree10edfbe1c089cc57835b44098e5762b77a04f349 /win/CS/HandBrakeWPF/Views
parentcacd4c9a1eabf196bc50c07106112ad76229830c (diff)
WinGui: Add option to reset settings to defaults in preferences (top right, link button) #2827
Diffstat (limited to 'win/CS/HandBrakeWPF/Views')
-rw-r--r--win/CS/HandBrakeWPF/Views/OptionsView.xaml52
-rw-r--r--win/CS/HandBrakeWPF/Views/OptionsView.xaml.cs8
2 files changed, 44 insertions, 16 deletions
diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
index baaadb5e5..1135c6311 100644
--- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml
+++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
@@ -66,30 +66,50 @@
</Grid.RowDefinitions>
<!-- Row 1 -->
- <StackPanel Grid.Row="0" Grid.ColumnSpan="2" Orientation="Vertical">
- <TextBlock Text="{x:Static Properties:Resources.Preferences}" FontSize="26" FontFamily="Segoe UI Light" FontWeight="Bold" Margin="10,10,10,10" Grid.Row="0" Grid.ColumnSpan="2" />
- </StackPanel>
+ <Grid Grid.Row="0" Grid.ColumnSpan="2">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+
+ <TextBlock Text="{x:Static Properties:Resources.Preferences}" FontSize="26" FontFamily="Segoe UI Light" FontWeight="Bold" Margin="10,10,10,10" Grid.Row="0" />
- <Border BorderBrush="DarkGray" Grid.Column="0" Grid.Row="1" BorderThickness="0,0,1,0">
- <StackPanel Orientation="Vertical" Margin="11,0,-1,0">
+ <TextBlock Margin="11,10,10,10" Grid.Column="1" VerticalAlignment="Bottom" HorizontalAlignment="Right">
+ <Hyperlink x:Name="ResetHandBrake" NavigateUri="/" RequestNavigate="ResetHandBrake_OnRequestNavigate" >
+ <TextBlock Text="{x:Static Properties:Resources.OptionsViewModel_ResetHandBrake}" />
+ </Hyperlink>
+ </TextBlock>
+ </Grid>
+ <Border BorderBrush="DarkGray" Grid.Column="0" Grid.Row="1" BorderThickness="0,0,1,0">
- <Button Content="{x:Static Properties:Resources.OptionsView_BackButton}" IsDefault="True" cal:Message.Attach="[Event Click] = [Action Close]"
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="*"/>
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+ <StackPanel Orientation="Vertical" Margin="11,0,-1,0">
+
+ <Button Content="{x:Static Properties:Resources.OptionsView_BackButton}" IsDefault="True" cal:Message.Attach="[Event Click] = [Action Close]"
HorizontalAlignment="Left" Padding="12,2" Margin="0,0,0,10" FontWeight="Bold" />
- <ListBox ItemsSource="{Binding Source={StaticResource OptionTabsList}, Converter={StaticResource optionTabConverter}}" SelectedItem="{Binding SelectedTab}"
- BorderThickness="0" Background="Transparent">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Converter={StaticResource tabNameConverter}}"/>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
+ <ListBox ItemsSource="{Binding Source={StaticResource OptionTabsList}, Converter={StaticResource optionTabConverter}}" SelectedItem="{Binding SelectedTab}"
+ BorderThickness="0" Background="Transparent">
+ <ListBox.ItemTemplate>
+ <DataTemplate>
+ <TextBlock Text="{Binding Converter={StaticResource tabNameConverter}}"/>
+ </DataTemplate>
+ </ListBox.ItemTemplate>
+ </ListBox>
- </StackPanel>
- </Border>
+ </StackPanel>
+
+ </Grid>
+ </Border>
+
<ScrollViewer Grid.Column="1" Grid.Row="1">
<StackPanel Orientation="Vertical">
diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml.cs b/win/CS/HandBrakeWPF/Views/OptionsView.xaml.cs
index 31fad983d..5ff7b8ae8 100644
--- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml.cs
@@ -12,6 +12,9 @@ namespace HandBrakeWPF.Views
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
+ using System.Windows.Navigation;
+
+ using HandBrakeWPF.ViewModels;
/// <summary>
/// Interaction logic for OptionsView.xaml
@@ -30,5 +33,10 @@ namespace HandBrakeWPF.Views
{
this.versionTextBox.SelectAll();
}
+
+ private void ResetHandBrake_OnRequestNavigate(object sender, RequestNavigateEventArgs e)
+ {
+ ((OptionsViewModel)this.DataContext).ResetHandBrake();
+ }
}
}