From f7acf0ed4b2877472b52e9f83da9dc1c0fb31f7a Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Tue, 24 Feb 2026 02:49:55 -0500 Subject: [PATCH] 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. --- src/gui/editors/PianoRoll.cpp | 4 ++++ src/tracks/MidiClip.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index e6a0c6a16..2b40d0af9 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -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); } } diff --git a/src/tracks/MidiClip.cpp b/src/tracks/MidiClip.cpp index 73a8435b2..f8556ec09 100644 --- a/src/tracks/MidiClip.cpp +++ b/src/tracks/MidiClip.cpp @@ -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);