allow drag track label button for moving track (#3271)
* allow drag track label button for moving track * improve mouseclick * improve click 2
This commit is contained in:
committed by
GitHub
parent
349f27f819
commit
c5aa22663e
@@ -51,6 +51,7 @@ protected:
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
|
||||
|
||||
@@ -58,6 +59,7 @@ private:
|
||||
TrackView * m_trackView;
|
||||
QString m_iconName;
|
||||
QLineEdit * m_renameLineEdit;
|
||||
QRect m_buttonRect;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -146,7 +146,8 @@ void TrackLabelButton::mousePressEvent( QMouseEvent * _me )
|
||||
}
|
||||
else
|
||||
{
|
||||
QToolButton::mousePressEvent( _me );
|
||||
m_buttonRect = QRect( this->mapToGlobal( pos() ), size() );
|
||||
_me->ignore();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,6 +162,19 @@ void TrackLabelButton::mouseDoubleClickEvent( QMouseEvent * _me )
|
||||
|
||||
|
||||
|
||||
void TrackLabelButton::mouseReleaseEvent(QMouseEvent *_me)
|
||||
{
|
||||
if( m_buttonRect.contains( _me->globalPos(), true ) )
|
||||
{
|
||||
QToolButton::mousePressEvent( _me );
|
||||
}
|
||||
QToolButton::mouseReleaseEvent( _me );
|
||||
_me->ignore();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TrackLabelButton::paintEvent( QPaintEvent * _pe )
|
||||
{
|
||||
if( m_trackView->getTrack()->type() == Track::InstrumentTrack )
|
||||
|
||||
Reference in New Issue
Block a user