Skip to content

Commit

Permalink
optimized the timeline panel updating
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanPudashkin committed Oct 11, 2021
1 parent 72f2738 commit dac9188
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/notation/view/widgets/timeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -264,7 +265,6 @@ private slots:
const TimelineTheme& activeTheme() const;

void updateGridFull() { updateGrid(0, -1); }
void updateGridFromCmdState();

QColor colorBox(QGraphicsRectItem* item);

Expand Down
6 changes: 3 additions & 3 deletions src/notation/view/widgets/timelineview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -120,7 +120,7 @@ void TimelineView::componentComplete()
return;
}

notation->notationChanged().onNotify(this, [=] {
notation->undoStack()->stackChanged().onNotify(this, [=] {
updateView();
});

Expand Down

0 comments on commit dac9188

Please sign in to comment.