From e81c9f1f3ae6feea1cce33b48b8f46cf87cc88ee Mon Sep 17 00:00:00 2001 From: Annar Date: Wed, 25 Sep 2024 01:32:25 +0300 Subject: [PATCH 1/3] ui: SequenceItem draws step note-text in ShowEditor timeline --- ui/src/showmanager/sequenceitem.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/src/showmanager/sequenceitem.cpp b/ui/src/showmanager/sequenceitem.cpp index 57b63b882b..fe7d8af6b1 100644 --- a/ui/src/showmanager/sequenceitem.cpp +++ b/ui/src/showmanager/sequenceitem.cpp @@ -83,6 +83,8 @@ void SequenceItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti uint stepFadeIn = step.fadeIn; uint stepFadeOut = step.fadeOut; uint stepDuration = step.duration; + QString stepNotes = step.note; + if (m_chaser->fadeInMode() == Chaser::Common) stepFadeIn = m_chaser->fadeInSpeed(); if (m_chaser->fadeOutMode() == Chaser::Common) @@ -113,6 +115,11 @@ void SequenceItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti painter->setBrush(QBrush(Qt::NoBrush)); painter->drawRect(xpos, 0, stepWidth, TRACK_HEIGHT - 3); } + + QRect textRect = QRect(xpos, 0, stepWidth, TRACK_HEIGHT-3); + QRect boundingRect = textRect; + painter->drawText(textRect, Qt::AlignBottom, stepNotes, &boundingRect); + xpos += stepWidth; // draw step vertical delimiter From 3b6214adc87e2377070cc60c7a543bb78c87e9dc Mon Sep 17 00:00:00 2001 From: Massimo Callegari Date: Sun, 29 Sep 2024 11:46:00 +0200 Subject: [PATCH 2/3] Update sequenceitem.cpp Simplify code --- ui/src/showmanager/sequenceitem.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ui/src/showmanager/sequenceitem.cpp b/ui/src/showmanager/sequenceitem.cpp index fe7d8af6b1..394fc4eae8 100644 --- a/ui/src/showmanager/sequenceitem.cpp +++ b/ui/src/showmanager/sequenceitem.cpp @@ -83,7 +83,6 @@ void SequenceItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti uint stepFadeIn = step.fadeIn; uint stepFadeOut = step.fadeOut; uint stepDuration = step.duration; - QString stepNotes = step.note; if (m_chaser->fadeInMode() == Chaser::Common) stepFadeIn = m_chaser->fadeInSpeed(); @@ -116,9 +115,8 @@ void SequenceItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti painter->drawRect(xpos, 0, stepWidth, TRACK_HEIGHT - 3); } - QRect textRect = QRect(xpos, 0, stepWidth, TRACK_HEIGHT-3); - QRect boundingRect = textRect; - painter->drawText(textRect, Qt::AlignBottom, stepNotes, &boundingRect); + QRect textRect = QRect(xpos, 0, stepWidth, TRACK_HEIGHT - 3); + painter->drawText(textRect, Qt::AlignBottom, step.note); xpos += stepWidth; From 1cef70c76623c3d1f24c17a46ca5ab9255405e44 Mon Sep 17 00:00:00 2001 From: Massimo Callegari Date: Sun, 29 Sep 2024 11:47:15 +0200 Subject: [PATCH 3/3] Update sequenceitem.cpp Give some left margin to step note --- ui/src/showmanager/sequenceitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/showmanager/sequenceitem.cpp b/ui/src/showmanager/sequenceitem.cpp index 394fc4eae8..47ac6f03e1 100644 --- a/ui/src/showmanager/sequenceitem.cpp +++ b/ui/src/showmanager/sequenceitem.cpp @@ -115,7 +115,7 @@ void SequenceItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti painter->drawRect(xpos, 0, stepWidth, TRACK_HEIGHT - 3); } - QRect textRect = QRect(xpos, 0, stepWidth, TRACK_HEIGHT - 3); + QRect textRect = QRect(xpos + 1, 0, stepWidth - 1, TRACK_HEIGHT - 3); painter->drawText(textRect, Qt::AlignBottom, step.note); xpos += stepWidth;