summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Views/MainView.xaml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF/Views/MainView.xaml.cs')
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml.cs b/win/CS/HandBrakeWPF/Views/MainView.xaml.cs
index f6f1799c1..74220b160 100644
--- a/win/CS/HandBrakeWPF/Views/MainView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/MainView.xaml.cs
@@ -86,5 +86,46 @@ namespace HandBrakeWPF.Views
button.ContextMenu.IsOpen = true;
}
}
+
+ 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;
+ }
+ }
+ }
+
+ 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;
+ }
}
}