Show usage in timeline bar when selecting/focussing resource inspector

This commit is contained in:
baldurk
2018-02-20 10:12:32 +00:00
parent dbfa3cdc4d
commit 6a1db5deac
4 changed files with 49 additions and 3 deletions
+19 -2
View File
@@ -662,6 +662,24 @@ TextureViewer::~TextureViewer()
delete ui;
}
void TextureViewer::enterEvent(QEvent *event)
{
HighlightUsage();
}
void TextureViewer::showEvent(QShowEvent *event)
{
HighlightUsage();
}
void TextureViewer::HighlightUsage()
{
TextureDescription *texptr = GetCurrentTexture();
if(texptr && m_Ctx.HasTimelineBar())
m_Ctx.GetTimelineBar()->HighlightResourceUsage(texptr->resourceId);
}
void TextureViewer::RT_FetchCurrentPixel(uint32_t x, uint32_t y, PixelValue &pickValue,
PixelValue &realValue)
{
@@ -1327,8 +1345,7 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw)
RT_PickPixelsAndUpdate(r);
});
if(m_Ctx.HasTimelineBar())
m_Ctx.GetTimelineBar()->HighlightResourceUsage(texptr->resourceId);
HighlightUsage();
}
void TextureViewer::UI_SetHistogramRange(const TextureDescription *tex, CompType typeHint)