summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Controls
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-04-18 14:08:09 +0000
committersr55 <[email protected]>2015-04-18 14:08:09 +0000
commitd26d290873503259f71d7c09d3fb3377cc2c9ae8 (patch)
treea752dde3e04f2ad55555e1e5f6c9bf628a649fa8 /win/CS/HandBrakeWPF/Controls
parent18ec5828ba1d6fcea88b6109d114efd8dac53206 (diff)
WinGui: Misc UI fixes and fixes to the logging code for scanning that could sometimes cause a crash.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7094 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Controls')
-rw-r--r--win/CS/HandBrakeWPF/Controls/SourceSelection.xaml6
-rw-r--r--win/CS/HandBrakeWPF/Controls/StatusPanel.xaml68
-rw-r--r--win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs78
3 files changed, 129 insertions, 23 deletions
diff --git a/win/CS/HandBrakeWPF/Controls/SourceSelection.xaml b/win/CS/HandBrakeWPF/Controls/SourceSelection.xaml
index dd7650b31..44d600c4e 100644
--- a/win/CS/HandBrakeWPF/Controls/SourceSelection.xaml
+++ b/win/CS/HandBrakeWPF/Controls/SourceSelection.xaml
@@ -15,11 +15,11 @@
<StackPanel Orientation="Horizontal" Grid.Row="0" Margin="5,8,0,0">
- <TextBlock Text="Source Selection" FontSize="14" FontWeight="Bold" />
+ <TextBlock Text="Source Selection" FontSize="26" FontFamily="Segoe UI Light" />
</StackPanel>
<!-- Title Specific Scan -->
- <StackPanel Grid.Row="1" Orientation="Vertical" HorizontalAlignment="Left" Margin="5,5,0,0">
+ <StackPanel Grid.Row="1" Orientation="Vertical" HorizontalAlignment="Left" Margin="5,15,0,0">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Optionally choose a specific title: " />
@@ -86,7 +86,7 @@
</Grid>
<!-- Cancel Window -->
- <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,10,10">
+ <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,2,10">
<Button cal:Message.Attach="[Event Click] = [Action CloseSourceSelection]" Content="Cancel" Padding="8,2" />
</StackPanel>
diff --git a/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml b/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml
index 481c2eedb..4c4fbe20d 100644
--- a/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml
+++ b/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml
@@ -1,28 +1,60 @@
-<UserControl x:Class="HandBrakeWPF.Controls.StatusPanel"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:ctr="clr-namespace:HandBrakeWPF.Controls">
+ xmlns:ctr="clr-namespace:HandBrakeWPF.Controls"
+ x:Class="HandBrakeWPF.Controls.StatusPanel"
+ FontFamily="S"
+ >
<UserControl.Resources>
<BooleanToVisibilityConverter x:Key="boolTovisibility" />
</UserControl.Resources>
+
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="*" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
- <DockPanel Background="Black" Opacity="0.85"
- Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}},
- Path=IsLoading, Mode=OneWay, Converter={StaticResource boolTovisibility}}">
+ <StackPanel Grid.Row="0" Background="Black" Opacity="0.45" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
- <ctr:Loading DockPanel.Dock="Left" HorizontalAlignment="Left" VerticalAlignment="Top"
- Height="45" Margin="18,10" />
+ <Grid VerticalAlignment="Center" Grid.Row="1" HorizontalAlignment="Stretch"
+ Background="{Binding Background, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}">
+
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="0" MaxHeight="220" MinHeight="220">
+ <ctr:Loading HorizontalAlignment="Center" VerticalAlignment="Center" Height="45" Margin="18,10" />
+
+ <StackPanel VerticalAlignment="Center" Orientation="Vertical" >
+ <StackPanel VerticalAlignment="Center" MinWidth="300">
+ <TextBlock SnapsToDevicePixels="True" VerticalAlignment="Top" FontSize="26" FontFamily="Segoe UI Light" Margin="0,11,0,0" HorizontalAlignment="Left"
+ FontWeight="Bold" TextWrapping="WrapWithOverflow"
+ Text="{Binding Message, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
+ />
+
+ <TextBlock SnapsToDevicePixels="True" VerticalAlignment="Top" FontSize="16" FontFamily="Segoe UI Light" Margin="0,5" HorizontalAlignment="Left"
+ Text="{Binding SubMessage, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
+ TextWrapping="WrapWithOverflow"
+ />
+ </StackPanel>
+
+ <Button Content="{Binding ActionText, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" Margin="0,10,0,0"
+ x:Name="StatusActionButton" Click="StatusActionButton_OnClick" Padding="8,2" HorizontalAlignment="Right"
+ Visibility="{Binding IsActionButtonVisible, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Converter={StaticResource boolTovisibility}}" />
+
+ </StackPanel>
+ </StackPanel>
+
+
+ </Grid>
+
+ <StackPanel Grid.Row="2" Background="Black" Opacity="0.45" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
+
+ </Grid>
- <StackPanel VerticalAlignment="Top">
- <TextBlock SnapsToDevicePixels="True" VerticalAlignment="Top" FontSize="16" Margin="0,11,0,0" HorizontalAlignment="Left"
- FontWeight="Bold"
- Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=Message}"
- Foreground="LightBlue" />
- <TextBlock SnapsToDevicePixels="True" VerticalAlignment="Top" FontSize="12" Margin="0,5" HorizontalAlignment="Left"
- Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=SubMessage}"
- Foreground="LightBlue" />
- </StackPanel>
- </DockPanel>
</UserControl>
diff --git a/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs b/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs
index 92ca002d5..404e2981b 100644
--- a/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs
+++ b/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs
@@ -9,6 +9,7 @@
namespace HandBrakeWPF.Controls
{
+ using System;
using System.Windows;
using System.Windows.Controls;
@@ -23,6 +24,7 @@ namespace HandBrakeWPF.Controls
public StatusPanel()
{
InitializeComponent();
+ this.Message = "Message";
}
/// <summary>
@@ -35,13 +37,25 @@ namespace HandBrakeWPF.Controls
/// Dependancy Property for the Message Property
/// </summary>
public static readonly DependencyProperty MessageProperty =
- DependencyProperty.Register("Message", typeof(string), typeof(StatusPanel), new UIPropertyMetadata(string.Empty));
+ DependencyProperty.Register("Message", typeof(string), typeof(StatusPanel), new UIPropertyMetadata("Loading..."));
/// <summary>
/// Dependancy Property for the submessage propery
/// </summary>
public static readonly DependencyProperty SubMessageProperty =
- DependencyProperty.Register("SubMessage", typeof(string), typeof(StatusPanel), new UIPropertyMetadata(string.Empty));
+ DependencyProperty.Register("SubMessage", typeof(string), typeof(StatusPanel), new FrameworkPropertyMetadata("Please Wait", FrameworkPropertyMetadataOptions.AffectsRender));
+
+ /// <summary>
+ /// Dependancy Property for the submessage propery
+ /// </summary>
+ public static readonly DependencyProperty ActionProperty =
+ DependencyProperty.Register("CancelAction", typeof(Action), typeof(StatusPanel), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.None, OnCancelActionSet));
+
+ /// <summary>
+ /// Dependancy Property for the submessage propery
+ /// </summary>
+ public static readonly DependencyProperty ActionTextProperty =
+ DependencyProperty.Register("ActionText", typeof(string), typeof(StatusPanel), new UIPropertyMetadata("Cancel"));
/// <summary>
/// Gets or sets a value indicating whether IsLoading.
@@ -69,5 +83,65 @@ namespace HandBrakeWPF.Controls
get { return (string)GetValue(SubMessageProperty); }
set { SetValue(SubMessageProperty, value); }
}
+
+ /// <summary>
+ /// Gets or sets the cancel action.
+ /// </summary>
+ public Action CancelAction
+ {
+ get { return (Action)GetValue(ActionProperty); }
+ set { SetValue(SubMessageProperty, value); }
+ }
+
+ /// <summary>
+ /// The on cancel action set.
+ /// </summary>
+ /// <param name="d">
+ /// The d.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ private static void OnCancelActionSet(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+
+ }
+
+ /// <summary>
+ /// Gets or sets the action text.
+ /// </summary>
+ public string ActionText
+ {
+ get { return (string)GetValue(ActionTextProperty); }
+ set { SetValue(ActionTextProperty, value); }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether is action button visible.
+ /// </summary>
+ public bool IsActionButtonVisible
+ {
+ get
+ {
+ return true; // this.CancelAction != null;
+ }
+ }
+
+ /// <summary>
+ /// The status action button_ on click.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ private void StatusActionButton_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (this.CancelAction != null)
+ {
+ this.CancelAction();
+ }
+ }
}
}