Add Info TextFloat for Piano Roll Knife Tool (and make cut notes auto selected) (#7953)

* Adds an informative "TextFloat::displayMessage" when the knife tool is enabled.
* Automatically selects short ends if shift is not held down.
This commit is contained in:
regulus79
2026-02-24 02:49:55 -05:00
committed by GitHub
parent d36f3f019e
commit f7acf0ed4b
2 changed files with 8 additions and 0 deletions

View File

@@ -2218,6 +2218,10 @@ void PianoRoll::setKnifeAction()
m_knifeDown = false;
setCursor(Qt::ArrowCursor);
update();
TextFloat::displayMessage(tr("Knife Tool"),
tr("Click and drag over notes to cut along a line\nHold Shift to automatically remove short ends"),
embed::getIconPixmap("edit_knife"), 4000);
}
}

View File

@@ -385,6 +385,10 @@ void MidiClip::splitNotesAlongLine(const NoteVector notes, TimePos pos1, int key
newNote2.setPos(keyIntercept);
newNote2.setLength(note->endPos() - keyIntercept);
// Select the short ends
if (newNote1.length() < newNote2.length()) { newNote1.setSelected(true); }
else { newNote2.setSelected(true); }
if (deleteShortEnds)
{
addNote(newNote1.length() >= newNote2.length() ? newNote1 : newNote2, false);