Track operations fixes and other stuff. (#3878)

This commit is contained in:
Hussam Eddin Alhomsi
2017-11-15 07:30:17 +03:00
committed by Tres Finocchiaro
parent 77b4985a2d
commit 6f305a6308
6 changed files with 22 additions and 27 deletions

View File

@@ -1702,12 +1702,6 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * parent ) :
QWidget( parent ), /*!< The parent widget */
m_trackView( parent ) /*!< The parent track view */
{
if( s_grip == NULL )
{
s_grip = new QPixmap( embed::getIconPixmap(
"track_op_grip" ) );
}
ToolTip::add( this, tr( "Press <%1> while clicking on move-grip "
"to begin a new drag'n'drop-action." ).arg(
#ifdef LMMS_BUILD_APPLE
@@ -1830,14 +1824,17 @@ void TrackOperationsWidget::paintEvent( QPaintEvent * pe )
if( m_trackView->isMovingTrack() == false )
{
s_grip = new QPixmap( embed::getIconPixmap(
"track_op_grip" ) );
p.drawPixmap( 2, 2, *s_grip );
m_trackOps->show();
m_muteBtn->show();
}
else
{
m_trackOps->hide();
m_muteBtn->hide();
s_grip = new QPixmap( embed::getIconPixmap(
"track_op_grip_c" ) );
p.drawPixmap( 2, 2, *s_grip );
}
}
@@ -2748,6 +2745,12 @@ void TrackView::dropEvent( QDropEvent * de )
*/
void TrackView::mousePressEvent( QMouseEvent * me )
{
if( me->x()>10 ) // 10 = The width of the grip + 2 pixels to the left and right.
{
QWidget::mousePressEvent( me );
return;
}
// If previously dragged too small, restore on shift-leftclick
if( height() < DEFAULT_TRACK_HEIGHT &&
me->modifiers() & Qt::ShiftModifier &&
@@ -2780,7 +2783,7 @@ void TrackView::mousePressEvent( QMouseEvent * me )
{
m_action = MoveTrack;
QCursor c( Qt::SizeAllCursor );
QCursor c( Qt::SizeVerCursor );
QApplication::setOverrideCursor( c );
// update because in move-mode, all elements in
// track-op-widgets are hidden as a visual feedback