From fc94f9800a7ae9c2da27c20796ba9ccae3d9db38 Mon Sep 17 00:00:00 2001 From: Alexandra Russell Date: Wed, 27 May 2026 13:40:59 -0500 Subject: [PATCH] Fix clip name not showing on empty MIDI clips Renaming never invalidated the cached pixmap, and the name text box was suppressed for beat-type clips (which is what empty clips are classified as). Call update() after setName() in changeName() and resetName(), and allow the name box on empty clips. Note: empty beat clips in the Pattern editor will now also show their name if renamed. This was not previously possible but is harmless since their default name is empty. If undesirable, the condition could be tightened by also checking the track type. Fixes #7808 --- src/gui/clips/MidiClipView.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/clips/MidiClipView.cpp b/src/gui/clips/MidiClipView.cpp index 17604eb196a..c2608c35bda 100644 --- a/src/gui/clips/MidiClipView.cpp +++ b/src/gui/clips/MidiClipView.cpp @@ -120,7 +120,7 @@ void MidiClipView::setGhostInAutomationEditor() aEditor->setFocus(); } -void MidiClipView::resetName() { m_clip->setName(""); } +void MidiClipView::resetName() { m_clip->setName(""); update(); } @@ -131,6 +131,7 @@ void MidiClipView::changeName() RenameDialog rename_dlg( s ); rename_dlg.exec(); m_clip->setName( s ); + update(); } @@ -603,7 +604,7 @@ void MidiClipView::paintEvent( QPaintEvent * ) // Check whether we will paint a text box and compute its potential height // This is needed so we can paint the notes underneath it. bool const drawName = !m_clip->name().isEmpty(); - bool const drawTextBox = !beatClip && drawName; + bool const drawTextBox = drawName && (!beatClip || m_clip->m_notes.empty()); // TODO Warning! This might cause problems if ClipView::paintTextLabel changes int textBoxHeight = 0;