Gather pixel history panels together instead of making new dock for each

This commit is contained in:
baldurk
2018-02-19 00:52:13 +00:00
parent cafa6901bb
commit 04034c334b
9 changed files with 31 additions and 27 deletions
+22 -6
View File
@@ -1857,16 +1857,32 @@ void CaptureContext::AddDockWindow(QWidget *newWindow, DockReference ref, QWidge
return;
}
if(ref == DockReference::ConstantBufferArea)
if(ref == DockReference::TransientPopupArea)
{
if(ConstantBufferPreviewer::getOne())
if(qobject_cast<ConstantBufferPreviewer *>(newWindow))
{
ToolWindowManager *manager = ToolWindowManager::managerOf(refWindow);
manager->addToolWindow(newWindow, ToolWindowManager::AreaReference(
ToolWindowManager::AddTo,
manager->areaOf(ConstantBufferPreviewer::getOne())));
return;
ConstantBufferPreviewer *cb = manager->findChild<ConstantBufferPreviewer *>();
if(cb)
{
manager->addToolWindow(newWindow, ToolWindowManager::AreaReference(ToolWindowManager::AddTo,
manager->areaOf(cb)));
return;
}
}
if(qobject_cast<PixelHistoryView *>(newWindow))
{
ToolWindowManager *manager = ToolWindowManager::managerOf(refWindow);
PixelHistoryView *hist = manager->findChild<PixelHistoryView *>();
if(hist)
{
manager->addToolWindow(newWindow, ToolWindowManager::AreaReference(ToolWindowManager::AddTo,
manager->areaOf(hist)));
return;
}
}
ref = DockReference::RightOf;
+4 -4
View File
@@ -878,10 +878,10 @@ a new dock window or moving an existing dock window.
window and using that as the main area, then adding to the left of that. In the default layout
this is where the event browser is placed.
.. data:: ConstantBufferArea
.. data:: TransientPopupArea
The new dock window is docked with other constant buffer views, if they exist, or to the right
of the existing window if there are none open.
The new dock window is docked with other similar transient views like constant buffer or pixel
history windows, if they exist, or else docked to the right of the main window.
)");
enum class DockReference : int
{
@@ -902,7 +902,7 @@ enum class DockReference : int
// extra values here
MainToolArea,
LeftToolArea,
ConstantBufferArea,
TransientPopupArea,
};
DOCUMENT(R"(Details any changes that have been made to a capture in the UI which can be saved to
@@ -80,17 +80,6 @@ ConstantBufferPreviewer *ConstantBufferPreviewer::has(ShaderStage stage, uint32_
return NULL;
}
ConstantBufferPreviewer *ConstantBufferPreviewer::getOne()
{
for(ConstantBufferPreviewer *c : m_Previews)
{
if(ToolWindowManager::managerOf(c))
return c;
}
return NULL;
}
void ConstantBufferPreviewer::OnCaptureLoaded()
{
OnCaptureClosed();
@@ -46,7 +46,6 @@ public:
~ConstantBufferPreviewer();
static ConstantBufferPreviewer *has(ShaderStage stage, uint32_t slot, uint32_t idx);
static ConstantBufferPreviewer *getOne();
// IConstantBufferPreviewer
QWidget *Widget() override { return this; }
@@ -2095,7 +2095,7 @@ void D3D11PipelineStateViewer::cbuffer_itemActivated(RDTreeWidgetItem *item, int
IConstantBufferPreviewer *prev = m_Ctx.ViewConstantBuffer(stage->stage, cbufIdx, 0);
m_Ctx.AddDockWindow(prev->Widget(), DockReference::ConstantBufferArea, this, 0.3f);
m_Ctx.AddDockWindow(prev->Widget(), DockReference::TransientPopupArea, this, 0.3f);
}
void D3D11PipelineStateViewer::on_iaLayouts_itemActivated(RDTreeWidgetItem *item, int column)
@@ -1922,7 +1922,7 @@ void D3D12PipelineStateViewer::cbuffer_itemActivated(RDTreeWidgetItem *item, int
IConstantBufferPreviewer *prev = m_Ctx.ViewConstantBuffer(stage->stage, cb.idx, 0);
m_Ctx.AddDockWindow(prev->Widget(), DockReference::RightOf, this, 0.3f);
m_Ctx.AddDockWindow(prev->Widget(), DockReference::TransientPopupArea, this, 0.3f);
}
void D3D12PipelineStateViewer::on_iaLayouts_itemActivated(RDTreeWidgetItem *item, int column)
@@ -2059,7 +2059,7 @@ void GLPipelineStateViewer::ubo_itemActivated(RDTreeWidgetItem *item, int column
IConstantBufferPreviewer *prev = m_Ctx.ViewConstantBuffer(stage->stage, cb, 0);
m_Ctx.AddDockWindow(prev->Widget(), DockReference::RightOf, this, 0.3f);
m_Ctx.AddDockWindow(prev->Widget(), DockReference::TransientPopupArea, this, 0.3f);
}
void GLPipelineStateViewer::on_viAttrs_itemActivated(RDTreeWidgetItem *item, int column)
@@ -2153,7 +2153,7 @@ void VulkanPipelineStateViewer::ubo_itemActivated(RDTreeWidgetItem *item, int co
IConstantBufferPreviewer *prev = m_Ctx.ViewConstantBuffer(stage->stage, cb.slotIdx, cb.arrayIdx);
m_Ctx.AddDockWindow(prev->Widget(), DockReference::RightOf, this, 0.3f);
m_Ctx.AddDockWindow(prev->Widget(), DockReference::TransientPopupArea, this, 0.3f);
}
void VulkanPipelineStateViewer::on_viAttrs_itemActivated(RDTreeWidgetItem *item, int column)
+1 -1
View File
@@ -3480,7 +3480,7 @@ void TextureViewer::on_pixelHistory_clicked()
IPixelHistoryView *hist = m_Ctx.ViewPixelHistory(texptr->resourceId, x, y, m_TexDisplay);
m_Ctx.AddDockWindow(hist->Widget(), DockReference::RightOf, this, 0.3f);
m_Ctx.AddDockWindow(hist->Widget(), DockReference::TransientPopupArea, this, 0.3f);
// we use this pointer to ensure that the history viewer is still visible (and hasn't been closed)
// by the time we want to set the results.