From 7dd4238eb0effd0e77566b7d6b31ed5f6a611a10 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 26 Apr 2018 11:35:09 +0100 Subject: [PATCH] Allow resize/rearrange of panels in resource inspector via docking --- qrenderdoc/Windows/ResourceInspector.cpp | 36 ++ qrenderdoc/Windows/ResourceInspector.ui | 570 +++++++++++------------ 2 files changed, 321 insertions(+), 285 deletions(-) diff --git a/qrenderdoc/Windows/ResourceInspector.cpp b/qrenderdoc/Windows/ResourceInspector.cpp index b0a4c1cfc..dac821763 100644 --- a/qrenderdoc/Windows/ResourceInspector.cpp +++ b/qrenderdoc/Windows/ResourceInspector.cpp @@ -24,6 +24,7 @@ #include "ResourceInspector.h" #include +#include "3rdparty/toolwindowmanager/ToolWindowManagerArea.h" #include "Widgets/Extended/RDHeaderView.h" #include "ui_ResourceInspector.h" @@ -140,6 +141,41 @@ ResourceInspector::ResourceInspector(ICaptureContext &ctx, QWidget *parent) QObject::connect(ui->relatedResources, &QTreeView::activated, this, &ResourceInspector::resource_doubleClicked); + ui->dockarea->addToolWindow(ui->resourceListWidget, ToolWindowManager::EmptySpace); + ui->dockarea->setToolWindowProperties(ui->resourceListWidget, ToolWindowManager::HideCloseButton); + + ui->dockarea->addToolWindow( + ui->relatedResources, + ToolWindowManager::AreaReference(ToolWindowManager::LeftOf, + ui->dockarea->areaOf(ui->resourceListWidget), 0.75f)); + ui->dockarea->setToolWindowProperties(ui->relatedResources, ToolWindowManager::HideCloseButton); + + ui->dockarea->addToolWindow(ui->initChunks, ToolWindowManager::AreaReference( + ToolWindowManager::BottomOf, + ui->dockarea->areaOf(ui->relatedResources), 0.5f)); + ui->dockarea->setToolWindowProperties(ui->initChunks, ToolWindowManager::HideCloseButton); + + ui->dockarea->addToolWindow( + ui->resourceUsage, + ToolWindowManager::AreaReference(ToolWindowManager::RightOf, + ui->dockarea->areaOf(ui->relatedResources), 0.5f)); + ui->dockarea->setToolWindowProperties(ui->resourceUsage, ToolWindowManager::HideCloseButton); + + ui->dockarea->setAllowFloatingWindow(false); + + ui->relatedResources->setWindowTitle(tr("Related Resources")); + ui->initChunks->setWindowTitle(tr("Resource Initialisation Parameters")); + ui->resourceUsage->setWindowTitle(tr("Usage in Frame")); + ui->resourceListWidget->setWindowTitle(tr("Resource List")); + + QVBoxLayout *vertical = new QVBoxLayout(this); + + vertical->setSpacing(3); + vertical->setContentsMargins(3, 3, 3, 3); + + vertical->addWidget(ui->titleWidget); + vertical->addWidget(ui->dockarea); + Inspect(ResourceId()); m_Ctx.AddCaptureViewer(this); diff --git a/qrenderdoc/Windows/ResourceInspector.ui b/qrenderdoc/Windows/ResourceInspector.ui index 1b75fad25..783a9fb11 100644 --- a/qrenderdoc/Windows/ResourceInspector.ui +++ b/qrenderdoc/Windows/ResourceInspector.ui @@ -13,308 +13,303 @@ Resource Inspector - - - - - - - - 20 - - - - Resource Name Here - - - - - - - - 20 - - - - - - - - Rename resource - - - - :/page_white_edit.png:/page_white_edit.png - - - Qt::ToolButtonTextBesideIcon - - - true - - - - - - - Reset name - - - - :/arrow_undo.png:/arrow_undo.png - - - Qt::ToolButtonTextBesideIcon - - - true - - - - - - - View Contents - - - - :/action_hover.png:/action_hover.png - - - Qt::ToolButtonTextBesideIcon - - - true - - - - - - - - - - 1 - 0 - - - - Resource List - - + + + + 615 + 346 + 191 + 241 + + + + + 1 + 0 + + + + + 6 + + + 3 + + + 3 + + + 3 + + + 3 + + + - 6 - - - 3 - - - 3 - - - 3 - - - 3 + 0 - - - 0 - - - - - - 0 - 0 - - - - - - - - - - - - :/cross.png:/cross.png - - - true - - - - - - - - - QFrame::Box - - - QFrame::Sunken - - - QAbstractItemView::NoEditTriggers - - - false - - - Qt::CopyAction - - - QAbstractItemView::SelectRows - - - QListView::ListMode - - - true - - - - - - - - - - - 0 - 3 - - - - Related Resources - - - - 3 - - - 3 - - - 3 - - - 3 - - - + - + 0 - 1 + 0 - - QAbstractItemView::SelectRows - - - false - - - - - - - - - 0 - 3 - - - - Usage in Frame - - - - 3 - - - 3 - - - 3 - - - 3 - - - - Qt::ScrollBarAlwaysOn + + + - - QAbstractItemView::SelectRows + + + :/cross.png:/cross.png - - false - - - - - - - - - - - 2 - 5 - - - - Resource Initialisation Parameters - - - - 3 - - - 3 - - - 3 - - - 3 - - - - - QAbstractItemView::NoEditTriggers - - - false - - - QAbstractItemView::ContiguousSelection - - - 20 - - - true - - - true - - + true - - - + + + + + QFrame::Box + + + QFrame::Sunken + + + QAbstractItemView::NoEditTriggers + + + false + + + Qt::CopyAction + + + QAbstractItemView::SelectRows + + + QListView::ListMode + + + true + + + + + + + + + 420 + 450 + 119 + 100 + + + + + 0 + 0 + + + + + 100 + 100 + + + + false + + + + + + 10 + 10 + 800 + 39 + + + + + 3 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 20 + + + + Resource Name Here + + + + + + + + 20 + + + + + + + + Rename resource + + + + :/page_white_edit.png:/page_white_edit.png + + + Qt::ToolButtonTextBesideIcon + + + true + + + + + + + Reset name + + + + :/arrow_undo.png:/arrow_undo.png + + + Qt::ToolButtonTextBesideIcon + + + true + + + + + + + View Contents + + + + :/action_hover.png:/action_hover.png + + + Qt::ToolButtonTextBesideIcon + + + true + + + + + + + + + 60 + 340 + 256 + 192 + + + + QFrame::NoFrame + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::ContiguousSelection + + + 20 + + + true + + + true + + + true + + + + + + 70 + 80 + 310 + 174 + + + + + 0 + 1 + + + + QFrame::NoFrame + + + QAbstractItemView::SelectRows + + + false + + + + + + 460 + 90 + 310 + 174 + + + + QFrame::NoFrame + + + Qt::ScrollBarAlwaysOn + + + QAbstractItemView::SelectRows + + + false + + @@ -332,6 +327,11 @@ QListView
Widgets/Extended/RDListView.h
+ + ToolWindowManager + QWidget +
3rdparty/toolwindowmanager/ToolWindowManager.h
+