Skip to content

Commit

Permalink
List registers last in shader viewer tables
Browse files Browse the repository at this point in the history
  • Loading branch information
baldurk committed Dec 19, 2024
1 parent 5c73842 commit c9a621a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions qrenderdoc/Widgets/Extended/RDTreeWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ class RDTreeWidget : public RDTreeView
void endUpdate();
void setColumnAlignment(int column, Qt::Alignment align);

int sizeHintForColumn(int column) const { return QTreeView::sizeHintForColumn(column); }

RDTreeWidgetItem *itemForIndex(QModelIndex idx) const;

void copyItem(QPoint pos, RDTreeWidgetItem *item);
Expand Down
14 changes: 14 additions & 0 deletions qrenderdoc/Windows/ShaderViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,11 @@ void ShaderViewer::debugShader(const ShaderReflection *shader, ResourceId pipeli
ui->watch->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
ui->watch->header()->setSectionResizeMode(3, QHeaderView::Interactive);

// registers last as it can be quite long (easier to do here than modify all the node creation)
ui->sourceVars->header()->moveSection(1, 3);
ui->constants->header()->moveSection(1, 3);
ui->watch->header()->moveSection(1, 3);

ui->watch->header()->resizeSection(0, 80);

ui->watch->setItemDelegate(new FullEditorDelegate(ui->watch));
Expand Down Expand Up @@ -4204,6 +4209,9 @@ void ShaderViewer::updateDebugState()
ui->constants->addTopLevelItem(node);
}
}

ui->constants->header()->resizeSection(
3, qMax(ui->constants->header()->sectionSize(3), ui->constants->sizeHintForColumn(3)));
}

{
Expand Down Expand Up @@ -4271,6 +4279,9 @@ void ShaderViewer::updateDebugState()
for(RDTreeWidgetItem *n : nodes)
ui->sourceVars->addTopLevelItem(n);

ui->sourceVars->header()->resizeSection(
3, qMax(ui->sourceVars->header()->sectionSize(3), ui->sourceVars->sizeHintForColumn(3)));

ui->sourceVars->endUpdate();

ui->sourceVars->applyExpansion(expansion, 0);
Expand Down Expand Up @@ -4698,6 +4709,9 @@ void ShaderViewer::updateWatchVariables()
item->setTag(QVariant::fromValue(tag));
}

ui->watch->header()->resizeSection(
3, qMax(ui->watch->header()->sectionSize(3), ui->watch->sizeHintForColumn(3)));

ui->watch->endUpdate();

ui->watch->applyExpansion(expansion, 0);
Expand Down

0 comments on commit c9a621a

Please sign in to comment.