This might help you: https://github.com/LMMS/lmms/commit/cdc ... 9ef59abf1f
Check out src/core/track.cpp. You just want to manually undo the changes shown, re-adding deleted lines and deleting added lines.
Code: Select all
/*! \brief Handle a mouse press on this trackContentObjectView.
*
* Handles the various ways in which a trackContentObjectView can be
* used with a click of a mouse button.
*
* * If our container supports rubber band selection then handle
* selection events.
* * or if shift-left button, add this object to the selection
* * or if ctrl-left button, start a drag-copy event
* * or if just plain left button, resize if we're resizeable
* * or if ctrl-middle button, mute the track content object
* * or if middle button, maybe delete the track content object.
*
* \param me The QMouseEvent to handle.
*/
void TrackContentObjectView::mousePressEvent( QMouseEvent * me )
{
setInitialMousePos( me->pos() );
if( m_trackView->trackContainerView()->allowRubberband() == true &&
me->button() == Qt::LeftButton )
{
if( m_trackView->trackContainerView()->rubberBandActive() == true )
{
// Propagate to trackView for rubberbanding
selectableObject::mousePressEvent( me );
}
else if ( me->modifiers() & Qt::ControlModifier )
{
if( isSelected() == true )
{
m_action = CopySelection;
}
else
{
m_action = ToggleSelected;
}
}
else if( !me->modifiers() )
{
if( isSelected() == true )
{
m_action = MoveSelection;
}
}
}
else if( me->button() == Qt::LeftButton &&
me->modifiers() & Qt::ControlModifier )
{
// start drag-action
QVector<TrackContentObjectView *> tcoViews;
tcoViews.push_back( this );
DataFile dataFile = createTCODataFiles( tcoViews );
QPixmap thumbnail = QPixmap::grabWidget( this ).scaled(
128, 128,
Qt::KeepAspectRatio,
Qt::SmoothTransformation );
new StringPairDrag( QString( "tco_%1" ).arg(
m_tco->getTrack()->type() ),
dataFile.toString(), thumbnail, this );
}
else if( me->button() == Qt::LeftButton &&
/* (me->modifiers() & Qt::ShiftModifier) &&*/
fixedTCOs() == false )
{
m_tco->addJournalCheckPoint();
// move or resize
m_tco->setJournalling( false );
setInitialMousePos( me->pos() );
if( m_tco->getAutoResize() || me->x() < width() - RESIZE_GRIP_WIDTH )
{
m_action = Move;
setCursor( Qt::SizeAllCursor );
delete m_hint;
m_hint = TextFloat::displayMessage( tr( "Hint" ),
tr( "Press <%1> and drag to make "
"a copy." ).arg(
#ifdef LMMS_BUILD_APPLE
"⌘"),
#else
"Ctrl"),
#endif
embed::getIconPixmap( "hint" ), 0 );
s_textFloat->setTitle( tr( "Current position" ) );
s_textFloat->setText( QString( "%1:%2" ).
arg( m_tco->startPosition().getTact() + 1 ).
arg( m_tco->startPosition().getTicks() %
MidiTime::ticksPerTact() ) );
s_textFloat->moveGlobal( this, QPoint( width() + 2, height() + 2 ) );
}
else
{
m_action = Resize;
setCursor( Qt::SizeHorCursor );
delete m_hint;
m_hint = TextFloat::displayMessage( tr( "Hint" ),
tr( "Press <%1> for free "
"resizing." ).arg(
#ifdef LMMS_BUILD_APPLE
"⌘"),
#else
"Ctrl"),
#endif
embed::getIconPixmap( "hint" ), 0 );
s_textFloat->setTitle( tr( "Current length" ) );
s_textFloat->setText( tr( "%1:%2 (%3:%4 to %5:%6)" ).
arg( m_tco->length().getTact() ).
arg( m_tco->length().getTicks() %
MidiTime::ticksPerTact() ).
arg( m_tco->startPosition().getTact() + 1 ).
arg( m_tco->startPosition().getTicks() %
MidiTime::ticksPerTact() ).
arg( m_tco->endPosition().getTact() + 1 ).
arg( m_tco->endPosition().getTicks() %
MidiTime::ticksPerTact() ) );
s_textFloat->moveGlobal( this, QPoint( width() + 2, height() + 2) );
}
// s_textFloat->reparent( this );
s_textFloat->show();
}
else if( me->button() == Qt::RightButton )
{
if( me->modifiers() & Qt::ControlModifier )
{
m_tco->toggleMute();
}
else if( me->modifiers() & Qt::ShiftModifier && fixedTCOs() == false )
{
remove();
}
}
else if( me->button() == Qt::MidButton )
{
if( me->modifiers() & Qt::ControlModifier )
{
m_tco->toggleMute();
}
else if( fixedTCOs() == false )
{
remove();
}
}
}
(Made your text to code -use the </> button for code tags).Xeno Idaltu wrote: ↑Thu Apr 07, 2022 8:27 amI think I might have to copy/paste this entire section:
But cant you see the inconvenience, as Monospace said:
middle click isn't available to laptop users