mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-01 16:19:43 +02:00
Improve positioning of dock-drop indicator
The triangle showing where in the dock a toolbar will drop now takes into account that overly tall toolbars will be resized to 2 tbs once they are docked.
This commit is contained in:
parent
9985b8a9b8
commit
b837d49b6b
@ -1249,9 +1249,16 @@ void ToolManager::OnMouse( wxMouseEvent & event )
|
||||
}
|
||||
else
|
||||
{
|
||||
// r is the rectangle of the toolbar being dragged.
|
||||
// A tall undocked toolbar will become at most 2 tbs
|
||||
// high when docked, so the triangular drop indicator
|
||||
// needs to use that height, h, not the bar height
|
||||
// for calculating where to be drawn.
|
||||
const int tbs = toolbarSingle + toolbarGap;
|
||||
int h = wxMin(r.GetHeight(), 2*tbs-1);
|
||||
p.x = dr.GetLeft() + r.GetLeft();
|
||||
p.y = dr.GetTop() + r.GetTop() +
|
||||
( ( r.GetHeight() - mLeft->GetBox().GetHeight() ) / 2 );
|
||||
( ( h - mLeft->GetBox().GetHeight() ) / 2 );
|
||||
mCurrent = mLeft.get();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user