mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-02 07:03:50 +01:00
Bug1828: ESC from dragging of a docked toolbar...
... Now restores state again properly and does not cause undocking of other
bars when you restart.
Redoes commit 2d56c8ec32 better
This commit is contained in:
@@ -1168,6 +1168,7 @@ void ToolManager::OnMouse( wxMouseEvent & event )
|
|||||||
// Button was released...finish the drag
|
// Button was released...finish the drag
|
||||||
// Transition the bar to a dock
|
// Transition the bar to a dock
|
||||||
if (!mDidDrag) {
|
if (!mDidDrag) {
|
||||||
|
mPrevDock->RestoreConfiguration(mPrevConfiguration);
|
||||||
DoneDragging();
|
DoneDragging();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1197,8 +1198,11 @@ void ToolManager::OnMouse( wxMouseEvent & event )
|
|||||||
mDidDrag = true;
|
mDidDrag = true;
|
||||||
wxPoint mp = event.GetPosition();
|
wxPoint mp = event.GetPosition();
|
||||||
mp = mParent->ClientToScreen(mp);
|
mp = mParent->ClientToScreen(mp);
|
||||||
if (!mDragWindow)
|
if (!mDragWindow) {
|
||||||
|
// We no longer have control
|
||||||
|
mPrevDock->GetConfiguration().Remove( mDragBar );
|
||||||
UndockBar(mp);
|
UndockBar(mp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make toolbar follow the mouse
|
// Make toolbar follow the mouse
|
||||||
@@ -1398,10 +1402,6 @@ void ToolManager::OnIndicatorCreate( wxWindowCreateEvent & event )
|
|||||||
|
|
||||||
void ToolManager::UndockBar( wxPoint mp )
|
void ToolManager::UndockBar( wxPoint mp )
|
||||||
{
|
{
|
||||||
mPrevDock->Undock(mDragBar);
|
|
||||||
mPrevSlot = mPrevDock->GetConfiguration().Find(mDragBar);
|
|
||||||
mPrevDock->GetConfiguration().Remove(mDragBar);
|
|
||||||
|
|
||||||
#if defined(__WXMAC__)
|
#if defined(__WXMAC__)
|
||||||
// Disable window animation
|
// Disable window animation
|
||||||
wxSystemOptions::SetOption( wxMAC_WINDOW_PLAIN_TRANSITION, 1 );
|
wxSystemOptions::SetOption( wxMAC_WINDOW_PLAIN_TRANSITION, 1 );
|
||||||
@@ -1448,6 +1448,8 @@ void ToolManager::OnGrabber( GrabberEvent & event )
|
|||||||
if (mDragBar->IsDocked()) {
|
if (mDragBar->IsDocked()) {
|
||||||
mPrevDock = dynamic_cast<ToolDock*>(mDragBar->GetParent());
|
mPrevDock = dynamic_cast<ToolDock*>(mDragBar->GetParent());
|
||||||
wxASSERT(mPrevDock);
|
wxASSERT(mPrevDock);
|
||||||
|
mPrevSlot = mPrevDock->GetConfiguration().Find(mDragBar);
|
||||||
|
mPrevDock->WrapConfiguration(mPrevConfiguration);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mPrevPosition = mDragBar->GetParent()->GetPosition();
|
mPrevPosition = mDragBar->GetParent()->GetPosition();
|
||||||
|
|||||||
Reference in New Issue
Block a user