summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Views
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-09-08 22:14:26 +0100
committersr55 <[email protected]>2017-09-08 22:14:26 +0100
commite17f33293848a5f3a783f09377adc94ffedb0f44 (patch)
tree7e4e44df742d3f82c4ab142ee1a35073e7ac984a /win/CS/HandBrakeWPF/Views
parentb2f2e30f942a917348703e28418be97595ad5e8d (diff)
WinGui: Implementing the new Preset design that does away with the legacy style preset pane and re-arranges parts of the main window for better process flow.
Diffstat (limited to 'win/CS/HandBrakeWPF/Views')
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml428
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml.cs62
-rw-r--r--win/CS/HandBrakeWPF/Views/ShellView.xaml4
3 files changed, 145 insertions, 349 deletions
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml
index cadd5a5ee..20313547d 100644
--- a/win/CS/HandBrakeWPF/Views/MainView.xaml
+++ b/win/CS/HandBrakeWPF/Views/MainView.xaml
@@ -1,25 +1,20 @@
<UserControl x:Class="HandBrakeWPF.Views.MainView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:Controls="clr-namespace:HandBrakeWPF.Controls"
- xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"
- xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
- xmlns:commands="clr-namespace:HandBrakeWPF.Commands"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:Controls="clr-namespace:HandBrakeWPF.Controls"
+ xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"
xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"
xmlns:cal="http://www.caliburnproject.org"
xmlns:menu="clr-namespace:HandBrakeWPF.Commands.Menu"
- xmlns:loc="clr-namespace:HandBrakeWPF.Services.Presets.Model"
- xmlns:helpers="clr-namespace:HandBrakeWPF.Helpers"
AllowDrop="True"
- FontSize="11"
- cal:Message.Attach="[Event Loaded] = [Action Load]"
- SnapsToDevicePixels="True"
- UseLayoutRounding="True"
- >
+ FontSize="11"
+ cal:Message.Attach="[Event Loaded] = [Action Load]"
+ SnapsToDevicePixels="True"
+ UseLayoutRounding="True"
+>
<UserControl.Resources>
<Converters:BooleanConverter x:Key="booleanConverter" />
- <Converters:EnumComboConverter x:Key="enumComboConverter" />
<Converters:PresetsMenuConverter x:Key="presetsMenuConverter"/>
<Style TargetType="Button">
@@ -29,11 +24,6 @@
<Setter Property="MinHeight" Value="22" />
</Style>
- <Style x:Key="textBlockOrangeStyle" TargetType="TextBlock">
- <Setter Property="FontWeight" Value="Bold" />
- <Setter Property="Padding" Value="5,5" />
- </Style>
-
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
</UserControl.Resources>
@@ -50,12 +40,12 @@
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Orientation="Vertical"
- >
+ >
<!-- Main Menu -->
<Menu Height="23"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
- >
+ >
<MenuItem Header="_File">
<MenuItem Header="Choose Source" cal:Message.Attach="[Event Click] = [Action SelectSourceWindow]" InputGestureText="Alt + O" />
<Separator />
@@ -84,17 +74,13 @@
<MenuItem Header="_Presets" x:Name="presetMenu" IsEnabled="{Binding HasSource, Converter={StaticResource booleanConverter}, ConverterParameter=false}">
- <MenuItem Header="_Presets" ItemsSource="{Binding Presets, Converter={StaticResource presetsMenuConverter}}" />
+ <MenuItem Header="_Presets" ItemsSource="{Binding PresetsCategories, Converter={StaticResource presetsMenuConverter}}" />
<Separator />
<MenuItem Header="_Import from file" cal:Message.Attach="[Event Click] = [Action PresetImport]" />
<MenuItem Header="_Export to file" cal:Message.Attach="[Event Click] = [Action PresetExport]" />
<Separator />
<MenuItem Header="_Set Current as Default" cal:Message.Attach="[Event Click] = [Action PresetSetDefault]" />
<MenuItem Header="_Reset Built-In Presets" cal:Message.Attach="[Event Click] = [Action PresetReset]" />
- <Separator />
- <MenuItem IsCheckable="True" x:Name="showPresetPanelMenuItem" IsChecked="{Binding IsPresetPanelShowing}"
- Header="S_how Preset Panel">
- </MenuItem>
</MenuItem>
<MenuItem Header="_Queue" x:Name="queueMenu" Visibility="{Binding HasSource, Converter={StaticResource booleanConverter}, ConverterParameter=false}">
@@ -132,7 +118,7 @@
ToolBar.OverflowMode="Never"
ToolBarTray.IsLocked="True"
KeyboardNavigation.TabNavigation="Continue"
- >
+ >
<Button Name="SelectSource" x:Uid="Choose Source" AutomationProperties.Name="Choose Source"
cal:Message.Attach="[Event Click] = [Action SelectSourceWindow]">
@@ -140,11 +126,11 @@
<Image Width="32"
Height="32"
Source="Images/Movies.png"
- />
+ />
<Label Margin="8,0,0,0"
VerticalAlignment="Center"
Content="{x:Static Properties:ResourcesUI.MainView_SourceOpen}"
- />
+ />
</StackPanel>
</Button>
@@ -155,16 +141,16 @@
Visibility="{Binding IsEncoding,
Converter={StaticResource boolToVisConverter},
ConverterParameter=true}"
- >
+ >
<StackPanel Orientation="Horizontal">
<Image Width="32"
Height="32"
Source="Images/Play.png"
- />
+ />
<Label Margin="8,0,0,0"
VerticalAlignment="Center"
Content="{Binding StartLabel, FallbackValue='{x:Static Properties:ResourcesUI.MainView_StartEncode}'}"
- />
+ />
</StackPanel>
</Button>
@@ -173,17 +159,17 @@
Visibility="{Binding IsEncoding,
Converter={StaticResource boolToVisConverter},
ConverterParameter=false}"
- >
+ >
<StackPanel Orientation="Horizontal">
<Image Width="32"
Height="32"
SnapsToDevicePixels="True"
Source="Images/stop.png"
- />
+ />
<Label Margin="8,0,0,0"
VerticalAlignment="Center"
Content="{x:Static Properties:ResourcesUI.MainView_Stop}"
- />
+ />
</StackPanel>
</Button>
@@ -192,17 +178,17 @@
Visibility="{Binding CanPause,
Converter={StaticResource boolToVisConverter},
ConverterParameter=false}"
- >
+ >
<StackPanel Orientation="Horizontal">
<Image Width="32"
Height="32"
SnapsToDevicePixels="True"
Source="Images/Pause.png"
- />
+ />
<Label Margin="8,0,0,0"
VerticalAlignment="Center"
Content="{x:Static Properties:ResourcesUI.MainView_Pause}"
- />
+ />
</StackPanel>
</Button>
@@ -215,10 +201,10 @@
<Grid x:Name="dropdown" Background="Transparent" >
<Path Height="5" Margin="2,2,2,0" VerticalAlignment="Center" HorizontalAlignment="Center"
- Data="M 0 0 L 4 4 L 8 0 Z"
- Fill="{DynamicResource GlyphBrush}" x:Name="dropdownArrow" />
+ Data="M 0 0 L 4 4 L 8 0 Z"
+ Fill="{DynamicResource GlyphBrush}" x:Name="dropdownArrow" />
</Grid>
-
+
</StackPanel>
<Button.ContextMenu>
<ContextMenu>
@@ -236,11 +222,11 @@
Height="32"
SnapsToDevicePixels="True"
Source="Images/Queue_small.png"
- />
+ />
<Label Margin="8,0,0,0"
VerticalAlignment="Center"
Content="{Binding QueueLabel, FallbackValue='{x:Static Properties:ResourcesUI.MainView_ShowQueue}'}"
- />
+ />
</StackPanel>
</Button>
@@ -252,11 +238,11 @@
Height="32"
SnapsToDevicePixels="True"
Source="Images/picture_small.png"
- />
+ />
<Label Margin="8,0,0,0"
VerticalAlignment="Center"
Content="Preview"
- />
+ />
</StackPanel>
</Button>
@@ -265,11 +251,11 @@
<Image Width="32"
Height="32"
Source="Images/ActivityWindow.png"
- />
+ />
<Label Margin="8,0,0,0"
VerticalAlignment="Center"
Content="Activity Log"
- />
+ />
</StackPanel>
</Button>
</ToolBar>
@@ -277,35 +263,32 @@
<!-- Main Body -->
<Grid Grid.Row="1">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" MinWidth="725"/>
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
<RowDefinition Height="*" />
+ <RowDefinition Height="Auto" />
</Grid.RowDefinitions>
+
<!-- Main Controls -->
<StackPanel Orientation="Vertical" IsEnabled="{Binding HasSource, Converter={StaticResource booleanConverter}, ConverterParameter=false}">
<!-- Source -->
<StackPanel Margin="10,5,5,5"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
- >
+ >
<Grid HorizontalAlignment="Stretch" Margin="0,0,10,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
-
+
<Label Content="{x:Static Properties:ResourcesUI.MainView_Source}" FontWeight="Bold" Grid.Column="0" />
<TextBlock Text="{Binding Path=SourceLabel}" TextTrimming="CharacterEllipsis" Grid.Column="1" MaxWidth="400" />
<TextBlock Text="{Binding SourceInfo}" HorizontalAlignment="Right" VerticalAlignment="Center" Foreground="Gray" FontFamily="Segoe UI Light" Grid.Column="2" MaxWidth="400" />
</Grid>
-
+
<StackPanel Orientation="Horizontal">
<Label Margin="8,0,0,0" Content="{x:Static Properties:ResourcesUI.MainView_Title}" />
<ComboBox Name="Titles"
@@ -314,7 +297,7 @@
ItemsSource="{Binding ScannedSource.Titles}"
ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Title}"
SelectedItem="{Binding Path=SelectedTitle}"
- />
+ />
<Label Margin="8,0,0,0" Content="{x:Static Properties:ResourcesUI.MainView_Angle}" />
<ComboBox Name="Angles"
@@ -322,13 +305,13 @@
Margin="8,0,0,0"
ItemsSource="{Binding Angles}"
SelectedItem="{Binding SelectedAngle}"
- ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Angle}" />
+ ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Angle}" />
<ComboBox Name="PointToPointMode"
MinWidth="80"
Margin="8,0,0,0"
ItemsSource="{Binding RangeMode}" ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Range}"
SelectedItem="{Binding SelectedPointToPoint}"
- />
+ />
<ComboBox Name="StartPoint"
MinWidth="60"
Margin="8,0,0,0"
@@ -337,13 +320,13 @@
Visibility="{Binding ShowTextEntryForPointToPointMode,
Converter={StaticResource boolToVisConverter},
ConverterParameter=true}"
- />
+ />
<Controls:TimeSpanBox Number="{Binding SelectedStartPoint, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Minimum="0" AllowEmpty="False" ShowTimeSpan="{Binding IsTimespanRange}"
MinWidth="80" Margin="8,0,0,0" Visibility="{Binding ShowTextEntryForPointToPointMode,
Converter={StaticResource boolToVisConverter},
ConverterParameter=false}"
- />
+ />
<Label Margin="4,0,0,0" Content="{x:Static Properties:ResourcesUI.MainView_through}" />
<ComboBox Name="EndPoint"
@@ -354,13 +337,13 @@
Visibility="{Binding ShowTextEntryForPointToPointMode,
Converter={StaticResource boolToVisConverter},
ConverterParameter=true}"
- />
+ />
<Controls:TimeSpanBox Number="{Binding SelectedEndPoint, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Minimum="0" AllowEmpty="False" ShowTimeSpan="{Binding IsTimespanRange}"
MinWidth="80" Margin="8,0,0,0" Visibility="{Binding ShowTextEntryForPointToPointMode,
Converter={StaticResource boolToVisConverter},
ConverterParameter=false}"
- />
+ />
<Label Margin="4,0,0,0" Content="{x:Static Properties:ResourcesUI.MainView_Duration}" ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Duration}" />
<Label Margin="4,0,0,0" Content="{Binding Duration}" ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Duration}" />
@@ -369,54 +352,53 @@
</StackPanel>
</StackPanel>
- <!-- Destination -->
- <StackPanel Grid.Row="1" IsEnabled="{Binding HasSource, Converter={StaticResource booleanConverter}, ConverterParameter=false}"
- Margin="10,5,10,5"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- >
- <Label Content="{x:Static Properties:ResourcesUI.MainView_Destination}" FontWeight="Bold" />
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <Label Margin="8,0,0,0" Content="{x:Static Properties:ResourcesUI.MainView_File}" />
- <TextBox Name="Destination"
- Grid.Column="1"
- Margin="8,0,0,0" ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Destination}"
- Text="{Binding Destination,
- UpdateSourceTrigger=PropertyChanged}"
- >
- <TextBox.ContextMenu>
- <ContextMenu>
- <MenuItem Header="Open this Directory" cal:Message.Attach="[Event Click] = [Action OpenDestinationDirectory]" />
+ <!-- Presets Options -->
+ <StackPanel Grid.Row="1" Orientation="Vertical" Margin="10,5,10,5">
+ <Label Content="Presets" FontWeight="Bold" VerticalAlignment="Center" />
+ <StackPanel Orientation="Horizontal" Margin="8,0,0,0">
+ <ComboBox ItemsSource="{Binding PresetsCategories}" SelectedItem="{Binding SelectedPresetCategory}" Width="150" DisplayMemberPath="Category" Margin="5,0,0,0" VerticalAlignment="Center" />
+ <ComboBox ItemsSource="{Binding CategoryPresets}" SelectedItem="{Binding SelectedPreset}" DisplayMemberPath="Name" Width="250" Margin="10,0,0,0" VerticalAlignment="Center" />
+
+ <Button Content="Reload" cal:Message.Attach="[Event Click] = [Action PresetSelect]" Margin="15,0,0,0" VerticalAlignment="Center" />
+ <Button Content="Save Custom Preset" cal:Message.Attach="[Event Click] = [Action PresetAdd]" Margin="5,0,0,0" VerticalAlignment="Center" />
+
+ <Button x:Name="MorePresetOptionsButton" Margin="15,0,0,0" VerticalAlignment="Center" Click="MorePresetOptionsButton_OnClick">
+ <Button.Content>
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Margin="0,0,5,0" Padding="0"
+ VerticalAlignment="Center"
+ Text="{x:Static Properties:ResourcesUI.MainView_Options}" />
+
+ <Path Height="5" Margin="2,2,2,0" VerticalAlignment="Center" HorizontalAlignment="Center"
+ Data="M 0 0 L 4 4 L 8 0 Z"
+ Fill="{DynamicResource GlyphBrush}" x:Name="dropdownArrowPreset" />
+ </StackPanel>
+ </Button.Content>
+
+ <Button.ContextMenu>
+ <ContextMenu x:Name="MainContextMenu" PlacementRectangle="{Binding RelativeSource={RelativeSource Self}}">
+ <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_SetDefault}" cal:Message.Attach="[Event Click] = [Action PresetSetDefault]" />
+ <Separator />
+ <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_UpdateSelectedPreset}" cal:Message.Attach="[Event Click] = [Action PresetUpdate]" />
+ <Separator />
+ <MenuItem Header="{x:Static Properties:ResourcesUI.Preset_Import}" cal:Message.Attach="[Event Click] = [Action PresetImport]" />
+ <MenuItem Header="{x:Static Properties:ResourcesUI.Preset_Export}" cal:Message.Attach="[Event Click] = [Action PresetExport]" />
+ <Separator />
+ <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_ResetBuiltInPresets}" cal:Message.Attach="[Event Click] = [Action PresetReset]" />
</ContextMenu>
- </TextBox.ContextMenu>
- </TextBox>
- <Button Name="DestinationBrowser"
- Grid.Column="2"
- Margin="8,0,0,0" FontWeight="Bold"
- Content="Browse"
- ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Browse}"
- cal:Message.Attach="[Event Click] = [Action BrowseDestination]"
- />
- </Grid>
+ </Button.ContextMenu>
+ </Button>
+ </StackPanel>
</StackPanel>
- <!-- Presets Options -->
- <!-- TODO New Preset Controls Grid.Row=2 -->
-
<!-- Tab Control -->
<TabControl Name="tabControl" IsEnabled="{Binding HasSource, Converter={StaticResource booleanConverter}, ConverterParameter=false}"
- Grid.Row="3"
- Margin="10,10,10,6"
+ Grid.Row="2"
+ Margin="15,10,10,6"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
SelectionChanged="TabControl_OnSelectionChanged"
- Visibility="{Binding IsQueueShowingInLine, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}"
- >
+ Visibility="{Binding IsQueueShowingInLine, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}">
<TabItem Name="summaryTab" Header="{x:Static Properties:ResourcesUI.MainView_SummaryTab}">
<ContentControl x:Name="SummaryViewModel" />
</TabItem>
@@ -444,198 +426,52 @@
</TabControl>
<!-- Queue in-line display if enabled -->
- <Grid Grid.Row="3" Grid.Column="0" Margin="10,10,10,5" Visibility="{Binding IsQueueShowingInLine, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}"
+ <Grid Grid.Row="2" Grid.Column="0" Margin="10,10,10,5" Visibility="{Binding IsQueueShowingInLine, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Content="Queue" FontWeight="Bold" Grid.Row="0"/>
- <ContentControl x:Name="QueueViewModel" cal:View.Context="Embedded" Margin="5,0,0,0" Grid.Row="1" />
+ <ContentControl x:Name="QueueViewModel" cal:View.Context="Embedded" Margin="5,0,0,0" Grid.Row="1" />
</Grid>
- <!-- Presets -->
- <GroupBox Grid.Row="0" Grid.RowSpan="4"
- Grid.Column="1"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- Header="Presets"
- Margin="0,0,5,5"
- IsEnabled="{Binding HasSource, Converter={StaticResource booleanConverter}, ConverterParameter=false}"
- Visibility="{Binding IsPresetPanelShowing, Converter={StaticResource boolToVisConverter}}">
-
-
+ <!-- Destination -->
+ <StackPanel Grid.Row="3" IsEnabled="{Binding HasSource, Converter={StaticResource booleanConverter}, ConverterParameter=false}"
+ Margin="10,5,10,15"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Stretch">
+ <Label Content="{x:Static Properties:ResourcesUI.MainView_Destination}" FontWeight="Bold" />
<Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
-
- <Grid.Resources>
-
- <HierarchicalDataTemplate DataType="{x:Type loc:Preset}">
- <StackPanel Orientation="Horizontal" >
- <StackPanel.Resources>
- <Style TargetType="TextBlock">
- <Style.Triggers>
- <DataTrigger Binding="{Binding IsDefault}" Value="True" >
- <Setter Property="FontStyle" Value="Italic" />
- </DataTrigger>
- <DataTrigger Binding="{Binding IsDefault}" Value="False" >
- <Setter Property="FontStyle" Value="Normal" />
- </DataTrigger>
- <DataTrigger Binding="{Binding IsSelected}" Value="True">
- <Setter Property="FontWeight" Value="Bold"/>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </StackPanel.Resources>
- <TextBlock Text="{Binding Name}"/>
- </StackPanel>
- </HierarchicalDataTemplate>
-
- <HierarchicalDataTemplate DataType="{x:Type loc:PresetDisplayCategory}" ItemsSource="{Binding Presets}">
- <StackPanel Orientation="Horizontal" >
- <TextBlock Text="{Binding Category}" FontSize="14" />
- </StackPanel>
- </HierarchicalDataTemplate>
- </Grid.Resources>
-
- <TreeView x:Name="presetListTree" HorizontalAlignment="Stretch" AutomationProperties.Name="Presets List" ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Presets}"
- VerticalAlignment="Stretch" BorderThickness="0,0,0,1" BorderBrush="LightGray"
- ItemsSource="{Binding Presets}"
- helpers:TreeViewHelper.TreeViewSelectedItem="{Binding Path=SelectedPreset, Mode=TwoWay}"
- PreviewMouseRightButtonDown="PresetListTree_OnPreviewMouseRightButtonDown">
-
- <TreeView.ItemContainerStyle>
- <Style BasedOn="{StaticResource {x:Type TreeViewItem}}" TargetType="TreeViewItem">
- <Setter Property="HorizontalAlignment" Value="Stretch" />
- <Setter Property="Padding" Value="4" />
- <Setter Property="ToolTip" Value="{Binding Description}" />
- <Setter Property="ToolTipService.InitialShowDelay" Value="1500"/>
- <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
- <EventSetter Event="TreeViewItem.Collapsed" Handler="PresetTreeviewItemCollasped" />
- <Style.Triggers>
- <Trigger Property="HasItems" Value="True">
- <Setter Property="Focusable" Value="false" />
- </Trigger>
-
- </Style.Triggers>
- </Style>
- </TreeView.ItemContainerStyle>
-
- <TreeView.ContextMenu>
- <ContextMenu AutomationProperties.Name="Presets List Context Menu">
- <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_SetDefault}" cal:Message.Attach="[Event Click] = [Action PresetSetDefault]" />
- <Separator />
- <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_UpdateSelectedPreset}" cal:Message.Attach="[Event Click] = [Action PresetUpdate]" />
- <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_PresetManage}" cal:Message.Attach="[Event Click] = [Action PresetManage]" />
- <Separator />
- <MenuItem Header="{x:Static Properties:ResourcesUI.Preset_Import}" cal:Message.Attach="[Event Click] = [Action PresetImport]" />
- <MenuItem Header="{x:Static Properties:ResourcesUI.Preset_Export}" cal:Message.Attach="[Event Click] = [Action PresetExport]" />
- <Separator />
- <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_ResetBuiltInPresets}" cal:Message.Attach="[Event Click] = [Action PresetReset]" />
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="58" />
+ <ColumnDefinition Width="24"/>
+ <ColumnDefinition Width="17*" />
+ <ColumnDefinition Width="972*"/>
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+ <Label Margin="8,0,0,0" Content="{x:Static Properties:ResourcesUI.MainView_File}" Grid.ColumnSpan="2" />
+ <TextBox Name="Destination"
+ Grid.Column="2"
+ Margin="8,0,0,0" ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Destination}"
+ Text="{Binding Destination,
+ UpdateSourceTrigger=PropertyChanged}" Grid.ColumnSpan="2">
+ <TextBox.ContextMenu>
+ <ContextMenu>
+ <MenuItem Header="Open this Directory" cal:Message.Attach="[Event Click] = [Action OpenDestinationDirectory]" />
</ContextMenu>
-
- </TreeView.ContextMenu>
-
- <i:Interaction.Triggers>
- <commands:InputBindingTrigger>
- <commands:InputBindingTrigger.InputBinding>
- <KeyBinding Key="Delete"/>
- </commands:InputBindingTrigger.InputBinding>
- <cal:ActionMessage MethodName="PresetRemove" />
- </commands:InputBindingTrigger>
- </i:Interaction.Triggers>
-
- </TreeView>
-
- <ToolBar Name="presetsToolBar"
- Grid.Row="1"
- HorizontalAlignment="Center"
- VerticalAlignment="Stretch"
- SnapsToDevicePixels="False"
- UseLayoutRounding="False"
- ToolBar.OverflowMode="Never"
- Background="Transparent"
- ToolBarTray.IsLocked="True"
- Loaded="ToolBarLoaded"
- KeyboardNavigation.TabNavigation="Continue" >
-
- <ToolBar.Resources>
- <Style TargetType="{x:Type ToolBarPanel}">
- <Setter Property="Orientation" Value="Vertical"/>
- <Setter Property="VerticalAlignment" Value="Center"/>
- </Style>
-
- <Style BasedOn="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" TargetType="{x:Type Button}" />
- </ToolBar.Resources>
-
- <ToolBarOverflowPanel>
- <Button cal:Message.Attach="[Event Click] = [Action PresetAdd]" AutomationProperties.Name="Add Preset" ToolTip="{x:Static Properties:ResourcesTooltips.MainView_AddPreset}">
- <Button.Content>
- <StackPanel Orientation="Horizontal">
- <Image Width="20"
- Height="20"
- Source="Images/add.png"
- />
- <TextBlock Margin="2,0,0,0"
- VerticalAlignment="Center"
- Style="{StaticResource textBlockOrangeStyle}"
- Text="{x:Static Properties:ResourcesUI.Generic_Add}"
- />
- </StackPanel>
- </Button.Content>
- </Button>
-
- <Button Background="Transparent" cal:Message.Attach="[Event Click] = [Action PresetRemove]" AutomationProperties.Name="Remove Preset" ToolTip="{x:Static Properties:ResourcesTooltips.MainView_RemovePreset}">
- <Button.Content>
- <StackPanel Orientation="Horizontal">
- <Image Width="20"
- Height="20"
- Source="Images/remove.png"
- SnapsToDevicePixels="True"
- />
- <TextBlock Margin="2,0,0,0"
- VerticalAlignment="Center"
- Style="{StaticResource textBlockOrangeStyle}"
- Text="{x:Static Properties:ResourcesUI.MainView_Remove}"
- />
- </StackPanel>
- </Button.Content>
- </Button>
-
- <Menu Background="Transparent" AutomationProperties.Name="Preset Options Dropdown" MinHeight="22" ToolTip="{x:Static Properties:ResourcesTooltips.MainView_PresetAdditionalOptions}">
- <MenuItem ToolBar.OverflowMode="Never">
- <MenuItem.Header>
- <StackPanel Orientation="Horizontal">
- <Image Width="20"
- Height="20"
- Source="Images/Advanced.png"
- RenderOptions.BitmapScalingMode="HighQuality"
- />
- <TextBlock Margin="2,0,0,0"
- VerticalAlignment="Center"
- Style="{StaticResource textBlockOrangeStyle}"
- Text="{x:Static Properties:ResourcesUI.MainView_Options}"
- />
- </StackPanel>
- </MenuItem.Header>
- <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_SetDefault}" cal:Message.Attach="[Event Click] = [Action PresetSetDefault]" />
- <Separator />
- <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_UpdateSelectedPreset}" cal:Message.Attach="[Event Click] = [Action PresetUpdate]" />
- <Separator />
- <MenuItem Header="{x:Static Properties:ResourcesUI.Preset_Import}" cal:Message.Attach="[Event Click] = [Action PresetImport]" />
- <MenuItem Header="{x:Static Properties:ResourcesUI.Preset_Export}" cal:Message.Attach="[Event Click] = [Action PresetExport]" />
- <Separator />
- <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_ResetBuiltInPresets}" cal:Message.Attach="[Event Click] = [Action PresetReset]" />
- </MenuItem>
- </Menu>
- </ToolBarOverflowPanel>
-
- </ToolBar>
+ </TextBox.ContextMenu>
+ </TextBox>
+ <Button Name="DestinationBrowser"
+ Grid.Column="4"
+ Margin="8,2,0,1" FontWeight="Bold"
+ Content="Browse"
+ ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Browse}"
+ cal:Message.Attach="[Event Click] = [Action BrowseDestination]"
+ />
</Grid>
- </GroupBox>
+ </StackPanel>
+
</Grid>
<!-- Source Selection-->
@@ -644,7 +480,7 @@
Visibility="{Binding ShowSourceSelection, Converter={StaticResource boolToVisConverter}, ConverterParameter=false, TargetNullValue=Collapsed, FallbackValue=Collapsed}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
Panel.ZIndex="10" />
-
+
<Controls:StatusPanel x:Name="loadingPanel"
Grid.Row="0"
Grid.RowSpan="3"
@@ -658,19 +494,19 @@
SecondaryActionText="Open Log Window"
SecondaryAction="{Binding OpenLogWindowAction}"
CancelAction="{Binding CancelAction}"
- />
+ />
<Controls:AlertPanel x:Name="alertPanel"
- Grid.Row="0"
- Grid.RowSpan="3"
- Visibility="{Binding ShowAlertWindow, Converter={StaticResource boolToVisConverter}, ConverterParameter=false, TargetNullValue=Collapsed, FallbackValue=Collapsed}"
- VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
- Panel.ZIndex="10"
- Message="{Binding AlertWindowHeader}"
- SubMessage="{Binding AlertWindowText}"
- ActionText="OK"
- DefaultAction="{Binding AlertWindowClose}">
-
+ Grid.Row="0"
+ Grid.RowSpan="3"
+ Visibility="{Binding ShowAlertWindow, Converter={StaticResource boolToVisConverter}, ConverterParameter=false, TargetNullValue=Collapsed, FallbackValue=Collapsed}"
+ VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
+ Panel.ZIndex="10"
+ Message="{Binding AlertWindowHeader}"
+ SubMessage="{Binding AlertWindowText}"
+ ActionText="OK"
+ DefaultAction="{Binding AlertWindowClose}">
+
</Controls:AlertPanel>
<!-- Status Bar -->
@@ -678,7 +514,7 @@
<StatusBarItem>
<ProgressBar Value="{Binding ProgressPercentage}" Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}}"
- Width="100" Height="18" VerticalAlignment="Center" />
+ Width="100" Height="18" VerticalAlignment="Center" />
</StatusBarItem>
<StatusBarItem>
<TextBlock Text="{Binding Path=ProgramStatusLabel}" TextTrimming="CharacterEllipsis" />
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml.cs b/win/CS/HandBrakeWPF/Views/MainView.xaml.cs
index 76f5a8f36..f6f1799c1 100644
--- a/win/CS/HandBrakeWPF/Views/MainView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/MainView.xaml.cs
@@ -31,29 +31,6 @@ namespace HandBrakeWPF.Views
}
/// <summary>
- /// Hide the overflow control on the Preset panel.
- /// TODO find a better way of doing this. This seems to be the common solution.
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void ToolBarLoaded(object sender, RoutedEventArgs e)
- {
- ToolBar toolBar = sender as ToolBar;
- if (toolBar != null)
- {
- var overflowGrid = toolBar.Template.FindName("OverflowGrid", toolBar) as FrameworkElement;
- if (overflowGrid != null)
- {
- overflowGrid.Visibility = Visibility.Collapsed;
- }
- }
- }
-
- /// <summary>
/// Add to Queue button context menu handling.
/// </summary>
/// <param name="sender">
@@ -87,34 +64,6 @@ namespace HandBrakeWPF.Views
((IMainViewModel)this.DataContext).AddToQueue();
}
- private void PresetTreeviewItemCollasped(object sender, RoutedEventArgs e)
- {
- if (e.Source.GetType() == typeof(TreeViewItem))
- {
- TreeViewItem item = e.Source as TreeViewItem;
- if (item != null) item.IsSelected = false;
- }
- }
-
- private void PresetListTree_OnPreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
- {
- TreeViewItem treeViewItem = VisualUpwardSearch(e.OriginalSource as DependencyObject);
-
- if (treeViewItem != null)
- {
- treeViewItem.Focus();
- e.Handled = true;
- }
- }
-
- private static TreeViewItem VisualUpwardSearch(DependencyObject source)
- {
- while (source != null && !(source is TreeViewItem))
- source = VisualTreeHelper.GetParent(source);
-
- return source as TreeViewItem;
- }
-
private void TabControl_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.AddedItems.Count > 0)
@@ -126,5 +75,16 @@ namespace HandBrakeWPF.Views
}
}
}
+
+ private void MorePresetOptionsButton_OnClick(object sender, RoutedEventArgs e)
+ {
+ var button = sender as FrameworkElement;
+ if (button != null && button.ContextMenu != null)
+ {
+ button.ContextMenu.PlacementTarget = button;
+ button.ContextMenu.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
+ button.ContextMenu.IsOpen = true;
+ }
+ }
}
}
diff --git a/win/CS/HandBrakeWPF/Views/ShellView.xaml b/win/CS/HandBrakeWPF/Views/ShellView.xaml
index 9eb2e9469..5e29615d3 100644
--- a/win/CS/HandBrakeWPF/Views/ShellView.xaml
+++ b/win/CS/HandBrakeWPF/Views/ShellView.xaml
@@ -6,9 +6,9 @@
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:cal="http://www.caliburnproject.org"
Title="{Data:Binding Path=MainViewModel.WindowTitle}"
- Width="1015"
+ Width="900"
Height="675"
- MinWidth="750"
+ MinWidth="800"
MinHeight="675"
AllowDrop="True"
SnapsToDevicePixels="True"