mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 16:10:06 +02:00
Bug 2386 - Win/Linux: Toolbar grabber gets stuck pushed
This commit is contained in:
parent
3ecc5717ad
commit
182878caae
@ -1527,7 +1527,12 @@ void ToolManager::HandleEscapeKey()
|
||||
|
||||
void ToolManager::DoneDragging()
|
||||
{
|
||||
// Done dragging
|
||||
// Done dragging - ensure grabber button isn't pushed
|
||||
if( mDragBar )
|
||||
{
|
||||
mDragBar->SetDocked( NULL, false );
|
||||
}
|
||||
|
||||
// Release capture
|
||||
auto &window = GetProjectFrame( *mParent );
|
||||
if( window.HasCapture() )
|
||||
|
@ -44,6 +44,7 @@ BEGIN_EVENT_TABLE(Grabber, wxWindow)
|
||||
EVT_ENTER_WINDOW(Grabber::OnEnter)
|
||||
EVT_LEAVE_WINDOW(Grabber::OnLeave)
|
||||
EVT_LEFT_DOWN(Grabber::OnLeftDown)
|
||||
EVT_LEFT_UP(Grabber::OnLeftUp)
|
||||
EVT_ERASE_BACKGROUND( Grabber::OnErase )
|
||||
EVT_PAINT(Grabber::OnPaint)
|
||||
EVT_KEY_DOWN(Grabber::OnKeyDown)
|
||||
@ -188,6 +189,8 @@ void Grabber::PushButton(bool state )
|
||||
{
|
||||
if( mAsSpacer )
|
||||
return;
|
||||
if (!state)
|
||||
mPressed = state;
|
||||
wxRect r = GetRect();
|
||||
mOver = r.Contains(ScreenToClient(wxGetMousePosition()));
|
||||
|
||||
@ -210,6 +213,19 @@ void Grabber::OnLeftDown(wxMouseEvent & event)
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
//
|
||||
// Handle left button up events
|
||||
//
|
||||
void Grabber::OnLeftUp(wxMouseEvent & event)
|
||||
{
|
||||
// Normally, "left up" events are handled by the ToolManager::OnMouse() method
|
||||
// but, if the user double clicks a grabber, the "left up" event will come here
|
||||
// instead, so just "unpush" the button.
|
||||
PushButton(false);
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
//
|
||||
// Handle mouse enter events
|
||||
//
|
||||
|
@ -124,6 +124,7 @@ class Grabber final : public wxWindow
|
||||
protected:
|
||||
|
||||
void OnLeftDown(wxMouseEvent & event);
|
||||
void OnLeftUp(wxMouseEvent & event);
|
||||
void OnEnter(wxMouseEvent & event);
|
||||
void OnLeave(wxMouseEvent & event);
|
||||
void OnErase(wxEraseEvent & event);
|
||||
|
Loading…
x
Reference in New Issue
Block a user