diff options
author | sr55 <[email protected]> | 2017-09-08 22:14:26 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2017-09-08 22:14:26 +0100 |
commit | e17f33293848a5f3a783f09377adc94ffedb0f44 (patch) | |
tree | 7e4e44df742d3f82c4ab142ee1a35073e7ac984a /win/CS/HandBrakeWPF | |
parent | b2f2e30f942a917348703e28418be97595ad5e8d (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')
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/ResourcesUI.resx | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Services/Presets/Interfaces/IPresetService.cs | 10 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Services/Presets/PresetService.cs | 33 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/UserSettingConstants.cs | 5 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 166 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/MainView.xaml | 428 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/MainView.xaml.cs | 62 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/ShellView.xaml | 4 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/defaultsettings.xml | 8 |
10 files changed, 248 insertions, 472 deletions
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs index 9cdce00b9..c132ff043 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs @@ -736,7 +736,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to File.
+ /// Looks up a localized string similar to Save To.
/// </summary>
public static string MainView_File {
get {
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx index 98b46afe9..11b3727b1 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx @@ -151,7 +151,7 @@ <value>Duration</value>
</data>
<data name="MainView_File" xml:space="preserve">
- <value>File</value>
+ <value>Save To</value>
</data>
<data name="MainView_FiltersTab" xml:space="preserve">
<value>Filters</value>
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Interfaces/IPresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/Interfaces/IPresetService.cs index f75c054c5..6c6b8ceb6 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Interfaces/IPresetService.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Interfaces/IPresetService.cs @@ -36,16 +36,6 @@ namespace HandBrakeWPF.Services.Presets.Interfaces void Load();
/// <summary>
- /// Save the state of the Preset Treview
- /// </summary>
- void SaveCategoryStates();
-
- /// <summary>
- /// Load the state of the Preset Treeview.
- /// </summary>
- void LoadCategoryStates();
-
- /// <summary>
/// Add a new preset to the system
/// </summary>
/// <param name="preset">
diff --git a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs index 14001040e..ea948344b 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs @@ -543,39 +543,6 @@ namespace HandBrakeWPF.Services.Presets selectedPreset.IsSelected = true;
}
- public void SaveCategoryStates()
- {
- StringCollection expandedPresets = new StringCollection();
- foreach (IPresetObject presetObject in this.presets)
- {
- PresetDisplayCategory category = presetObject as PresetDisplayCategory;
- if (category != null && category.IsExpanded)
- {
- expandedPresets.Add(category.Category);
- }
- }
-
- this.userSettingService.SetUserSetting(UserSettingConstants.PresetExpandedStateList, expandedPresets);
- }
-
- public void LoadCategoryStates()
- {
- StringCollection expandedPresets = this.userSettingService.GetUserSetting<StringCollection>(UserSettingConstants.PresetExpandedStateList);
- if (expandedPresets == null || expandedPresets.Count == 0)
- {
- return;
- }
-
- foreach (IPresetObject presetObject in this.presets)
- {
- PresetDisplayCategory category = presetObject as PresetDisplayCategory;
- if (category != null && expandedPresets.Contains(category.Category))
- {
- category.IsExpanded = true;
- }
- }
- }
-
#endregion
#region Private Helpers
diff --git a/win/CS/HandBrakeWPF/UserSettingConstants.cs b/win/CS/HandBrakeWPF/UserSettingConstants.cs index 09bc63d83..74c901d2d 100644 --- a/win/CS/HandBrakeWPF/UserSettingConstants.cs +++ b/win/CS/HandBrakeWPF/UserSettingConstants.cs @@ -147,11 +147,6 @@ namespace HandBrakeWPF public const string RemovePunctuation = "RemovePunctuation";
/// <summary>
- /// The Show Preset Panel
- /// </summary>
- public const string ShowPresetPanel = "ShowPresetPanel";
-
- /// <summary>
/// The reset when done action.
/// </summary>
public const string ResetWhenDoneAction = "ResetWhenDoneAction";
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 21b323aff..1c6c0ba34 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -89,7 +89,6 @@ namespace HandBrakeWPF.ViewModels private Preset selectedPreset;
private EncodeTask queueEditTask;
private int lastEncodePercentage;
- private bool isPresetPanelShowing;
private bool showSourceSelection;
private BindingList<SourceMenuItem> drives;
private bool canPause;
@@ -98,6 +97,8 @@ namespace HandBrakeWPF.ViewModels private string alertWindowText;
private bool hasSource;
+ private IPresetObject selectedPresetCategory;
+
#endregion
/// <summary>
@@ -206,7 +207,7 @@ namespace HandBrakeWPF.ViewModels this.queueProcessor.EncodeService.EncodeStatusChanged += this.EncodeStatusChanged;
this.userSettingService.SettingChanged += this.UserSettingServiceSettingChanged;
- this.Presets = new BindingList<IPresetObject>();
+ this.PresetsCategories = new BindingList<IPresetObject>();
this.Drives = new BindingList<SourceMenuItem>();
// Set Process Priority
@@ -362,12 +363,49 @@ namespace HandBrakeWPF.ViewModels /// <summary>
/// Gets or sets Presets.
/// </summary>
- public IEnumerable<IPresetObject> Presets { get; set; }
+ public IEnumerable<IPresetObject> PresetsCategories { get; set; }
+
+ public IPresetObject SelectedPresetCategory
+ {
+ get
+ {
+ return this.selectedPresetCategory;
+ }
+ set
+ {
+ if (!object.Equals(this.selectedPresetCategory, value))
+ {
+ this.selectedPresetCategory = value;
+ this.NotifyOfPropertyChange(() => this.SelectedPresetCategory);
+ this.NotifyOfPropertyChange(() => this.CategoryPresets);
+ }
+ }
+ }
+
+ public IEnumerable<Preset> CategoryPresets
+ {
+ get
+ {
+ PresetDisplayCategory category = this.SelectedPresetCategory as PresetDisplayCategory;
+ if (category != null && category.Presets != null)
+ {
+ if (!category.Presets.Contains(this.SelectedPreset))
+ {
+ this.SelectedPreset = category.Presets.FirstOrDefault();
+ }
+
+ return new BindingList<Preset>(category.Presets);
+ }
+
+ this.SelectedPreset = null;
+ return new BindingList<Preset>();
+ }
+ }
/// <summary>
/// Gets or sets SelectedPreset.
/// </summary>
- public object SelectedPreset
+ public Preset SelectedPreset
{
get
{
@@ -376,30 +414,11 @@ namespace HandBrakeWPF.ViewModels set
{
- if (value == null || value.GetType() != typeof(Preset))
+ if (!object.Equals(this.selectedPreset, value))
{
- return;
+ this.selectedPreset = value;
+ this.NotifyOfPropertyChange(() => this.SelectedPreset);
}
-
- this.selectedPreset = (Preset)value;
-
- this.presetService.SetSelected(selectedPreset);
-
- if (this.selectedPreset != null)
- {
- // Tab Settings
- this.PictureSettingsViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
- this.VideoViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
- this.FiltersViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
- this.AudioViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
- this.SubtitleViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
- this.ChaptersViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
- this.AdvancedViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
- this.MetaDataViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
- this.SummaryViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
- }
-
- this.NotifyOfPropertyChange(() => this.SelectedPreset);
}
}
@@ -912,31 +931,6 @@ namespace HandBrakeWPF.ViewModels }
/// <summary>
- /// Gets or sets a value indicating whether is preset panel showing.
- /// </summary>
- public bool IsPresetPanelShowing
- {
- get
- {
- return this.isPresetPanelShowing;
- }
- set
- {
- if (!Equals(this.isPresetPanelShowing, value))
- {
- this.isPresetPanelShowing = value;
- this.NotifyOfPropertyChange(() => this.IsPresetPanelShowing);
-
- // Save the setting if it has changed.
- if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowPresetPanel) != value)
- {
- this.userSettingService.SetUserSetting(UserSettingConstants.ShowPresetPanel, value);
- }
- }
- }
- }
-
- /// <summary>
/// Gets or sets a value indicating progress percentage.
/// </summary>
public int ProgressPercentage { get; set; }
@@ -1194,14 +1188,10 @@ namespace HandBrakeWPF.ViewModels // Perform an update check if required
this.updateService.PerformStartupUpdateCheck(this.HandleUpdateCheckResults);
- // Show or Hide the Preset Panel.
- this.IsPresetPanelShowing = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowPresetPanel);
-
// Setup the presets.
this.presetService.Load();
- this.Presets = this.presetService.Presets;
- this.NotifyOfPropertyChange(() => this.Presets);
- this.presetService.LoadCategoryStates();
+ this.PresetsCategories = this.presetService.Presets;
+ this.NotifyOfPropertyChange(() => this.PresetsCategories);
this.SummaryViewModel.OutputFormatChanged += this.SummaryViewModel_OutputFormatChanged;
@@ -1224,7 +1214,8 @@ namespace HandBrakeWPF.ViewModels this.queueProcessor.Start(this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ClearCompletedFromQueue));
}
- this.SelectedPreset = this.presetService.DefaultPreset;
+ // Preset Selection
+ this.SetDefaultPreset();
// Reset WhenDone if necessary.
if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ResetWhenDoneAction))
@@ -1258,7 +1249,6 @@ namespace HandBrakeWPF.ViewModels {
// Shutdown Service
this.queueProcessor.Stop();
- this.presetService.SaveCategoryStates();
// Unsubscribe from Events.
this.scanService.ScanStarted -= this.ScanStared;
@@ -1843,11 +1833,12 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public void PresetAdd()
{
- // TODO select the new preset.
IAddPresetViewModel presetViewModel = IoC.Get<IAddPresetViewModel>();
presetViewModel.Setup(this.CurrentTask, this.SelectedTitle, this.AudioViewModel.AudioBehaviours, this.SubtitleViewModel.SubtitleBehaviours);
this.windowManager.ShowDialog(presetViewModel);
- this.NotifyOfPropertyChange(() => this.Presets);
+
+ this.NotifyOfPropertyChange(() => this.PresetsCategories);
+ this.NotifyOfPropertyChange(() => this.CategoryPresets);
}
/// <summary>
@@ -1939,7 +1930,7 @@ namespace HandBrakeWPF.ViewModels }
this.presetService.Remove(this.selectedPreset);
- this.NotifyOfPropertyChange(() => this.Presets);
+ this.NotifyOfPropertyChange(() => this.CategoryPresets);
}
else
{
@@ -1973,7 +1964,7 @@ namespace HandBrakeWPF.ViewModels if (dialogResult.HasValue && dialogResult.Value)
{
this.presetService.Import(dialog.FileName);
- this.NotifyOfPropertyChange(() => this.Presets);
+ this.NotifyOfPropertyChange(() => this.CategoryPresets);
}
}
@@ -2014,11 +2005,20 @@ namespace HandBrakeWPF.ViewModels public void PresetReset()
{
this.presetService.UpdateBuiltInPresets();
- this.NotifyOfPropertyChange(() => this.Presets);
- this.SelectedPreset = this.presetService.DefaultPreset;
+
+ this.NotifyOfPropertyChange(() => this.PresetsCategories);
+ this.NotifyOfPropertyChange(() => this.CategoryPresets);
+
+ this.SetDefaultPreset();
+
this.errorService.ShowMessageBox(Resources.Presets_ResetComplete, Resources.Presets_ResetHeader, MessageBoxButton.OK, MessageBoxImage.Information);
}
+ public void PresetSelect()
+ {
+ this.PresetSelect(this.SelectedPreset);
+ }
+
/// <summary>
/// The preset select.
/// </summary>
@@ -2030,8 +2030,29 @@ namespace HandBrakeWPF.ViewModels Preset preset = tag as Preset;
if (preset != null)
{
+ if (this.SelectedPresetCategory == null || this.SelectedPresetCategory.Category != preset.Category)
+ {
+ this.SelectedPresetCategory = this.PresetsCategories.FirstOrDefault(c => c.Category == preset.Category);
+ }
+
this.SelectedPreset = preset;
}
+
+ this.presetService.SetSelected(this.selectedPreset);
+
+ if (this.selectedPreset != null)
+ {
+ // Tab Settings
+ this.PictureSettingsViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
+ this.VideoViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
+ this.FiltersViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
+ this.AudioViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
+ this.SubtitleViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
+ this.ChaptersViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
+ this.AdvancedViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
+ this.MetaDataViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
+ this.SummaryViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
+ }
}
/// <summary>
@@ -2218,6 +2239,21 @@ namespace HandBrakeWPF.ViewModels this.AlertWindowText = message;
}
+ private void SetDefaultPreset()
+ {
+ // Preset Selection
+ if (this.presetService.DefaultPreset != null)
+ {
+ PresetDisplayCategory category =
+ (PresetDisplayCategory)this.PresetsCategories.FirstOrDefault(
+ p => p.Category == this.presetService.DefaultPreset.Category);
+
+ this.SelectedPresetCategory = category;
+ this.SelectedPreset = this.presetService.DefaultPreset;
+ this.PresetSelect();
+ }
+ }
+
#endregion
#region Event Handlers
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"
diff --git a/win/CS/HandBrakeWPF/defaultsettings.xml b/win/CS/HandBrakeWPF/defaultsettings.xml index 220adf3f9..699927dad 100644 --- a/win/CS/HandBrakeWPF/defaultsettings.xml +++ b/win/CS/HandBrakeWPF/defaultsettings.xml @@ -402,14 +402,6 @@ </item>
<item>
<key>
- <string>ShowPresetPanel</string>
- </key>
- <value>
- <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">true</anyType>
- </value>
- </item>
- <item>
- <key>
<string>EnableQuickSync</string>
</key>
<value>
|