mirror of
https://github.com/xenia-project/dockpanelsuite.git
synced 2026-01-31 01:25:23 +01:00
Fixed #161.
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsUI", "WinFormsUI\WinFormsUI.csproj", "{C75532C4-765B-418E-B09B-46D36B2ABDB1}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DockSample", "DockSample\DockSample.csproj", "{40793A27-478B-4357-B4C3-FC8943131F3D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsFormsApplication1", "WindowsFormsApplication1\WindowsFormsApplication1.csproj", "{78043484-848E-49D9-A421-884541F3401A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -18,6 +22,10 @@ Global
|
||||
{40793A27-478B-4357-B4C3-FC8943131F3D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{40793A27-478B-4357-B4C3-FC8943131F3D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{40793A27-478B-4357-B4C3-FC8943131F3D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{78043484-848E-49D9-A421-884541F3401A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{78043484-848E-49D9-A421-884541F3401A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{78043484-848E-49D9-A421-884541F3401A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{78043484-848E-49D9-A421-884541F3401A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1227,7 +1227,7 @@ namespace WeifenLuo.WinFormsUI.Docking
|
||||
protected override void OnMouseClick(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseClick(e);
|
||||
if (e.Button != MouseButtons.Left)
|
||||
if (e.Button != MouseButtons.Left || Appearance != DockPane.AppearanceStyle.Document)
|
||||
return;
|
||||
|
||||
var indexHit = HitTest();
|
||||
@@ -1241,16 +1241,20 @@ namespace WeifenLuo.WinFormsUI.Docking
|
||||
var tabRect = GetTabRectangle(index);
|
||||
var closeButtonRect = GetCloseButtonRect(tabRect);
|
||||
var mouseRect = new Rectangle(mousePos, new Size(1, 1));
|
||||
|
||||
if (closeButtonRect.IntersectsWith(mouseRect))
|
||||
DockPane.CloseActiveContent();
|
||||
}
|
||||
|
||||
private Rectangle GetCloseButtonRect(Rectangle rectTab)
|
||||
{
|
||||
const int gap = 5;
|
||||
var dimension = rectTab.Height - gap;
|
||||
return new Rectangle(rectTab.X + rectTab.Width - dimension - gap / 2 - 1, rectTab.Y + gap / 2 + 1, dimension, dimension);
|
||||
if (Appearance != Docking.DockPane.AppearanceStyle.Document)
|
||||
{
|
||||
return Rectangle.Empty;
|
||||
}
|
||||
|
||||
const int gap = 3;
|
||||
const int imageSize = 15;
|
||||
return new Rectangle(rectTab.X + rectTab.Width - imageSize - gap - 1, rectTab.Y + gap, imageSize, imageSize);
|
||||
}
|
||||
|
||||
private void WindowList_Click(object sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user