From 3f00ad4e38deca496922f836d31c44f8b630fbf4 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 3 Mar 2019 16:28:30 +0000 Subject: WinGui: Remove the legacy queue design. The new design is now always used. --- win/CS/HandBrakeWPF/Views/OptionsView.xaml | 1 - .../HandBrakeWPF/Views/Queue/QueueTwoContent.xaml | 544 --------------- .../Views/Queue/QueueTwoContent.xaml.cs | 108 --- win/CS/HandBrakeWPF/Views/Queue/QueueTwoView.xaml | 15 - .../HandBrakeWPF/Views/Queue/QueueTwoView.xaml.cs | 35 - win/CS/HandBrakeWPF/Views/QueueView.xaml | 773 ++++++++++++--------- win/CS/HandBrakeWPF/Views/QueueView.xaml.cs | 28 +- 7 files changed, 461 insertions(+), 1043 deletions(-) delete mode 100644 win/CS/HandBrakeWPF/Views/Queue/QueueTwoContent.xaml delete mode 100644 win/CS/HandBrakeWPF/Views/Queue/QueueTwoContent.xaml.cs delete mode 100644 win/CS/HandBrakeWPF/Views/Queue/QueueTwoView.xaml delete mode 100644 win/CS/HandBrakeWPF/Views/Queue/QueueTwoView.xaml.cs (limited to 'win/CS/HandBrakeWPF/Views') diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml index 31769f4a3..b98bf35c3 100644 --- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml +++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml @@ -198,7 +198,6 @@ - diff --git a/win/CS/HandBrakeWPF/Views/Queue/QueueTwoContent.xaml b/win/CS/HandBrakeWPF/Views/Queue/QueueTwoContent.xaml deleted file mode 100644 index d97c85deb..000000000 --- a/win/CS/HandBrakeWPF/Views/Queue/QueueTwoContent.xaml +++ /dev/null @@ -1,544 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/win/CS/HandBrakeWPF/Views/Queue/QueueTwoContent.xaml.cs b/win/CS/HandBrakeWPF/Views/Queue/QueueTwoContent.xaml.cs deleted file mode 100644 index e6fe29971..000000000 --- a/win/CS/HandBrakeWPF/Views/Queue/QueueTwoContent.xaml.cs +++ /dev/null @@ -1,108 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Interaction logic for QueueTwoView.xaml -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrakeWPF.Views.Queue -{ - using System.Windows; - using System.Windows.Controls; - using System.Windows.Input; - using System.Windows.Media; - - using HandBrakeWPF.Services.Queue.Model; - using HandBrakeWPF.ViewModels; - - /// - /// Interaction logic for VideoView - /// - public partial class QueueTwoContent : UserControl - { - private QueueTask mouseActiveQueueTask; - - /// - /// Initializes a new instance of the class. - /// - public QueueTwoContent() - { - this.InitializeComponent(); - this.SizeChanged += this.Queue2View_SizeChanged; - } - - private void Queue2View_SizeChanged(object sender, SizeChangedEventArgs e) - { - // Make the view adaptive. - if (e.WidthChanged) - { - this.summaryTabControl.Visibility = this.ActualWidth < 600 ? Visibility.Collapsed : Visibility.Visible; - this.leftTabPanel.Width = this.ActualWidth < 600 ? new GridLength(this.ActualWidth - 10, GridUnitType.Star) : new GridLength(3, GridUnitType.Star); - this.leftTabPanel.MaxWidth = this.ActualWidth < 600 ? 650 : 400; - } - } - private void ContextMenu_OnOpened(object sender, RoutedEventArgs e) - { - ContextMenu menu = sender as ContextMenu; - this.mouseActiveQueueTask = null; - - if (menu != null) - { - Point p = Mouse.GetPosition(this); - HitTestResult result = VisualTreeHelper.HitTest(this, p); - - if (result != null) - { - ListBoxItem listBoxItem = FindParent(result.VisualHit); - if (listBoxItem != null) - { - this.mouseActiveQueueTask = listBoxItem.DataContext as QueueTask; - } - } - } - - this.openSourceDir.IsEnabled = this.mouseActiveQueueTask != null; - this.openDestDir.IsEnabled = this.mouseActiveQueueTask != null; - } - - private static T FindParent(DependencyObject from) where T : class - { - DependencyObject parent = VisualTreeHelper.GetParent(from); - - T result = null; - if (parent is T) - { - result = parent as T; - } - else if (parent != null) - { - result = FindParent(parent); - } - - return result; - } - - private void OpenSourceDir_OnClick(object sender, RoutedEventArgs e) - { - ((QueueViewModel)this.DataContext).OpenSourceDirectory(this.mouseActiveQueueTask); - } - - private void OpenDestDir_OnClick(object sender, RoutedEventArgs e) - { - ((QueueViewModel)this.DataContext).OpenDestinationDirectory(this.mouseActiveQueueTask); - } - - private void QueueOptionsDropButton_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/Queue/QueueTwoView.xaml b/win/CS/HandBrakeWPF/Views/Queue/QueueTwoView.xaml deleted file mode 100644 index a49d2503b..000000000 --- a/win/CS/HandBrakeWPF/Views/Queue/QueueTwoView.xaml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - diff --git a/win/CS/HandBrakeWPF/Views/Queue/QueueTwoView.xaml.cs b/win/CS/HandBrakeWPF/Views/Queue/QueueTwoView.xaml.cs deleted file mode 100644 index 550ab4b85..000000000 --- a/win/CS/HandBrakeWPF/Views/Queue/QueueTwoView.xaml.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Interaction logic for QueueTwoView.xaml -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrakeWPF.Views.Queue -{ - using System.Windows; - using System.Windows.Controls; - using System.Windows.Input; - using System.Windows.Media; - - using HandBrakeWPF.Services.Queue.Model; - using HandBrakeWPF.ViewModels; - - /// - /// Interaction logic for VideoView - /// - public partial class QueueTwoView : Window - { - - /// - /// Initializes a new instance of the class. - /// - public QueueTwoView() - { - } - - - } -} diff --git a/win/CS/HandBrakeWPF/Views/QueueView.xaml b/win/CS/HandBrakeWPF/Views/QueueView.xaml index 33710d000..75c324536 100644 --- a/win/CS/HandBrakeWPF/Views/QueueView.xaml +++ b/win/CS/HandBrakeWPF/Views/QueueView.xaml @@ -14,7 +14,6 @@ xmlns:helpers="clr-namespace:HandBrakeWPF.Helpers" xmlns:Properties="clr-namespace:HandBrakeWPF.Properties" xmlns:queue="clr-namespace:HandBrakeWPF.Converters.Queue" - xmlns:queue1="clr-namespace:HandBrakeWPF.Views.Queue" Title="{Binding Title}" Width="750" Height="520" @@ -35,7 +34,7 @@ - + @@ -45,405 +44,505 @@ + + - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - + - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - + + + + - + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win/CS/HandBrakeWPF/Views/QueueView.xaml.cs b/win/CS/HandBrakeWPF/Views/QueueView.xaml.cs index a04a6c77a..53b4256aa 100644 --- a/win/CS/HandBrakeWPF/Views/QueueView.xaml.cs +++ b/win/CS/HandBrakeWPF/Views/QueueView.xaml.cs @@ -1,9 +1,9 @@ // -------------------------------------------------------------------------------------------------------------------- -// +// // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // // -// Interaction logic for VideoView.xaml +// Interaction logic for QueueTwoView.xaml // // -------------------------------------------------------------------------------------------------------------------- @@ -25,13 +25,24 @@ namespace HandBrakeWPF.Views private QueueTask mouseActiveQueueTask; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// public QueueView() { this.InitializeComponent(); + this.SizeChanged += this.Queue2View_SizeChanged; } + private void Queue2View_SizeChanged(object sender, SizeChangedEventArgs e) + { + // Make the view adaptive. + if (e.WidthChanged) + { + this.summaryTabControl.Visibility = this.ActualWidth < 600 ? Visibility.Collapsed : Visibility.Visible; + this.leftTabPanel.Width = this.ActualWidth < 600 ? new GridLength(this.ActualWidth - 10, GridUnitType.Star) : new GridLength(3, GridUnitType.Star); + this.leftTabPanel.MaxWidth = this.ActualWidth < 600 ? 650 : 400; + } + } private void ContextMenu_OnOpened(object sender, RoutedEventArgs e) { ContextMenu menu = sender as ContextMenu; @@ -82,5 +93,16 @@ namespace HandBrakeWPF.Views { ((QueueViewModel)this.DataContext).OpenDestinationDirectory(this.mouseActiveQueueTask); } + + private void QueueOptionsDropButton_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; + } + } } } -- cgit v1.2.3