mirror of
https://github.com/colhountech/DarkUI.Net5.git
synced 2025-07-05 00:19:27 +03:00
Fixed checks for dropping before/after groups.
This commit is contained in:
parent
7cd946b372
commit
928511e44a
@ -116,7 +116,7 @@ namespace DarkUI.Win32
|
|||||||
_groupDropAreas.Add(group, collection);
|
_groupDropAreas.Add(group, collection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If the region is NOT visible then build drop areas for the region itself.
|
// If the region is NOT visible then build the drop area for the region itself.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var area = new DockDropArea(_dockPanel, region);
|
var area = new DockDropArea(_dockPanel, region);
|
||||||
@ -184,23 +184,22 @@ namespace DarkUI.Win32
|
|||||||
var groupHasOtherContent = false;
|
var groupHasOtherContent = false;
|
||||||
|
|
||||||
if (collection.DropArea.DockGroup == _dragContent.DockGroup)
|
if (collection.DropArea.DockGroup == _dragContent.DockGroup)
|
||||||
{
|
|
||||||
sameGroup = true;
|
sameGroup = true;
|
||||||
|
|
||||||
if (collection.DropArea.DockGroup.ContentCount > 1)
|
|
||||||
groupHasOtherContent = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (collection.DropArea.DockGroup.DockRegion == _dragContent.DockRegion)
|
if (collection.DropArea.DockGroup.DockRegion == _dragContent.DockRegion)
|
||||||
{
|
|
||||||
sameRegion = true;
|
sameRegion = true;
|
||||||
}
|
|
||||||
|
|
||||||
|
if (_dragContent.DockGroup.ContentCount > 1)
|
||||||
|
groupHasOtherContent = true;
|
||||||
|
|
||||||
|
// If we're hovering over the group itself, only allow inserting before/after if multiple content is tabbed.
|
||||||
if (!sameGroup || groupHasOtherContent)
|
if (!sameGroup || groupHasOtherContent)
|
||||||
{
|
{
|
||||||
var skipBefore = false;
|
var skipBefore = false;
|
||||||
var skipAfter = false;
|
var skipAfter = false;
|
||||||
|
|
||||||
|
// Inserting before/after other content might cause the content to be dropped on to its own location.
|
||||||
|
// Check if the group above/below the hovered group contains our drag content.
|
||||||
if (sameRegion && !groupHasOtherContent)
|
if (sameRegion && !groupHasOtherContent)
|
||||||
{
|
{
|
||||||
if (collection.InsertBeforeArea.DockGroup.Order == _dragContent.DockGroup.Order + 1)
|
if (collection.InsertBeforeArea.DockGroup.Order == _dragContent.DockGroup.Order + 1)
|
||||||
@ -233,6 +232,7 @@ namespace DarkUI.Win32
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't allow content to be dragged on to itself
|
||||||
if (!sameGroup)
|
if (!sameGroup)
|
||||||
{
|
{
|
||||||
if (collection.DropArea.DropArea.Contains(location))
|
if (collection.DropArea.DropArea.Contains(location))
|
||||||
|
3
todo.txt
3
todo.txt
@ -27,4 +27,5 @@ Dock panel
|
|||||||
-- stop dragging tabs instantly going to the end of the row
|
-- stop dragging tabs instantly going to the end of the row
|
||||||
-- stop differently sized toolwindow tabs from vibrating when dragging
|
-- stop differently sized toolwindow tabs from vibrating when dragging
|
||||||
-- remove 1 pixel left padding from bottom region
|
-- remove 1 pixel left padding from bottom region
|
||||||
-- add 1 pixel border between groups in bottom region
|
-- add 1 pixel border between groups in bottom region
|
||||||
|
-- allow dragging above/below adjacent groups if multiple content exists within group
|
Loading…
x
Reference in New Issue
Block a user