Browse Source

bugfix closeable panes

pull/1725/head
jkuehner 6 years ago committed by Siegfried Pammer
parent
commit
c580576742
  1. 7
      ILSpy/Docking/DockingHelper.cs
  2. 4
      ILSpy/MainWindow.xaml
  3. 6
      ILSpy/MainWindow.xaml.cs

7
ILSpy/Docking/DockingHelper.cs

@ -18,9 +18,14 @@ namespace ICSharpCode.ILSpy.Docking
} }
parentDocumentGroup.Orientation = System.Windows.Controls.Orientation.Vertical; parentDocumentGroup.Orientation = System.Windows.Controls.Orientation.Vertical;
int indexOfParentPane = parentDocumentGroup.IndexOfChild(parentDocumentPane); int indexOfParentPane = parentDocumentGroup.IndexOfChild(parentDocumentPane);
parentDocumentGroup.InsertChildAt(dockBefore ? indexOfParentPane : indexOfParentPane + 1, new LayoutDocumentPane(layoutContent) { DockHeight = dockHeight }); var layoutDocumentPane = new LayoutDocumentPane(layoutContent) { DockHeight = dockHeight };
parentDocumentGroup.InsertChildAt(dockBefore ? indexOfParentPane : indexOfParentPane + 1, layoutDocumentPane);
layoutContent.IsActive = true; layoutContent.IsActive = true;
layoutContent.Root.CollectGarbage(); layoutContent.Root.CollectGarbage();
Application.Current.MainWindow.Dispatcher.Invoke(() => {
layoutDocumentPane.DockHeight = dockHeight;
}, System.Windows.Threading.DispatcherPriority.Loaded);
} }
} }
} }

4
ILSpy/MainWindow.xaml

@ -126,7 +126,7 @@
<avalondock:LayoutPanel Orientation="Horizontal"> <avalondock:LayoutPanel Orientation="Horizontal">
<avalondock:LayoutAnchorablePaneGroup DockWidth="200" Orientation="Vertical"> <avalondock:LayoutAnchorablePaneGroup DockWidth="200" Orientation="Vertical">
<avalondock:LayoutAnchorablePane DockHeight="*"> <avalondock:LayoutAnchorablePane DockHeight="*">
<avalondock:LayoutAnchorable x:Name="Tree" Title="Project Explorer" CanClose="False"> <avalondock:LayoutAnchorable x:Name="Tree" Title="Project Explorer" CanHide="False" CanClose="False">
<!-- Left pane: Tree View of assemblies and classes --> <!-- Left pane: Tree View of assemblies and classes -->
<tv:SharpTreeView <tv:SharpTreeView
Name="treeView" Name="treeView"
@ -142,7 +142,7 @@
<avalondock:LayoutDocumentPaneGroup DockWidth="*"> <avalondock:LayoutDocumentPaneGroup DockWidth="*">
<avalondock:LayoutDocumentPane x:Name="adDocumentPane"> <avalondock:LayoutDocumentPane x:Name="adDocumentPane">
<avalondock:LayoutDocument Title="Decompilation"> <avalondock:LayoutDocument Title="MAIN" CanClose="False">
<!-- decompilerTextView is into the mainPane by code --> <!-- decompilerTextView is into the mainPane by code -->
<ContentPresenter Name="mainPane" /> <ContentPresenter Name="mainPane" />
</avalondock:LayoutDocument> </avalondock:LayoutDocument>

6
ILSpy/MainWindow.xaml.cs

@ -1054,13 +1054,13 @@ namespace ICSharpCode.ILSpy
public void ShowInNewPane(string title, object content, PanePosition panePosition, string toolTip = null) public void ShowInNewPane(string title, object content, PanePosition panePosition, string toolTip = null)
{ {
if (panePosition == PanePosition.Document) { if (panePosition == PanePosition.Document) {
var layoutDocument = new LayoutDocument() { Title = title, Content = content, ToolTip = toolTip }; var layoutDocument = new LayoutDocument() { Title = title, Content = content, ToolTip = toolTip, CanClose = true };
var documentPane = this.DockManager.Layout.Descendents().OfType<LayoutDocumentPane>().FirstOrDefault(); var documentPane = this.DockManager.Layout.Descendents().OfType<LayoutDocumentPane>().FirstOrDefault();
documentPane.Children.Add(layoutDocument); documentPane.Children.Add(layoutDocument);
} else { } else {
var layoutAnchorable = new LayoutAnchorable() { Title = title, Content = content, ToolTip = toolTip }; var layoutAnchorable = new LayoutAnchorable() { Title = title, Content = content, ToolTip = toolTip, CanClose = true, CanHide = true };
var documentPane = this.DockManager.Layout.Descendents().OfType<LayoutDocumentPane>().FirstOrDefault(); var documentPane = this.DockManager.Layout.Descendents().OfType<LayoutDocumentPane>().FirstOrDefault();
Docking.DockingHelper.DockHorizontal(layoutAnchorable, documentPane, new GridLength(100), panePosition == PanePosition.Top); Docking.DockingHelper.DockHorizontal(layoutAnchorable, documentPane, new GridLength(200), panePosition == PanePosition.Top);
} }
} }

Loading…
Cancel
Save