From dac9188237f7ccef226421d322c3eb07a8b9e525 Mon Sep 17 00:00:00 2001 From: Roman Pudashkin Date: Mon, 11 Oct 2021 13:16:12 +0200 Subject: [PATCH] optimized the timeline panel updating --- src/notation/view/widgets/timeline.h | 2 +- src/notation/view/widgets/timelineview.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/notation/view/widgets/timeline.h b/src/notation/view/widgets/timeline.h index 5f8111b502582..ca070055144ea 100644 --- a/src/notation/view/widgets/timeline.h +++ b/src/notation/view/widgets/timeline.h @@ -136,6 +136,7 @@ class Timeline : public QGraphicsView, public mu::async::Asyncable bool handleEvent(QEvent* event); void updateGridView() { updateGrid(-1, -1); } + void updateGridFromCmdState(); void setNotation(mu::notation::INotationPtr notation); TRowLabels* labelsColumn() const; @@ -264,7 +265,6 @@ private slots: const TimelineTheme& activeTheme() const; void updateGridFull() { updateGrid(0, -1); } - void updateGridFromCmdState(); QColor colorBox(QGraphicsRectItem* item); diff --git a/src/notation/view/widgets/timelineview.cpp b/src/notation/view/widgets/timelineview.cpp index 3b78cf3952bd6..03b7710b2222a 100644 --- a/src/notation/view/widgets/timelineview.cpp +++ b/src/notation/view/widgets/timelineview.cpp @@ -38,14 +38,14 @@ class TimelineAdapter : public QSplitter, public ui::IDisplayableWidget setFocusPolicy(Qt::NoFocus); setHandleWidth(0); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - setObjectName("TimeLineAdapter"); + setObjectName("TimelineAdapter"); m_msTimeline = new Ms::Timeline(this); } void updateView() { - m_msTimeline->updateGridView(); + m_msTimeline->updateGridFromCmdState(); } void setNotation(INotationPtr notation) @@ -120,7 +120,7 @@ void TimelineView::componentComplete() return; } - notation->notationChanged().onNotify(this, [=] { + notation->undoStack()->stackChanged().onNotify(this, [=] { updateView(); });