mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-06 23:29:24 +02:00
Much easier to dock with an empty dock now.
Overlapping a dock is now enough to trigger docking. Previously the top left corner had to be in the dock.
This commit is contained in:
parent
a0ff55faa9
commit
799230b882
@ -115,6 +115,11 @@ void ToolDock::Undock( ToolBar *bar )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ToolDock::GetBarCount()
|
||||||
|
{
|
||||||
|
return mDockedBars.GetCount();
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Handle ToolDock events
|
// Handle ToolDock events
|
||||||
//
|
//
|
||||||
|
@ -54,17 +54,12 @@ class ToolDock:public wxPanel
|
|||||||
~ToolDock();
|
~ToolDock();
|
||||||
|
|
||||||
void LayoutToolBars();
|
void LayoutToolBars();
|
||||||
|
|
||||||
void ShowHide( int type );
|
void ShowHide( int type );
|
||||||
|
|
||||||
void Expose( int type, bool show );
|
void Expose( int type, bool show );
|
||||||
|
|
||||||
int GetOrder( ToolBar *bar );
|
int GetOrder( ToolBar *bar );
|
||||||
|
int GetBarCount();
|
||||||
void Dock( ToolBar *bar, int ndx = -1 );
|
void Dock( ToolBar *bar, int ndx = -1 );
|
||||||
|
|
||||||
void Undock( ToolBar *bar );
|
void Undock( ToolBar *bar );
|
||||||
|
|
||||||
int PositionBar( ToolBar *t, wxPoint & pos, wxRect & rect );
|
int PositionBar( ToolBar *t, wxPoint & pos, wxRect & rect );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -1033,16 +1033,15 @@ void ToolManager::OnMouse( wxMouseEvent & event )
|
|||||||
// lands back where we started.
|
// lands back where we started.
|
||||||
pos += wxPoint( 5, 20 );
|
pos += wxPoint( 5, 20 );
|
||||||
|
|
||||||
// Is mouse pointer within either dock?
|
|
||||||
|
// To find which dock, rather than test against pos, test against the whole dragger rect.
|
||||||
|
// This means it is enough to overlap the dock to dock with it.
|
||||||
|
wxRect barRect = mDragWindow->GetRect();
|
||||||
ToolDock *dock = NULL;
|
ToolDock *dock = NULL;
|
||||||
if( tr.Contains( pos ) )
|
if( tr.Intersects( barRect ) )
|
||||||
{
|
|
||||||
dock = mTopDock;
|
dock = mTopDock;
|
||||||
}
|
else if( br.Intersects( barRect ) )
|
||||||
else if( br.Contains( pos ) )
|
|
||||||
{
|
|
||||||
dock = mBotDock;
|
dock = mBotDock;
|
||||||
}
|
|
||||||
|
|
||||||
// Looks like we have a winner...
|
// Looks like we have a winner...
|
||||||
if( dock )
|
if( dock )
|
||||||
@ -1050,7 +1049,6 @@ void ToolManager::OnMouse( wxMouseEvent & event )
|
|||||||
wxPoint p;
|
wxPoint p;
|
||||||
wxRect r;
|
wxRect r;
|
||||||
|
|
||||||
|
|
||||||
// Calculate where the bar would be placed
|
// Calculate where the bar would be placed
|
||||||
mDragBefore = dock->PositionBar( mDragBar, pos, r );
|
mDragBefore = dock->PositionBar( mDragBar, pos, r );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user