diff options
author | sr55 <[email protected]> | 2013-06-29 15:36:48 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-06-29 15:36:48 +0000 |
commit | 75e97b7e676869c9ea83200b2f882ba4e0435f23 (patch) | |
tree | d164b9e581cf1bb85b4d15a8b68eb6f3dcb49ab3 /win/CS/HandBrakeWPF/Views | |
parent | acd0b75397ae0dfc18d1fd31c4031e87c22a6134 (diff) |
WinGui: Just some prototype code for safe keeping. Some ideas around an Instant HandBrake window.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5617 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Views')
-rw-r--r-- | win/CS/HandBrakeWPF/Views/InstantMainView.xaml | 182 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/InstantMainView.xaml.cs | 15 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/MainView.xaml | 1 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/ShellView.xaml | 5 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/ShellView.xaml.cs | 8 |
5 files changed, 211 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Views/InstantMainView.xaml b/win/CS/HandBrakeWPF/Views/InstantMainView.xaml new file mode 100644 index 000000000..29d8f1b4e --- /dev/null +++ b/win/CS/HandBrakeWPF/Views/InstantMainView.xaml @@ -0,0 +1,182 @@ +<UserControl x:Class="HandBrakeWPF.Views.InstantMainView"
+ 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"
+ xmlns:cal="http://www.caliburnproject.org"
+ xmlns:controls="clr-namespace:HandBrakeWPF.Controls"
+ xmlns:converters="clr-namespace:HandBrakeWPF.Converters"
+ xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
+ mc:Ignorable="d"
+ cal:Message.Attach="[Event Loaded] = [Action Load]"
+ >
+
+ <i:Interaction.Triggers>
+ <i:EventTrigger EventName="Drop">
+ <cal:ActionMessage MethodName="FilesDroppedOnWindow">
+ <cal:Parameter Value="$eventArgs" />
+ </cal:ActionMessage>
+ </i:EventTrigger>
+ </i:Interaction.Triggers>
+
+ <UserControl.Resources>
+ <converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
+ </UserControl.Resources>
+
+ <!-- Window Body -->
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+
+ <!-- Source -->
+ <StackPanel Orientation="Vertical" Grid.Row="0">
+ <!-- Source -->
+ <StackPanel Margin="10,5,5,5"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Stretch"
+ >
+ <StackPanel Orientation="Horizontal">
+ <Label Content="Source" FontWeight="Bold" />
+ <Label Content="{Binding Path=SourceLabel}" />
+ </StackPanel>
+
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="8,10,0,10">
+
+ <TextBlock Text="Drag and Drop a file - OR - Open a " />
+ <Button cal:Message.Attach="[Event Click] = [Action FileScan]" Padding="8,2">
+ File
+ </Button>
+ <TextBlock Text="- OR -" FontWeight="Bold" Margin="10,0,10,0" />
+ <Button cal:Message.Attach="[Event Click] = [Action FolderScan]" Padding="8,2">
+ Folder
+ </Button>
+
+ </StackPanel>
+
+
+ <StackPanel Orientation="Horizontal">
+ <Label Margin="8,0,0,0" Content="Title" />
+ <ComboBox Name="Titles"
+ MinWidth="100"
+ Margin="8,0,0,0"
+ ItemsSource="{Binding ScannedSource.Titles}"
+ SelectedItem="{Binding Path=SelectedTitle}"
+ />
+ <!--<Label Margin="8,0,0,0" Content="Angle" />
+ <ComboBox Name="Angles"
+ MinWidth="60"
+ Margin="8,0,0,0"
+ ItemsSource="{Binding Angles}"
+ SelectedItem="{Binding SelectedAngle}"/>-->
+
+ <Label Margin="8,0,0,0" Content="Chapters" />
+ <ComboBox Name="StartPoint"
+ MinWidth="60"
+ Margin="8,0,0,0"
+ ItemsSource="{Binding StartEndRangeItems}"
+ SelectedItem="{Binding SelectedStartPoint}"/>
+
+ <Label Margin="8,0,0,0" Content="through" />
+ <ComboBox Name="EndPoint"
+ MinWidth="60"
+ Margin="8,0,0,0"
+ ItemsSource="{Binding StartEndRangeItems}"
+ SelectedItem="{Binding SelectedEndPoint}"/>
+
+ <Label Margin="8,0,0,0" Content="Duration" />
+ <Label Margin="8,0,0,0" Content="{Binding Duration}" />
+ </StackPanel>
+ </StackPanel>
+ </StackPanel>
+
+
+ <!-- Destination -->
+ <StackPanel Grid.Row="1"
+ Margin="10,5,5,5"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Stretch"
+ >
+ <Label Content="Destination" FontWeight="Bold" />
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+ <Label Margin="8,0,0,0" Content="File" />
+ <TextBox Name="Destination"
+ Grid.Column="1"
+ Margin="8,0,0,0"
+ Text="{Binding Destination,
+ UpdateSourceTrigger=PropertyChanged}"
+ />
+ <Button Name="DestinationBrowser"
+ Grid.Column="2"
+ Margin="8,0,5,0"
+ Padding="8,2"
+ Content="Browse"
+ cal:Message.Attach="[Event Click] = [Action BrowseDestination]"
+ />
+ </Grid>
+ </StackPanel>
+
+ <!-- Opitons -->
+ <StackPanel Grid.Row="2"
+ Margin="10,5,5,5"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Stretch"
+ >
+ <Label Content="Options" FontWeight="Bold" />
+
+ <StackPanel Orientation="Horizontal" Margin="8,0,0,0">
+ <TextBlock Text="Preset:" Margin="0,0,5,0" />
+ <ComboBox ItemsSource="{Binding Presets}" SelectedItem="{Binding SelectedPreset}" MinWidth="150" />
+ </StackPanel>
+
+ </StackPanel>
+
+
+ <!-- Buttons and Queueing -->
+ <Grid Grid.Row="3" Margin="10,5,5,5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+ <Label Content="Start" FontWeight="Bold" Grid.Row="0" />
+ <Button Content="Start Encoding" cal:Message.Attach="[Event Click] = [Action StartEncode]" FontWeight="Bold" Grid.Row="1" Padding="8,2" HorizontalAlignment="Center"
+ Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
+ <Button Content="Stop Encoding" cal:Message.Attach="[Event Click] = [Action StopEncode]" FontWeight="Bold" Grid.Row="1" Padding="8,2" HorizontalAlignment="Center"
+ Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
+ </Grid>
+
+
+ <!-- StatusPanel -->
+ <controls:StatusPanel x:Name="loadingPanel"
+ Grid.Row="3"
+ Grid.RowSpan="2"
+ Height="70"
+ VerticalAlignment="Bottom"
+ Panel.ZIndex="10"
+ IsLoading="{Binding ShowStatusWindow}"
+ Message="{Binding StatusLabel}"
+ SubMessage="Please Wait ..."
+ />
+
+ <!-- Status Bar -->
+ <StatusBar Grid.Row="4" Grid.ColumnSpan="2" MinHeight="32" >
+
+ <ProgressBar Value="{Binding ProgressPercentage}" Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}}"
+ Width="100" Height="18" VerticalAlignment="Center"/>
+ <Label VerticalAlignment="Center"
+ Content="{Binding Path=ProgramStatusLabel}" />
+
+ </StatusBar>
+
+ </Grid>
+</UserControl>
diff --git a/win/CS/HandBrakeWPF/Views/InstantMainView.xaml.cs b/win/CS/HandBrakeWPF/Views/InstantMainView.xaml.cs new file mode 100644 index 000000000..4a74deba4 --- /dev/null +++ b/win/CS/HandBrakeWPF/Views/InstantMainView.xaml.cs @@ -0,0 +1,15 @@ +namespace HandBrakeWPF.Views
+{
+ using System.Windows.Controls;
+
+ /// <summary>
+ /// Interaction logic for InstantMainView.xaml
+ /// </summary>
+ public partial class InstantMainView : UserControl
+ {
+ public InstantMainView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index 67ac70c21..38545de00 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -527,6 +527,7 @@ Margin="10,10,5,5"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
+ MinHeight="350" MinWidth="720"
>
<TabItem Name="pictureTab" Header="Picture">
<ContentControl x:Name="PictureSettingsViewModel" />
diff --git a/win/CS/HandBrakeWPF/Views/ShellView.xaml b/win/CS/HandBrakeWPF/Views/ShellView.xaml index ae8d26747..43edcb36b 100644 --- a/win/CS/HandBrakeWPF/Views/ShellView.xaml +++ b/win/CS/HandBrakeWPF/Views/ShellView.xaml @@ -3,6 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Data="clr-namespace:System.Windows.Data;assembly=PresentationFramework"
xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"
+ xmlns:views="clr-namespace:HandBrakeWPF.Views"
Title="{Data:Binding Path=WindowTitle}"
Width="1015"
Height="670"
@@ -14,6 +15,7 @@ WindowStartupLocation="CenterScreen"
TextOptions.TextFormattingMode="Display"
Style="{StaticResource mainWindowStyle}"
+ x:Name="shellView"
>
<Window.Resources>
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
@@ -22,5 +24,8 @@ <Grid>
<ContentControl x:Name="MainViewModel" Visibility="{Binding ShowMainWindow, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
<ContentControl x:Name="OptionsViewModel" Visibility="{Binding ShowOptions, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
+
+ <views:InstantMainView DataContext="{Binding MainViewModel}"
+ Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.ShowInstant, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
</Grid>
</Window>
diff --git a/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs b/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs index b1eff7ddd..067446f12 100644 --- a/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs +++ b/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs @@ -82,6 +82,14 @@ namespace HandBrakeWPF.Views {
this.TaskbarItemInfo = Win7.WindowsTaskbar;
}
+
+ // Window Sizing
+ if (AppArguments.IsInstantHandBrake)
+ {
+ this.SizeToContent = SizeToContent.WidthAndHeight;
+ this.MinHeight = 380;
+ this.MinWidth = 600;
+ }
}
/// <summary>
|