mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-31 07:59:27 +02: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 2d56c8ec3286aa0a4a22e5be9148a2a1e01b8e17 better
This commit is contained in:
parent
e1cf056710
commit
2ee3ba5761
@ -1168,6 +1168,7 @@ void ToolManager::OnMouse( wxMouseEvent & event )
|
||||
// Button was released...finish the drag
|
||||
// Transition the bar to a dock
|
||||
if (!mDidDrag) {
|
||||
mPrevDock->RestoreConfiguration(mPrevConfiguration);
|
||||
DoneDragging();
|
||||
return;
|
||||
}
|
||||
@ -1197,8 +1198,11 @@ void ToolManager::OnMouse( wxMouseEvent & event )
|
||||
mDidDrag = true;
|
||||
wxPoint mp = event.GetPosition();
|
||||
mp = mParent->ClientToScreen(mp);
|
||||
if (!mDragWindow)
|
||||
if (!mDragWindow) {
|
||||
// We no longer have control
|
||||
mPrevDock->GetConfiguration().Remove( mDragBar );
|
||||
UndockBar(mp);
|
||||
}
|
||||
}
|
||||
|
||||
// Make toolbar follow the mouse
|
||||
@ -1398,10 +1402,6 @@ void ToolManager::OnIndicatorCreate( wxWindowCreateEvent & event )
|
||||
|
||||
void ToolManager::UndockBar( wxPoint mp )
|
||||
{
|
||||
mPrevDock->Undock(mDragBar);
|
||||
mPrevSlot = mPrevDock->GetConfiguration().Find(mDragBar);
|
||||
mPrevDock->GetConfiguration().Remove(mDragBar);
|
||||
|
||||
#if defined(__WXMAC__)
|
||||
// Disable window animation
|
||||
wxSystemOptions::SetOption( wxMAC_WINDOW_PLAIN_TRANSITION, 1 );
|
||||
@ -1448,6 +1448,8 @@ void ToolManager::OnGrabber( GrabberEvent & event )
|
||||
if (mDragBar->IsDocked()) {
|
||||
mPrevDock = dynamic_cast<ToolDock*>(mDragBar->GetParent());
|
||||
wxASSERT(mPrevDock);
|
||||
mPrevSlot = mPrevDock->GetConfiguration().Find(mDragBar);
|
||||
mPrevDock->WrapConfiguration(mPrevConfiguration);
|
||||
}
|
||||
else
|
||||
mPrevPosition = mDragBar->GetParent()->GetPosition();
|
||||
|
Loading…
x
Reference in New Issue
Block a user