Replace hacky code

This commit is contained in:
Thomas Wilshaw
2021-10-26 00:39:56 +01:00
parent 9eef02b446
commit 0ccd1eca48
+3 -2
View File
@@ -60,9 +60,9 @@ void Marker::SetActive(bool active)
// Feels very hacky, might it be better to write some access methods?
if (active) {
TimelineWidget *timeline = dynamic_cast<TimelineWidget *>(parent()->parent());
TimelinePanel *timeline = PanelManager::instance()->MostRecentlyFocused<TimelinePanel>();
if (timeline) {
static_cast<TimelineWidget *>(parent()->parent())->DeselectAll();
timeline->timeline_widget()->DeselectAll();
}
}
@@ -117,6 +117,7 @@ void Marker::paintEvent(QPaintEvent *event)
resize(marker_width_, marker_height_);
}
// In case this is a clip marker, redraw the timeline to update the clip marker
TimelinePanel* timeline = PanelManager::instance()->MostRecentlyFocused<TimelinePanel>();
if (timeline) {
timeline->timeline_widget()->Refresh();