-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix song-editor regressions and BB-editor bugs introduced in #3487 #4008
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -720,16 +720,25 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * me ) | |
| m_action = ToggleSelected; | ||
| } | ||
| } | ||
| else if( !me->modifiers() ) | ||
| else | ||
|
||
| { | ||
| if( isSelected() ) | ||
| { | ||
| m_action = MoveSelection; | ||
| } | ||
| else | ||
| { | ||
| gui->songEditor()->m_editor->selectAllTcos( false ); | ||
| m_tco->addJournalCheckPoint(); | ||
|
|
||
| // move or resize | ||
| m_tco->setJournalling( false ); | ||
|
|
||
| setInitialMousePos( me->pos() ); | ||
|
|
||
| SampleTCO * sTco = dynamic_cast<SampleTCO*>( m_tco ); | ||
| if( me->x() < RESIZE_GRIP_WIDTH && sTco ) | ||
| if( me->x() < RESIZE_GRIP_WIDTH && sTco | ||
| && !m_tco->getAutoResize() ) | ||
| { | ||
| m_action = ResizeLeft; | ||
| m_oldTime = m_tco->startPosition(); | ||
|
|
@@ -753,25 +762,24 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * me ) | |
| QApplication::setOverrideCursor( c ); | ||
| s_textFloat->setTitle( tr( "Current length" ) ); | ||
| } | ||
| // s_textFloat->reparent( this ); | ||
| // setup text-float as if TCO was already moved/resized | ||
| mouseMoveEvent( me ); | ||
| s_textFloat->show(); | ||
| } | ||
|
|
||
| delete m_hint; | ||
| QString hint = m_action == Move || m_action == MoveSelection | ||
| ? tr( "Press <%1> and drag to make a copy." ) | ||
| : tr( "Press <%1> for free resizing." ); | ||
| m_hint = TextFloat::displayMessage( tr( "Hint" ), hint.arg( | ||
| #ifdef LMMS_BUILD_APPLE | ||
| "⌘"), | ||
| #else | ||
| "Ctrl"), | ||
| #endif | ||
| embed::getIconPixmap( "hint" ), 0 ); | ||
| } | ||
| delete m_hint; | ||
| QString hint = m_action == Move ? tr( "Press <%1> and drag to make " | ||
| "a copy." ) | ||
| : tr( "Press <%1> for free " | ||
| "resizing." ); | ||
| m_hint = TextFloat::displayMessage( tr( "Hint" ), | ||
| hint.arg( | ||
| #ifdef LMMS_BUILD_APPLE | ||
| "⌘"), | ||
| #else | ||
| "Ctrl"), | ||
| #endif | ||
| embed::getIconPixmap( "hint" ), 0 ); | ||
| // s_textFloat->reparent( this ); | ||
| // setup text-float as if TCO was already moved/resized | ||
| mouseMoveEvent( me ); | ||
| s_textFloat->show(); | ||
| } | ||
| else if( me->button() == Qt::RightButton ) | ||
| { | ||
|
|
@@ -815,28 +823,34 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * me ) | |
| */ | ||
| void TrackContentObjectView::mouseMoveEvent( QMouseEvent * me ) | ||
| { | ||
| if( m_action == CopySelection ) | ||
| if( m_action == CopySelection || m_action == ToggleSelected ) | ||
| { | ||
| if( mouseMovedDistance( me, 2 ) == true ) | ||
| { | ||
| // Clear the action here because mouseReleaseEvent will not get | ||
| // triggered once we go into drag. | ||
| m_action = NoAction; | ||
|
|
||
| // Collect all selected TCOs | ||
| QVector<TrackContentObjectView *> tcoViews; | ||
| QVector<selectableObject *> so = | ||
| m_trackView->trackContainerView()->selectedObjects(); | ||
| for( QVector<selectableObject *>::iterator it = so.begin(); | ||
| it != so.end(); ++it ) | ||
| if( m_action == CopySelection ) | ||
| { | ||
| TrackContentObjectView * tcov = | ||
| dynamic_cast<TrackContentObjectView *>( *it ); | ||
| if( tcov != NULL ) | ||
| // Collect all selected TCOs | ||
| QVector<selectableObject *> so = | ||
| m_trackView->trackContainerView()->selectedObjects(); | ||
| for( auto it = so.begin(); it != so.end(); ++it ) | ||
| { | ||
| tcoViews.push_back( tcov ); | ||
| TrackContentObjectView * tcov = | ||
| dynamic_cast<TrackContentObjectView *>( *it ); | ||
| if( tcov != NULL ) | ||
| { | ||
| tcoViews.push_back( tcov ); | ||
| } | ||
| } | ||
| } | ||
| else | ||
| { | ||
| gui->songEditor()->m_editor->selectAllTcos( false ); | ||
| tcoViews.push_back( this ); | ||
| } | ||
| // Clear the action here because mouseReleaseEvent will not get | ||
| // triggered once we go into drag. | ||
| m_action = NoAction; | ||
|
|
||
| // Write the TCOs to the DataFile for copying | ||
| DataFile dataFile = createTCODataFiles( tcoViews ); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, but now you can't select/deselect a single TCO by [CTRL] + Click. That's why I moved this whole block into the mouseMoveEvent(). There we can test if the mouse moved 2 pixels since click(copy TCO) or not(toggleSelected). See: https://github.com/LMMS/lmms/pull/3988/files
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BaraMGB Thanks! I'll look into that. Anyway, what's this?
https://github.com/LMMS/lmms/pull/3649/files#diff-cb2a453c979a4777b9330e2b96644f0eL707
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done via 8434d5f.