Skip to content

Commit

Permalink
Implemented the changes suggested by @ldn4711.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextm committed Apr 4, 2013
1 parent 8303c2b commit 2d626d1
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions WinFormsUI/Docking/DockPanel.AutoHideWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -477,31 +477,31 @@ void ISplitterDragSource.MoveSplitter(int offset)
IDockContent content = ActiveContent;
if (DockState == DockState.DockLeftAutoHide && rectDockArea.Width > 0)
{
if (content.DockHandler.AutoHidePortion < 1)
content.DockHandler.AutoHidePortion += ((double)offset) / (double)rectDockArea.Width;
if (content.DockHandler.DockPanel.DockLeftPortion < 1)
content.DockHandler.DockPanel.DockLeftPortion += ((double)offset) / (double)rectDockArea.Width;
else
content.DockHandler.AutoHidePortion = Width + offset;
content.DockHandler.DockPanel.DockLeftPortion = Width + offset;
}
else if (DockState == DockState.DockRightAutoHide && rectDockArea.Width > 0)
{
if (content.DockHandler.AutoHidePortion < 1)
content.DockHandler.AutoHidePortion -= ((double)offset) / (double)rectDockArea.Width;
if (content.DockHandler.DockPanel.DockRightPortion < 1)
content.DockHandler.DockPanel.DockRightPortion -= ((double)offset) / (double)rectDockArea.Width;
else
content.DockHandler.AutoHidePortion = Width - offset;
content.DockHandler.DockPanel.DockRightPortion = Width - offset;
}
else if (DockState == DockState.DockBottomAutoHide && rectDockArea.Height > 0)
{
if (content.DockHandler.AutoHidePortion < 1)
content.DockHandler.AutoHidePortion -= ((double)offset) / (double)rectDockArea.Height;
if (content.DockHandler.DockPanel.DockTopPortion < 1)
content.DockHandler.DockPanel.DockTopPortion -= ((double)offset) / (double)rectDockArea.Height;
else
content.DockHandler.AutoHidePortion = Height - offset;
content.DockHandler.DockPanel.DockTopPortion = Height - offset;
}
else if (DockState == DockState.DockTopAutoHide && rectDockArea.Height > 0)
{
if (content.DockHandler.AutoHidePortion < 1)
content.DockHandler.AutoHidePortion += ((double)offset) / (double)rectDockArea.Height;
if (content.DockHandler.DockPanel.DockBottomPortion < 1)
content.DockHandler.DockPanel.DockBottomPortion += ((double)offset) / (double)rectDockArea.Height;
else
content.DockHandler.AutoHidePortion = Height + offset;
content.DockHandler.DockPanel.DockBottomPortion = Height + offset;
}
}

Expand Down Expand Up @@ -548,6 +548,7 @@ internal Rectangle AutoHideWindowRectangle
double autoHideSize = ActiveAutoHideContent.DockHandler.AutoHidePortion;
if (state == DockState.DockLeftAutoHide)
{
autoHideSize = DockLeftPortion;
if (autoHideSize < 1)
autoHideSize = rectDockArea.Width * autoHideSize;
if (autoHideSize > rectDockArea.Width - MeasurePane.MinSize)
Expand All @@ -559,6 +560,7 @@ internal Rectangle AutoHideWindowRectangle
}
else if (state == DockState.DockRightAutoHide)
{
autoHideSize = DockRightPortion;
if (autoHideSize < 1)
autoHideSize = rectDockArea.Width * autoHideSize;
if (autoHideSize > rectDockArea.Width - MeasurePane.MinSize)
Expand All @@ -570,6 +572,7 @@ internal Rectangle AutoHideWindowRectangle
}
else if (state == DockState.DockTopAutoHide)
{
autoHideSize = DockTopPortion;
if (autoHideSize < 1)
autoHideSize = rectDockArea.Height * autoHideSize;
if (autoHideSize > rectDockArea.Height - MeasurePane.MinSize)
Expand All @@ -581,6 +584,7 @@ internal Rectangle AutoHideWindowRectangle
}
else if (state == DockState.DockBottomAutoHide)
{
autoHideSize = DockBottomPortion;
if (autoHideSize < 1)
autoHideSize = rectDockArea.Height * autoHideSize;
if (autoHideSize > rectDockArea.Height - MeasurePane.MinSize)
Expand Down

0 comments on commit 2d626d1

Please sign in to comment.