Skip to content

Commit c9a621a

Browse files
committed
List registers last in shader viewer tables
1 parent 5c73842 commit c9a621a

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

qrenderdoc/Widgets/Extended/RDTreeWidget.h

+2
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ class RDTreeWidget : public RDTreeView
248248
void endUpdate();
249249
void setColumnAlignment(int column, Qt::Alignment align);
250250

251+
int sizeHintForColumn(int column) const { return QTreeView::sizeHintForColumn(column); }
252+
251253
RDTreeWidgetItem *itemForIndex(QModelIndex idx) const;
252254

253255
void copyItem(QPoint pos, RDTreeWidgetItem *item);

qrenderdoc/Windows/ShaderViewer.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,11 @@ void ShaderViewer::debugShader(const ShaderReflection *shader, ResourceId pipeli
656656
ui->watch->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
657657
ui->watch->header()->setSectionResizeMode(3, QHeaderView::Interactive);
658658

659+
// registers last as it can be quite long (easier to do here than modify all the node creation)
660+
ui->sourceVars->header()->moveSection(1, 3);
661+
ui->constants->header()->moveSection(1, 3);
662+
ui->watch->header()->moveSection(1, 3);
663+
659664
ui->watch->header()->resizeSection(0, 80);
660665

661666
ui->watch->setItemDelegate(new FullEditorDelegate(ui->watch));
@@ -4204,6 +4209,9 @@ void ShaderViewer::updateDebugState()
42044209
ui->constants->addTopLevelItem(node);
42054210
}
42064211
}
4212+
4213+
ui->constants->header()->resizeSection(
4214+
3, qMax(ui->constants->header()->sectionSize(3), ui->constants->sizeHintForColumn(3)));
42074215
}
42084216

42094217
{
@@ -4271,6 +4279,9 @@ void ShaderViewer::updateDebugState()
42714279
for(RDTreeWidgetItem *n : nodes)
42724280
ui->sourceVars->addTopLevelItem(n);
42734281

4282+
ui->sourceVars->header()->resizeSection(
4283+
3, qMax(ui->sourceVars->header()->sectionSize(3), ui->sourceVars->sizeHintForColumn(3)));
4284+
42744285
ui->sourceVars->endUpdate();
42754286

42764287
ui->sourceVars->applyExpansion(expansion, 0);
@@ -4698,6 +4709,9 @@ void ShaderViewer::updateWatchVariables()
46984709
item->setTag(QVariant::fromValue(tag));
46994710
}
47004711

4712+
ui->watch->header()->resizeSection(
4713+
3, qMax(ui->watch->header()->sectionSize(3), ui->watch->sizeHintForColumn(3)));
4714+
47014715
ui->watch->endUpdate();
47024716

47034717
ui->watch->applyExpansion(expansion, 0);

0 commit comments

Comments
 (0)