Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix hanging mouse in piano roll (#4822) #4960

Merged
merged 3 commits into from
May 6, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/gui/TimeLineWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ TimeLineWidget::TimeLineWidget( const int xoff, const int yoff, const float ppt,

m_xOffset -= s_posMarkerPixmap->width() / 2;

setMouseTracking(true);
m_pos.m_timeLine = this;

QTimer * updateTimer = new QTimer( this );
Expand Down Expand Up @@ -365,6 +366,7 @@ void TimeLineWidget::mousePressEvent( QMouseEvent* event )

void TimeLineWidget::mouseMoveEvent( QMouseEvent* event )
{
parentWidget()->update(); // essential for widgets that this timeline had taken their mouse move event from.
const MidiTime t = m_begin + static_cast<int>( qMax( event->x() - m_xOffset - m_moveXOff, 0 ) * MidiTime::ticksPerTact() / m_ppt );

switch( m_action )
Expand Down
10 changes: 7 additions & 3 deletions src/gui/editors/AutomationEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,8 @@ void AutomationEditor::leaveEvent(QEvent * e )
{
QApplication::restoreOverrideCursor();
}

QWidget::leaveEvent( e );
update();
}


Expand Down Expand Up @@ -1510,8 +1510,12 @@ void AutomationEditor::paintEvent(QPaintEvent * pe )
case SELECT: cursor = s_toolSelect; break;
case MOVE: cursor = s_toolMove; break;
}
p.drawPixmap( mapFromGlobal( QCursor::pos() ) + QPoint( 8, 8 ),
*cursor );
// TODO RON copy all if, replace the top left etc
QPoint mousePosition = mapFromGlobal( QCursor::pos() );
if( cursor != NULL && mousePosition.y() > TOP_MARGIN + SCROLLBAR_SIZE)
{
p.drawPixmap( mousePosition + QPoint( 8, 8 ), *cursor );
}
}


Expand Down
7 changes: 4 additions & 3 deletions src/gui/editors/PianoRoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,7 @@ void PianoRoll::leaveEvent(QEvent * e )

QWidget::leaveEvent( e );
s_textFloat->hide();
update(); // cleaning inner mouse-related graphics
}


Expand Down Expand Up @@ -3160,10 +3161,10 @@ void PianoRoll::paintEvent(QPaintEvent * pe )
case ModeSelect: cursor = s_toolSelect; break;
case ModeEditDetuning: cursor = s_toolOpen; break;
}
if( cursor != NULL )
QPoint mousePosition = mapFromGlobal( QCursor::pos() );
if( cursor != NULL && mousePosition.y() > keyAreaTop() && mousePosition.x() > noteEditLeft())
{
p.drawPixmap( mapFromGlobal( QCursor::pos() ) + QPoint( 8, 8 ),
*cursor );
p.drawPixmap( mousePosition + QPoint( 8, 8 ), *cursor );
}
}

Expand Down