Ensure that constant buffer views are grouped together in docking

This commit is contained in:
baldurk
2017-04-28 17:54:20 +01:00
parent e0191ccba4
commit 18d3eae1c8
5 changed files with 34 additions and 1 deletions
+14
View File
@@ -943,6 +943,20 @@ void CaptureContext::AddDockWindow(QWidget *newWindow, DockReference ref, QWidge
m_MainWindow->mainToolManager()->addToolWindow(newWindow, m_MainWindow->leftToolArea());
return;
}
if(ref == DockReference::ConstantBufferArea)
{
if(ConstantBufferPreviewer::getOne())
{
ToolWindowManager *manager = ToolWindowManager::managerOf(refWindow);
manager->addToolWindow(newWindow, ToolWindowManager::AreaReference(
ToolWindowManager::AddTo,
manager->areaOf(ConstantBufferPreviewer::getOne())));
return;
}
ref = DockReference::RightOf;
}
ToolWindowManager *manager = ToolWindowManager::managerOf(refWindow);
+6
View File
@@ -684,6 +684,11 @@ a new dock window or moving an existing dock window.
The new dock window is placed in the 'left' tool area as defined by finding an existing known
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
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.
)");
enum class DockReference : int
{
@@ -700,6 +705,7 @@ enum class DockReference : int
// extra values here
MainToolArea,
LeftToolArea,
ConstantBufferArea,
};
DOCUMENT("The capture context that the python script is running in.")
@@ -24,6 +24,7 @@
#include "ConstantBufferPreviewer.h"
#include <QFontDatabase>
#include "3rdparty/toolwindowmanager/ToolWindowManager.h"
#include "ui_ConstantBufferPreviewer.h"
QList<ConstantBufferPreviewer *> ConstantBufferPreviewer::m_Previews;
@@ -78,6 +79,17 @@ 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::OnLogfileLoaded()
{
OnLogfileClosed();
@@ -45,6 +45,7 @@ public:
~ConstantBufferPreviewer();
static ConstantBufferPreviewer *has(ShaderStage stage, uint32_t slot, uint32_t idx);
static ConstantBufferPreviewer *getOne();
// IConstantBufferPreviewer
QWidget *Widget() override { return this; }
@@ -1959,7 +1959,7 @@ void D3D11PipelineStateViewer::cbuffer_itemActivated(RDTreeWidgetItem *item, int
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::ConstantBufferArea, this, 0.3f);
}
void D3D11PipelineStateViewer::on_iaLayouts_itemActivated(RDTreeWidgetItem *item, int column)