diff --git a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp index f67f89540..11cce18d8 100644 --- a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp @@ -176,19 +176,13 @@ D3D11PipelineStateViewer::D3D11PipelineStateViewer(ICaptureContext &ctx, addGridLines(ui->depthStateGridLayout, palette().color(QPalette::WindowText)); { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->iaLayouts->setHeader(header); + ui->iaLayouts->setColumns({tr("Slot"), tr("Semantic"), tr("Index"), tr("Format"), tr("Input Slot"), tr("Offset"), tr("Class"), tr("Step Rate"), tr("Go")}); - ui->iaLayouts->header()->resizeSection(0, 75); - ui->iaLayouts->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->iaLayouts->header()->setSectionResizeMode(1, QHeaderView::Stretch); - ui->iaLayouts->header()->setSectionResizeMode(2, QHeaderView::Stretch); - ui->iaLayouts->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->iaLayouts->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->iaLayouts->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->iaLayouts->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); - ui->iaLayouts->header()->setSectionResizeMode(7, QHeaderView::ResizeToContents); - ui->iaLayouts->header()->setSectionResizeMode(8, QHeaderView::ResizeToContents); + header->setColumnStretchHints({1, 4, 2, 3, 2, 2, 1, 1, -1}); ui->iaLayouts->setClearSelectionOnFocusLoss(true); ui->iaLayouts->setInstantTooltips(true); @@ -196,15 +190,12 @@ D3D11PipelineStateViewer::D3D11PipelineStateViewer(ICaptureContext &ctx, } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->iaBuffers->setHeader(header); + ui->iaBuffers->setColumns( {tr("Slot"), tr("Buffer"), tr("Stride"), tr("Offset"), tr("Byte Length"), tr("Go")}); - ui->iaBuffers->header()->resizeSection(0, 75); - ui->iaBuffers->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->iaBuffers->header()->setSectionResizeMode(1, QHeaderView::Stretch); - ui->iaBuffers->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->iaBuffers->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->iaBuffers->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->iaBuffers->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); + header->setColumnStretchHints({1, 4, 2, 2, 3, -1}); ui->iaBuffers->setClearSelectionOnFocusLoss(true); ui->iaBuffers->setInstantTooltips(true); @@ -213,18 +204,12 @@ D3D11PipelineStateViewer::D3D11PipelineStateViewer(ICaptureContext &ctx, for(RDTreeWidget *tex : resources) { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + tex->setHeader(header); + tex->setColumns({tr("Slot"), tr("Resource"), tr("Type"), tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), tr("Format"), tr("Go")}); - tex->header()->resizeSection(0, 120); - tex->header()->setSectionResizeMode(0, QHeaderView::Interactive); - tex->header()->setSectionResizeMode(1, QHeaderView::Stretch); - tex->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - tex->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - tex->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - tex->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - tex->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); - tex->header()->setSectionResizeMode(7, QHeaderView::ResizeToContents); - tex->header()->setSectionResizeMode(8, QHeaderView::ResizeToContents); + header->setColumnStretchHints({2, 4, 2, 1, 1, 1, 1, 3, -1}); tex->setHoverIconColumn(8, action, action_hover); tex->setClearSelectionOnFocusLoss(true); @@ -233,13 +218,11 @@ D3D11PipelineStateViewer::D3D11PipelineStateViewer(ICaptureContext &ctx, for(RDTreeWidget *samp : samplers) { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + samp->setHeader(header); + samp->setColumns({tr("Slot"), tr("Addressing"), tr("Filter"), tr("LOD Clamp"), tr("LOD Bias")}); - samp->header()->resizeSection(0, 120); - samp->header()->setSectionResizeMode(0, QHeaderView::Interactive); - samp->header()->setSectionResizeMode(1, QHeaderView::Stretch); - samp->header()->setSectionResizeMode(2, QHeaderView::Stretch); - samp->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - samp->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); + header->setColumnStretchHints({1, 2, 2, 2, 2}); samp->setClearSelectionOnFocusLoss(true); samp->setInstantTooltips(true); @@ -247,13 +230,11 @@ D3D11PipelineStateViewer::D3D11PipelineStateViewer(ICaptureContext &ctx, for(RDTreeWidget *cbuffer : cbuffers) { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + cbuffer->setHeader(header); + cbuffer->setColumns({tr("Slot"), tr("Buffer"), tr("Byte Range"), tr("Size"), tr("Go")}); - cbuffer->header()->resizeSection(0, 120); - cbuffer->header()->setSectionResizeMode(0, QHeaderView::Interactive); - cbuffer->header()->setSectionResizeMode(1, QHeaderView::Stretch); - cbuffer->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - cbuffer->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - cbuffer->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); + header->setColumnStretchHints({1, 2, 3, 3, -1}); cbuffer->setHoverIconColumn(4, action, action_hover); cbuffer->setClearSelectionOnFocusLoss(true); @@ -262,58 +243,49 @@ D3D11PipelineStateViewer::D3D11PipelineStateViewer(ICaptureContext &ctx, for(RDTreeWidget *cl : classes) { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + cl->setHeader(header); + cl->setColumns({tr("Slot"), tr("Interface"), tr("Instance")}); - cl->header()->resizeSection(0, 120); - cl->header()->setSectionResizeMode(0, QHeaderView::Interactive); - cl->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - cl->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); + header->setColumnStretchHints({1, 1, 1}); cl->setClearSelectionOnFocusLoss(true); cl->setInstantTooltips(true); } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->viewports->setHeader(header); + ui->viewports->setColumns( {tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height"), tr("MinDepth"), tr("MaxDepth")}); - ui->viewports->header()->resizeSection(0, 75); - ui->viewports->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->viewports->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); + header->setColumnStretchHints({-1, -1, -1, -1, -1, -1, 1}); + header->setMinimumSectionSize(40); ui->viewports->setClearSelectionOnFocusLoss(true); ui->viewports->setInstantTooltips(true); } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->scissors->setHeader(header); + ui->scissors->setColumns({tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height")}); - ui->scissors->header()->resizeSection(0, 100); - ui->scissors->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->scissors->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ui->scissors->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->scissors->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->scissors->header()->setSectionResizeMode(4, QHeaderView::Stretch); + header->setColumnStretchHints({-1, -1, -1, -1, 1}); + header->setMinimumSectionSize(40); ui->scissors->setClearSelectionOnFocusLoss(true); ui->scissors->setInstantTooltips(true); } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->targetOutputs->setHeader(header); + ui->targetOutputs->setColumns({tr("Slot"), tr("Resource"), tr("Type"), tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), tr("Format"), tr("Go")}); - ui->targetOutputs->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); - ui->targetOutputs->header()->setSectionResizeMode(1, QHeaderView::Stretch); - ui->targetOutputs->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->targetOutputs->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->targetOutputs->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->targetOutputs->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->targetOutputs->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); - ui->targetOutputs->header()->setSectionResizeMode(7, QHeaderView::ResizeToContents); - ui->targetOutputs->header()->setSectionResizeMode(8, QHeaderView::ResizeToContents); + header->setColumnStretchHints({2, 4, 2, 1, 1, 1, 1, 3, -1}); ui->targetOutputs->setHoverIconColumn(8, action, action_hover); ui->targetOutputs->setClearSelectionOnFocusLoss(true); @@ -321,49 +293,37 @@ D3D11PipelineStateViewer::D3D11PipelineStateViewer(ICaptureContext &ctx, } { - ui->blends->setColumns({tr("Slot"), tr("Enabled"), tr("Col Src"), tr("Col Dst"), tr("Col Op"), - tr("Alpha Src"), tr("Alpha Dst"), tr("Alpha Op"), tr("Write Mask")}); - ui->blends->header()->resizeSection(0, 75); - ui->blends->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->blends->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(7, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(8, QHeaderView::ResizeToContents); + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->blends->setHeader(header); + + ui->blends->setColumns({tr("Slot"), tr("Logic"), tr("Enabled"), tr("Col Src"), tr("Col Dst"), + tr("Col Op"), tr("Alpha Src"), tr("Alpha Dst"), tr("Alpha Op"), + tr("Logic Op"), tr("Write Mask")}); + header->setColumnStretchHints({-1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1}); ui->blends->setClearSelectionOnFocusLoss(true); ui->blends->setInstantTooltips(true); } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->stencils->setHeader(header); + ui->stencils->setColumns( {tr("Face"), tr("Func"), tr("Fail Op"), tr("Depth Fail Op"), tr("Pass Op")}); - ui->stencils->header()->resizeSection(0, 50); - ui->stencils->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->stencils->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ui->stencils->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->stencils->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->stencils->header()->setSectionResizeMode(4, QHeaderView::Stretch); + header->setColumnStretchHints({1, 2, 2, 2, 2}); ui->stencils->setClearSelectionOnFocusLoss(true); ui->stencils->setInstantTooltips(true); } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->csUAVs->setHeader(header); + ui->csUAVs->setColumns({tr("Slot"), tr("Resource"), tr("Type"), tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), tr("Format"), tr("Go")}); - ui->csUAVs->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); - ui->csUAVs->header()->setSectionResizeMode(1, QHeaderView::Stretch); - ui->csUAVs->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->csUAVs->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->csUAVs->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->csUAVs->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->csUAVs->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); - ui->csUAVs->header()->setSectionResizeMode(7, QHeaderView::ResizeToContents); - ui->csUAVs->header()->setSectionResizeMode(8, QHeaderView::ResizeToContents); + header->setColumnStretchHints({2, 4, 2, 1, 1, 1, 1, 3, -1}); ui->csUAVs->setHoverIconColumn(8, action, action_hover); ui->csUAVs->setClearSelectionOnFocusLoss(true); diff --git a/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp index 58a730305..8533f4d75 100644 --- a/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp @@ -30,6 +30,7 @@ #include "3rdparty/flowlayout/FlowLayout.h" #include "3rdparty/toolwindowmanager/ToolWindowManager.h" #include "Code/Resources.h" +#include "Widgets/Extended/RDHeaderView.h" #include "PipelineStateViewer.h" #include "ui_D3D12PipelineStateViewer.h" @@ -204,19 +205,13 @@ D3D12PipelineStateViewer::D3D12PipelineStateViewer(ICaptureContext &ctx, addGridLines(ui->depthStateGridLayout, palette().color(QPalette::WindowText)); { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->iaLayouts->setHeader(header); + ui->iaLayouts->setColumns({tr("Slot"), tr("Semantic"), tr("Index"), tr("Format"), tr("Input Slot"), tr("Offset"), tr("Class"), tr("Step Rate"), tr("Go")}); - ui->iaLayouts->header()->resizeSection(0, 75); - ui->iaLayouts->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->iaLayouts->header()->setSectionResizeMode(1, QHeaderView::Stretch); - ui->iaLayouts->header()->setSectionResizeMode(2, QHeaderView::Stretch); - ui->iaLayouts->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->iaLayouts->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->iaLayouts->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->iaLayouts->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); - ui->iaLayouts->header()->setSectionResizeMode(7, QHeaderView::ResizeToContents); - ui->iaLayouts->header()->setSectionResizeMode(8, QHeaderView::ResizeToContents); + header->setColumnStretchHints({1, 4, 2, 3, 2, 2, 1, 1, -1}); ui->iaLayouts->setClearSelectionOnFocusLoss(true); ui->iaLayouts->setInstantTooltips(true); @@ -224,15 +219,12 @@ D3D12PipelineStateViewer::D3D12PipelineStateViewer(ICaptureContext &ctx, } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->iaBuffers->setHeader(header); + ui->iaBuffers->setColumns( {tr("Slot"), tr("Buffer"), tr("Stride"), tr("Offset"), tr("Byte Length"), tr("Go")}); - ui->iaBuffers->header()->resizeSection(0, 75); - ui->iaBuffers->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->iaBuffers->header()->setSectionResizeMode(1, QHeaderView::Stretch); - ui->iaBuffers->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->iaBuffers->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->iaBuffers->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->iaBuffers->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); + header->setColumnStretchHints({1, 4, 2, 2, 3, -1}); ui->iaBuffers->setClearSelectionOnFocusLoss(true); ui->iaBuffers->setInstantTooltips(true); @@ -241,23 +233,13 @@ D3D12PipelineStateViewer::D3D12PipelineStateViewer(ICaptureContext &ctx, for(RDTreeWidget *res : resources) { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + res->setHeader(header); + res->setColumns({tr("Root Sig El"), tr("Space"), tr("Register"), tr("Resource"), tr("Type"), tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), tr("Format"), tr("Go")}); - res->header()->resizeSection(0, 100); - res->header()->resizeSection(1, 40); - res->header()->resizeSection(2, 120); - res->header()->setSectionResizeMode(0, QHeaderView::Interactive); - res->header()->setSectionResizeMode(1, QHeaderView::Interactive); - res->header()->setSectionResizeMode(2, QHeaderView::Interactive); - res->header()->setSectionResizeMode(3, QHeaderView::Stretch); - res->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - res->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - res->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); - res->header()->setSectionResizeMode(7, QHeaderView::ResizeToContents); - res->header()->setSectionResizeMode(8, QHeaderView::ResizeToContents); - res->header()->setSectionResizeMode(9, QHeaderView::ResizeToContents); - res->header()->setSectionResizeMode(10, QHeaderView::ResizeToContents); + header->setColumnStretchHints({1, 1, 2, 4, 2, 1, 1, 1, 1, 3, -1}); res->setHoverIconColumn(10, action, action_hover); res->setClearSelectionOnFocusLoss(true); @@ -266,23 +248,13 @@ D3D12PipelineStateViewer::D3D12PipelineStateViewer(ICaptureContext &ctx, for(RDTreeWidget *uav : uavs) { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + uav->setHeader(header); + uav->setColumns({tr("Root Sig El"), tr("Space"), tr("Register"), tr("Resource"), tr("Type"), tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), tr("Format"), tr("Go")}); - uav->header()->resizeSection(0, 100); - uav->header()->resizeSection(1, 40); - uav->header()->resizeSection(2, 120); - uav->header()->setSectionResizeMode(0, QHeaderView::Interactive); - uav->header()->setSectionResizeMode(1, QHeaderView::Interactive); - uav->header()->setSectionResizeMode(2, QHeaderView::Interactive); - uav->header()->setSectionResizeMode(3, QHeaderView::Stretch); - uav->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - uav->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - uav->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); - uav->header()->setSectionResizeMode(7, QHeaderView::ResizeToContents); - uav->header()->setSectionResizeMode(8, QHeaderView::ResizeToContents); - uav->header()->setSectionResizeMode(9, QHeaderView::ResizeToContents); - uav->header()->setSectionResizeMode(10, QHeaderView::ResizeToContents); + header->setColumnStretchHints({1, 1, 2, 4, 2, 1, 1, 1, 1, 3, -1}); uav->setHoverIconColumn(10, action, action_hover); uav->setClearSelectionOnFocusLoss(true); @@ -291,18 +263,12 @@ D3D12PipelineStateViewer::D3D12PipelineStateViewer(ICaptureContext &ctx, for(RDTreeWidget *samp : samplers) { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + samp->setHeader(header); + samp->setColumns({tr("Root Sig El"), tr("Space"), tr("Register"), tr("Addressing"), tr("Filter"), tr("LOD Clamp"), tr("LOD Bias")}); - samp->header()->resizeSection(0, 100); - samp->header()->resizeSection(1, 40); - samp->header()->resizeSection(2, 120); - samp->header()->setSectionResizeMode(0, QHeaderView::Interactive); - samp->header()->setSectionResizeMode(1, QHeaderView::Interactive); - samp->header()->setSectionResizeMode(2, QHeaderView::Interactive); - samp->header()->setSectionResizeMode(3, QHeaderView::Stretch); - samp->header()->setSectionResizeMode(4, QHeaderView::Stretch); - samp->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - samp->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); + header->setColumnStretchHints({1, 1, 2, 2, 2, 2, 2}); samp->setClearSelectionOnFocusLoss(true); samp->setInstantTooltips(true); @@ -310,18 +276,12 @@ D3D12PipelineStateViewer::D3D12PipelineStateViewer(ICaptureContext &ctx, for(RDTreeWidget *cbuffer : cbuffers) { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + cbuffer->setHeader(header); + cbuffer->setColumns({tr("Root Sig El"), tr("Space"), tr("Register"), tr("Buffer"), tr("Byte Range"), tr("Size"), tr("Go")}); - cbuffer->header()->resizeSection(0, 100); - cbuffer->header()->resizeSection(1, 40); - cbuffer->header()->resizeSection(2, 120); - cbuffer->header()->setSectionResizeMode(0, QHeaderView::Interactive); - cbuffer->header()->setSectionResizeMode(1, QHeaderView::Interactive); - cbuffer->header()->setSectionResizeMode(2, QHeaderView::Interactive); - cbuffer->header()->setSectionResizeMode(3, QHeaderView::Stretch); - cbuffer->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - cbuffer->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - cbuffer->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); + header->setColumnStretchHints({1, 1, 2, 4, 3, 3, -1}); cbuffer->setHoverIconColumn(6, action, action_hover); cbuffer->setClearSelectionOnFocusLoss(true); @@ -329,47 +289,38 @@ D3D12PipelineStateViewer::D3D12PipelineStateViewer(ICaptureContext &ctx, } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->viewports->setHeader(header); + ui->viewports->setColumns( {tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height"), tr("MinDepth"), tr("MaxDepth")}); - ui->viewports->header()->resizeSection(0, 75); - ui->viewports->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->viewports->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); + header->setColumnStretchHints({-1, -1, -1, -1, -1, -1, 1}); + header->setMinimumSectionSize(40); ui->viewports->setClearSelectionOnFocusLoss(true); ui->viewports->setInstantTooltips(true); } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->scissors->setHeader(header); + ui->scissors->setColumns({tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height")}); - ui->scissors->header()->resizeSection(0, 100); - ui->scissors->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->scissors->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ui->scissors->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->scissors->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->scissors->header()->setSectionResizeMode(4, QHeaderView::Stretch); + header->setColumnStretchHints({-1, -1, -1, -1, 1}); + header->setMinimumSectionSize(40); ui->scissors->setClearSelectionOnFocusLoss(true); ui->scissors->setInstantTooltips(true); } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->targetOutputs->setHeader(header); + ui->targetOutputs->setColumns({tr("Slot"), tr("Resource"), tr("Type"), tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), tr("Format"), tr("Go")}); - ui->targetOutputs->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); - ui->targetOutputs->header()->setSectionResizeMode(1, QHeaderView::Stretch); - ui->targetOutputs->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->targetOutputs->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->targetOutputs->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->targetOutputs->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->targetOutputs->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); - ui->targetOutputs->header()->setSectionResizeMode(7, QHeaderView::ResizeToContents); - ui->targetOutputs->header()->setSectionResizeMode(8, QHeaderView::ResizeToContents); + header->setColumnStretchHints({2, 4, 2, 1, 1, 1, 1, 3, -1}); ui->targetOutputs->setHoverIconColumn(8, action, action_hover); ui->targetOutputs->setClearSelectionOnFocusLoss(true); @@ -377,32 +328,25 @@ D3D12PipelineStateViewer::D3D12PipelineStateViewer(ICaptureContext &ctx, } { - ui->blends->setColumns({tr("Slot"), tr("Enabled"), tr("Col Src"), tr("Col Dst"), tr("Col Op"), - tr("Alpha Src"), tr("Alpha Dst"), tr("Alpha Op"), tr("Write Mask")}); - ui->blends->header()->resizeSection(0, 75); - ui->blends->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->blends->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(7, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(8, QHeaderView::ResizeToContents); + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->blends->setHeader(header); + + ui->blends->setColumns({tr("Slot"), tr("Logic"), tr("Enabled"), tr("Col Src"), tr("Col Dst"), + tr("Col Op"), tr("Alpha Src"), tr("Alpha Dst"), tr("Alpha Op"), + tr("Logic Op"), tr("Write Mask")}); + header->setColumnStretchHints({-1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1}); ui->blends->setClearSelectionOnFocusLoss(true); ui->blends->setInstantTooltips(true); } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->stencils->setHeader(header); + ui->stencils->setColumns( {tr("Face"), tr("Func"), tr("Fail Op"), tr("Depth Fail Op"), tr("Pass Op")}); - ui->stencils->header()->resizeSection(0, 50); - ui->stencils->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->stencils->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ui->stencils->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->stencils->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->stencils->header()->setSectionResizeMode(4, QHeaderView::Stretch); + header->setColumnStretchHints({1, 2, 2, 2, 2}); ui->stencils->setClearSelectionOnFocusLoss(true); ui->stencils->setInstantTooltips(true); diff --git a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp index 752080b41..3a16d75dd 100644 --- a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp @@ -29,6 +29,7 @@ #include #include "3rdparty/toolwindowmanager/ToolWindowManager.h" #include "Code/Resources.h" +#include "Widgets/Extended/RDHeaderView.h" #include "PipelineStateViewer.h" #include "ui_GLPipelineStateViewer.h" @@ -164,16 +165,12 @@ GLPipelineStateViewer::GLPipelineStateViewer(ICaptureContext &ctx, PipelineState addGridLines(ui->depthStateGridLayout, palette().color(QPalette::WindowText)); { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->viAttrs->setHeader(header); + ui->viAttrs->setColumns({tr("Index"), tr("Enabled"), tr("Name"), tr("Format/Generic Value"), tr("Buffer Slot"), tr("Relative Offset"), tr("Go")}); - ui->viAttrs->header()->resizeSection(0, 75); - ui->viAttrs->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->viAttrs->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ui->viAttrs->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->viAttrs->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->viAttrs->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->viAttrs->header()->setSectionResizeMode(5, QHeaderView::Stretch); - ui->viAttrs->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); + header->setColumnStretchHints({1, 1, 4, 3, 2, 2, -1}); ui->viAttrs->setClearSelectionOnFocusLoss(true); ui->viAttrs->setInstantTooltips(true); @@ -181,16 +178,12 @@ GLPipelineStateViewer::GLPipelineStateViewer(ICaptureContext &ctx, PipelineState } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->viBuffers->setHeader(header); + ui->viBuffers->setColumns({tr("Slot"), tr("Buffer"), tr("Stride"), tr("Offset"), tr("Divisor"), tr("Byte Length"), tr("Go")}); - ui->viBuffers->header()->resizeSection(0, 75); - ui->viBuffers->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->viBuffers->header()->setSectionResizeMode(1, QHeaderView::Stretch); - ui->viBuffers->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->viBuffers->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->viBuffers->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->viBuffers->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->viBuffers->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); + header->setColumnStretchHints({1, 4, 2, 2, 2, 3, -1}); ui->viBuffers->setClearSelectionOnFocusLoss(true); ui->viBuffers->setInstantTooltips(true); @@ -199,18 +192,12 @@ GLPipelineStateViewer::GLPipelineStateViewer(ICaptureContext &ctx, PipelineState for(RDTreeWidget *tex : textures) { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + tex->setHeader(header); + tex->setColumns({tr("Slot"), tr("Resource"), tr("Type"), tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), tr("Format"), tr("Go")}); - tex->header()->resizeSection(0, 120); - tex->header()->setSectionResizeMode(0, QHeaderView::Interactive); - tex->header()->setSectionResizeMode(1, QHeaderView::Stretch); - tex->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - tex->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - tex->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - tex->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - tex->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); - tex->header()->setSectionResizeMode(7, QHeaderView::ResizeToContents); - tex->header()->setSectionResizeMode(8, QHeaderView::ResizeToContents); + header->setColumnStretchHints({2, 4, 2, 1, 1, 1, 1, 3, -1}); tex->setHoverIconColumn(8, action, action_hover); tex->setClearSelectionOnFocusLoss(true); @@ -219,13 +206,11 @@ GLPipelineStateViewer::GLPipelineStateViewer(ICaptureContext &ctx, PipelineState for(RDTreeWidget *samp : samplers) { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + samp->setHeader(header); + samp->setColumns({tr("Slot"), tr("Addressing"), tr("Filter"), tr("LOD Clamp"), tr("LOD Bias")}); - samp->header()->resizeSection(0, 120); - samp->header()->setSectionResizeMode(0, QHeaderView::Interactive); - samp->header()->setSectionResizeMode(1, QHeaderView::Stretch); - samp->header()->setSectionResizeMode(2, QHeaderView::Stretch); - samp->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - samp->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); + header->setColumnStretchHints({1, 2, 2, 2, 2}); samp->setClearSelectionOnFocusLoss(true); samp->setInstantTooltips(true); @@ -233,13 +218,11 @@ GLPipelineStateViewer::GLPipelineStateViewer(ICaptureContext &ctx, PipelineState for(RDTreeWidget *ubo : ubos) { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ubo->setHeader(header); + ubo->setColumns({tr("Slot"), tr("Buffer"), tr("Byte Range"), tr("Size"), tr("Go")}); - ubo->header()->resizeSection(0, 120); - ubo->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ubo->header()->setSectionResizeMode(1, QHeaderView::Stretch); - ubo->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ubo->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ubo->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); + header->setColumnStretchHints({1, 2, 3, 3, -1}); ubo->setHoverIconColumn(4, action, action_hover); ubo->setClearSelectionOnFocusLoss(true); @@ -248,10 +231,11 @@ GLPipelineStateViewer::GLPipelineStateViewer(ICaptureContext &ctx, PipelineState for(RDTreeWidget *sub : subroutines) { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + sub->setHeader(header); + sub->setColumns({tr("Uniform"), tr("Value")}); - sub->header()->resizeSection(0, 120); - sub->header()->setSectionResizeMode(0, QHeaderView::Interactive); - sub->header()->setSectionResizeMode(1, QHeaderView::Stretch); + header->setColumnStretchHints({1, 1}); sub->setClearSelectionOnFocusLoss(true); sub->setInstantTooltips(true); @@ -259,16 +243,12 @@ GLPipelineStateViewer::GLPipelineStateViewer(ICaptureContext &ctx, PipelineState for(RDTreeWidget *ubo : readwrites) { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ubo->setHeader(header); + ubo->setColumns({tr("Binding"), tr("Slot"), tr("Resource"), tr("Dimensions"), tr("Format"), tr("Access"), tr("Go")}); - ubo->header()->resizeSection(1, 120); - ubo->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); - ubo->header()->setSectionResizeMode(1, QHeaderView::Interactive); - ubo->header()->setSectionResizeMode(2, QHeaderView::Stretch); - ubo->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ubo->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ubo->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ubo->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); + header->setColumnStretchHints({1, 1, 2, 3, 3, 1, -1}); ubo->setHoverIconColumn(6, action, action_hover); ubo->setClearSelectionOnFocusLoss(true); @@ -276,48 +256,38 @@ GLPipelineStateViewer::GLPipelineStateViewer(ICaptureContext &ctx, PipelineState } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->viewports->setHeader(header); + ui->viewports->setColumns( {tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height"), tr("MinDepth"), tr("MaxDepth")}); - ui->viewports->header()->resizeSection(0, 75); - ui->viewports->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->viewports->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); + header->setColumnStretchHints({-1, -1, -1, -1, -1, -1, 1}); + header->setMinimumSectionSize(40); ui->viewports->setClearSelectionOnFocusLoss(true); ui->viewports->setInstantTooltips(true); } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->scissors->setHeader(header); + ui->scissors->setColumns( {tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height"), tr("Enabled")}); - ui->scissors->header()->resizeSection(0, 100); - ui->scissors->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->scissors->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ui->scissors->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->scissors->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->scissors->header()->setSectionResizeMode(4, QHeaderView::Stretch); - ui->scissors->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); + header->setColumnStretchHints({-1, -1, -1, -1, -1, 1}); + header->setMinimumSectionSize(40); ui->scissors->setClearSelectionOnFocusLoss(true); ui->scissors->setInstantTooltips(true); } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->framebuffer->setHeader(header); + ui->framebuffer->setColumns({tr("Slot"), tr("Resource"), tr("Type"), tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), tr("Format"), tr("Go")}); - ui->framebuffer->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); - ui->framebuffer->header()->setSectionResizeMode(1, QHeaderView::Stretch); - ui->framebuffer->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->framebuffer->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->framebuffer->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->framebuffer->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->framebuffer->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); - ui->framebuffer->header()->setSectionResizeMode(7, QHeaderView::ResizeToContents); - ui->framebuffer->header()->setSectionResizeMode(8, QHeaderView::ResizeToContents); + header->setColumnStretchHints({2, 4, 2, 1, 1, 1, 1, 3, -1}); ui->framebuffer->setHoverIconColumn(8, action, action_hover); ui->framebuffer->setClearSelectionOnFocusLoss(true); @@ -325,35 +295,24 @@ GLPipelineStateViewer::GLPipelineStateViewer(ICaptureContext &ctx, PipelineState } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->blends->setHeader(header); + ui->blends->setColumns({tr("Slot"), tr("Enabled"), tr("Col Src"), tr("Col Dst"), tr("Col Op"), tr("Alpha Src"), tr("Alpha Dst"), tr("Alpha Op"), tr("Write Mask")}); - ui->blends->header()->resizeSection(0, 75); - ui->blends->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->blends->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(7, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(8, QHeaderView::ResizeToContents); + header->setColumnStretchHints({-1, 1, 2, 2, 2, 2, 2, 2, 1}); ui->blends->setClearSelectionOnFocusLoss(true); ui->blends->setInstantTooltips(true); } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->stencils->setHeader(header); + ui->stencils->setColumns({tr("Face"), tr("Func"), tr("Fail Op"), tr("Depth Fail Op"), tr("Pass Op"), tr("Write Mask"), tr("Comp Mask"), tr("Ref")}); - ui->stencils->header()->resizeSection(0, 50); - ui->stencils->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->stencils->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ui->stencils->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->stencils->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->stencils->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->stencils->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->stencils->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); - ui->stencils->header()->setSectionResizeMode(7, QHeaderView::Stretch); + header->setColumnStretchHints({1, 2, 2, 2, 2, 1, 1, 1}); ui->stencils->setClearSelectionOnFocusLoss(true); ui->stencils->setInstantTooltips(true); diff --git a/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp index 35516ade3..4115bd537 100644 --- a/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp @@ -29,6 +29,7 @@ #include #include "3rdparty/toolwindowmanager/ToolWindowManager.h" #include "Code/Resources.h" +#include "Widgets/Extended/RDHeaderView.h" #include "PipelineStateViewer.h" #include "ui_VulkanPipelineStateViewer.h" @@ -164,16 +165,12 @@ VulkanPipelineStateViewer::VulkanPipelineStateViewer(ICaptureContext &ctx, addGridLines(ui->depthStateGridLayout, palette().color(QPalette::WindowText)); { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->viAttrs->setHeader(header); + ui->viAttrs->setColumns({tr("Index"), tr("Name"), tr("Location"), tr("Binding"), tr("Format"), tr("Offset"), tr("Go")}); - ui->viAttrs->header()->resizeSection(0, 75); - ui->viAttrs->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->viAttrs->header()->setSectionResizeMode(1, QHeaderView::Stretch); - ui->viAttrs->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->viAttrs->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->viAttrs->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->viAttrs->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->viAttrs->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); + header->setColumnStretchHints({1, 4, 1, 2, 3, 2, -1}); ui->viAttrs->setHoverIconColumn(6, action, action_hover); ui->viAttrs->setClearSelectionOnFocusLoss(true); @@ -181,16 +178,12 @@ VulkanPipelineStateViewer::VulkanPipelineStateViewer(ICaptureContext &ctx, } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->viBuffers->setHeader(header); + ui->viBuffers->setColumns({tr("Slot"), tr("Buffer"), tr("Rate"), tr("Offset"), tr("Stride"), tr("Byte Length"), tr("Go")}); - ui->viBuffers->header()->resizeSection(0, 75); - ui->viBuffers->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->viBuffers->header()->setSectionResizeMode(1, QHeaderView::Stretch); - ui->viBuffers->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->viBuffers->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->viBuffers->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->viBuffers->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->viBuffers->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); + header->setColumnStretchHints({1, 4, 2, 2, 2, 3, -1}); ui->viBuffers->setHoverIconColumn(6, action, action_hover); ui->viBuffers->setClearSelectionOnFocusLoss(true); @@ -199,17 +192,12 @@ VulkanPipelineStateViewer::VulkanPipelineStateViewer(ICaptureContext &ctx, for(RDTreeWidget *res : resources) { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + res->setHeader(header); + res->setColumns({QString(), tr("Set"), tr("Binding"), tr("Type"), tr("Resource"), tr("Contents"), tr("cont.d"), tr("Go")}); - res->header()->resizeSection(0, 30); - res->header()->setSectionResizeMode(0, QHeaderView::Fixed); - res->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - res->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - res->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - res->header()->setSectionResizeMode(4, QHeaderView::Stretch); - res->header()->setSectionResizeMode(5, QHeaderView::Stretch); - res->header()->setSectionResizeMode(6, QHeaderView::Stretch); - res->header()->setSectionResizeMode(7, QHeaderView::ResizeToContents); + header->setColumnStretchHints({-1, -1, 2, 2, 2, 4, 4, -1}); res->setHoverIconColumn(7, action, action_hover); res->setClearSelectionOnFocusLoss(true); @@ -218,16 +206,12 @@ VulkanPipelineStateViewer::VulkanPipelineStateViewer(ICaptureContext &ctx, for(RDTreeWidget *ubo : ubos) { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ubo->setHeader(header); + ubo->setColumns({QString(), tr("Set"), tr("Binding"), tr("Buffer"), tr("Byte Range"), tr("Size"), tr("Go")}); - ubo->header()->resizeSection(0, 30); - ubo->header()->setSectionResizeMode(0, QHeaderView::Fixed); - ubo->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ubo->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ubo->header()->setSectionResizeMode(3, QHeaderView::Stretch); - ubo->header()->setSectionResizeMode(4, QHeaderView::Stretch); - ubo->header()->setSectionResizeMode(5, QHeaderView::Stretch); - ubo->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); + header->setColumnStretchHints({-1, -1, 2, 4, 3, 3, -1}); ubo->setHoverIconColumn(6, action, action_hover); ubo->setClearSelectionOnFocusLoss(true); @@ -235,46 +219,37 @@ VulkanPipelineStateViewer::VulkanPipelineStateViewer(ICaptureContext &ctx, } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->viewports->setHeader(header); + ui->viewports->setColumns( {tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height"), tr("MinDepth"), tr("MaxDepth")}); - ui->viewports->header()->resizeSection(0, 75); - ui->viewports->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->viewports->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->viewports->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); + header->setColumnStretchHints({-1, -1, -1, -1, -1, -1, 1}); + header->setMinimumSectionSize(40); ui->viewports->setClearSelectionOnFocusLoss(true); ui->viewports->setInstantTooltips(true); } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->scissors->setHeader(header); + ui->scissors->setColumns({tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height")}); - ui->scissors->header()->resizeSection(0, 100); - ui->scissors->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->scissors->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ui->scissors->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->scissors->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->scissors->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); + header->setColumnStretchHints({-1, -1, -1, -1, 1}); + header->setMinimumSectionSize(40); ui->scissors->setClearSelectionOnFocusLoss(true); ui->scissors->setInstantTooltips(true); } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->framebuffer->setHeader(header); + ui->framebuffer->setColumns({tr("Slot"), tr("Resource"), tr("Type"), tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), tr("Format"), tr("Go")}); - ui->framebuffer->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); - ui->framebuffer->header()->setSectionResizeMode(1, QHeaderView::Stretch); - ui->framebuffer->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->framebuffer->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->framebuffer->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->framebuffer->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->framebuffer->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); - ui->framebuffer->header()->setSectionResizeMode(7, QHeaderView::ResizeToContents); - ui->framebuffer->header()->setSectionResizeMode(8, QHeaderView::ResizeToContents); + header->setColumnStretchHints({2, 4, 2, 1, 1, 1, 1, 3, -1}); ui->framebuffer->setHoverIconColumn(8, action, action_hover); ui->framebuffer->setClearSelectionOnFocusLoss(true); @@ -282,35 +257,24 @@ VulkanPipelineStateViewer::VulkanPipelineStateViewer(ICaptureContext &ctx, } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->blends->setHeader(header); + ui->blends->setColumns({tr("Slot"), tr("Enabled"), tr("Col Src"), tr("Col Dst"), tr("Col Op"), tr("Alpha Src"), tr("Alpha Dst"), tr("Alpha Op"), tr("Write Mask")}); - ui->blends->header()->resizeSection(0, 75); - ui->blends->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->blends->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(7, QHeaderView::ResizeToContents); - ui->blends->header()->setSectionResizeMode(8, QHeaderView::ResizeToContents); + header->setColumnStretchHints({-1, 1, 2, 2, 2, 2, 2, 2, 1}); ui->blends->setClearSelectionOnFocusLoss(true); ui->blends->setInstantTooltips(true); } { + RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); + ui->stencils->setHeader(header); + ui->stencils->setColumns({tr("Face"), tr("Func"), tr("Fail Op"), tr("Depth Fail Op"), tr("Pass Op"), tr("Write Mask"), tr("Comp Mask"), tr("Ref")}); - ui->stencils->header()->resizeSection(0, 50); - ui->stencils->header()->setSectionResizeMode(0, QHeaderView::Interactive); - ui->stencils->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ui->stencils->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui->stencils->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); - ui->stencils->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents); - ui->stencils->header()->setSectionResizeMode(5, QHeaderView::ResizeToContents); - ui->stencils->header()->setSectionResizeMode(6, QHeaderView::ResizeToContents); - ui->stencils->header()->setSectionResizeMode(7, QHeaderView::Stretch); + header->setColumnStretchHints({1, 2, 2, 2, 2, 1, 1, 1}); ui->stencils->setClearSelectionOnFocusLoss(true); ui->stencils->setInstantTooltips(true);