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 @@ -18,9 +18,14 @@ namespace ICSharpCode.ILSpy.Docking
}
parentDocumentGroup.Orientation = System.Windows.Controls.Orientation.Vertical;
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.Root.CollectGarbage();
Application.Current.MainWindow.Dispatcher.Invoke(() => {
layoutDocumentPane.DockHeight = dockHeight;
}, System.Windows.Threading.DispatcherPriority.Loaded);
}
}
}

4
ILSpy/MainWindow.xaml

@ -126,7 +126,7 @@ @@ -126,7 +126,7 @@
<avalondock:LayoutPanel Orientation="Horizontal">
<avalondock:LayoutAnchorablePaneGroup DockWidth="200" Orientation="Vertical">
<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 -->
<tv:SharpTreeView
Name="treeView"
@ -142,7 +142,7 @@ @@ -142,7 +142,7 @@
<avalondock:LayoutDocumentPaneGroup DockWidth="*">
<avalondock:LayoutDocumentPane x:Name="adDocumentPane">
<avalondock:LayoutDocument Title="Decompilation">
<avalondock:LayoutDocument Title="MAIN" CanClose="False">
<!-- decompilerTextView is into the mainPane by code -->
<ContentPresenter Name="mainPane" />
</avalondock:LayoutDocument>

6
ILSpy/MainWindow.xaml.cs

@ -1054,13 +1054,13 @@ namespace ICSharpCode.ILSpy @@ -1054,13 +1054,13 @@ namespace ICSharpCode.ILSpy
public void ShowInNewPane(string title, object content, PanePosition panePosition, string toolTip = null)
{
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();
documentPane.Children.Add(layoutDocument);
} 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();
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