Highlight resources/history from other parts of the UI in timeline bar

This commit is contained in:
baldurk
2017-07-14 19:57:14 +01:00
parent 9ea8ed229d
commit 76cfcd5601
3 changed files with 38 additions and 2 deletions
+28
View File
@@ -387,6 +387,8 @@ public:
return QVariant();
}
const QVector<PixelModification> &modifications() { return m_ModList; }
ResourceId texID() { return m_Tex->ID; }
private:
ICaptureContext &m_Ctx;
@@ -617,11 +619,35 @@ PixelHistoryView::PixelHistoryView(ICaptureContext &ctx, ResourceId id, QPoint p
PixelHistoryView::~PixelHistoryView()
{
disableTimelineHighlight();
ui->events->setModel(NULL);
m_Ctx.RemoveLogViewer(this);
delete ui;
}
void PixelHistoryView::enableTimelineHighlight()
{
if(m_Ctx.HasTimelineBar())
m_Ctx.GetTimelineBar()->HighlightHistory(m_Model->texID(), m_Model->modifications().toList());
}
void PixelHistoryView::disableTimelineHighlight()
{
if(m_Ctx.HasTimelineBar())
m_Ctx.GetTimelineBar()->HighlightHistory(ResourceId(), {});
}
void PixelHistoryView::enterEvent(QEvent *event)
{
enableTimelineHighlight();
}
void PixelHistoryView::leaveEvent(QEvent *event)
{
disableTimelineHighlight();
}
void PixelHistoryView::OnLogfileLoaded()
{
}
@@ -634,6 +660,8 @@ void PixelHistoryView::OnLogfileClosed()
void PixelHistoryView::SetHistory(const rdctype::array<PixelModification> &history)
{
m_Model->setHistory(history);
enableTimelineHighlight();
}
void PixelHistoryView::startDebug(EventTag tag)