From 0ccd1eca4813adb9cafc9bc589f05fbcdabf3ca9 Mon Sep 17 00:00:00 2001 From: Thomas Wilshaw Date: Tue, 26 Oct 2021 00:39:56 +0100 Subject: [PATCH] Replace hacky code --- app/widget/marker/marker.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/widget/marker/marker.cpp b/app/widget/marker/marker.cpp index e716385ac..1b7683acc 100644 --- a/app/widget/marker/marker.cpp +++ b/app/widget/marker/marker.cpp @@ -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(parent()->parent()); + TimelinePanel *timeline = PanelManager::instance()->MostRecentlyFocused(); if (timeline) { - static_cast(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(); if (timeline) { timeline->timeline_widget()->Refresh();