The docking logic in the top and right docking areas
was reversed. There is still an off-by-1 error that makes the toolbar jump in the bottom dock, not in the top dock. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40886 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2337,7 +2337,12 @@ bool wxFrameManager::DoDrop(wxDockInfoArray& docks,
|
|||||||
else if (pt.y >= cli_size.y - layer_insert_offset &&
|
else if (pt.y >= cli_size.y - layer_insert_offset &&
|
||||||
pt.y < cli_size.y - layer_insert_offset + auiLayerInsertPixels)
|
pt.y < cli_size.y - layer_insert_offset + auiLayerInsertPixels)
|
||||||
{
|
{
|
||||||
|
int new_layer = wxMax( wxMax( GetMaxLayer(docks, wxAUI_DOCK_BOTTOM),
|
||||||
|
GetMaxLayer(docks, wxAUI_DOCK_LEFT)),
|
||||||
|
GetMaxLayer(docks, wxAUI_DOCK_RIGHT)) + 1;
|
||||||
|
|
||||||
drop.Dock().Bottom().
|
drop.Dock().Bottom().
|
||||||
|
Layer(new_layer).
|
||||||
Row(0).
|
Row(0).
|
||||||
Position(pt.x - GetDockPixelOffset(drop) - offset.x);
|
Position(pt.x - GetDockPixelOffset(drop) - offset.x);
|
||||||
return ProcessDockResult(target, drop);
|
return ProcessDockResult(target, drop);
|
||||||
@@ -2409,6 +2414,9 @@ bool wxFrameManager::DoDrop(wxDockInfoArray& docks,
|
|||||||
((pt.y < part->dock->rect.y + 2) && part->dock->IsHorizontal()) ||
|
((pt.y < part->dock->rect.y + 2) && part->dock->IsHorizontal()) ||
|
||||||
((pt.x < part->dock->rect.x + 2) && part->dock->IsVertical())
|
((pt.x < part->dock->rect.x + 2) && part->dock->IsVertical())
|
||||||
) && part->dock->panes.GetCount() > 1)
|
) && part->dock->panes.GetCount() > 1)
|
||||||
|
{
|
||||||
|
if ((part->dock->dock_direction == wxAUI_DOCK_TOP) ||
|
||||||
|
(part->dock->dock_direction == wxAUI_DOCK_LEFT))
|
||||||
{
|
{
|
||||||
int row = drop.dock_row;
|
int row = drop.dock_row;
|
||||||
DoInsertDockRow(panes, part->dock->dock_direction,
|
DoInsertDockRow(panes, part->dock->dock_direction,
|
||||||
@@ -2416,17 +2424,37 @@ bool wxFrameManager::DoDrop(wxDockInfoArray& docks,
|
|||||||
part->dock->dock_row);
|
part->dock->dock_row);
|
||||||
drop.dock_row = row;
|
drop.dock_row = row;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DoInsertDockRow(panes, part->dock->dock_direction,
|
||||||
|
part->dock->dock_layer,
|
||||||
|
part->dock->dock_row+1);
|
||||||
|
drop.dock_row = part->dock->dock_row+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((
|
if ((
|
||||||
((pt.y > part->dock->rect.y + part->dock->rect.height - 2 ) && part->dock->IsHorizontal()) ||
|
((pt.y > part->dock->rect.y + part->dock->rect.height - 2 ) && part->dock->IsHorizontal()) ||
|
||||||
((pt.x > part->dock->rect.x + part->dock->rect.width - 2 ) && part->dock->IsVertical())
|
((pt.x > part->dock->rect.x + part->dock->rect.width - 2 ) && part->dock->IsVertical())
|
||||||
) && part->dock->panes.GetCount() > 1)
|
) && part->dock->panes.GetCount() > 1)
|
||||||
|
{
|
||||||
|
if ((part->dock->dock_direction == wxAUI_DOCK_TOP) ||
|
||||||
|
(part->dock->dock_direction == wxAUI_DOCK_LEFT))
|
||||||
{
|
{
|
||||||
DoInsertDockRow(panes, part->dock->dock_direction,
|
DoInsertDockRow(panes, part->dock->dock_direction,
|
||||||
part->dock->dock_layer,
|
part->dock->dock_layer,
|
||||||
part->dock->dock_row+1);
|
part->dock->dock_row+1);
|
||||||
drop.dock_row = part->dock->dock_row+1;
|
drop.dock_row = part->dock->dock_row+1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int row = drop.dock_row;
|
||||||
|
DoInsertDockRow(panes, part->dock->dock_direction,
|
||||||
|
part->dock->dock_layer,
|
||||||
|
part->dock->dock_row);
|
||||||
|
drop.dock_row = row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ProcessDockResult(target, drop);
|
return ProcessDockResult(target, drop);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user