diff --git a/src/designer-plugins/toolbox.cpp b/src/designer-plugins/toolbox.cpp index 909bdf1..c75ef44 100644 --- a/src/designer-plugins/toolbox.cpp +++ b/src/designer-plugins/toolbox.cpp @@ -37,10 +37,8 @@ ToolBox::ToolBox(QWidget * parent) : // Shader views. ui->page_shaders->setLayout(shaderForm_); - shaderForm_->addRow(vertex_.path.label, vertex_.path.value); - shaderForm_->addRow(vertex_.editor); - shaderForm_->addRow(fragment_.path.label, fragment_.path.value); - shaderForm_->addRow(fragment_.editor); + shaderForm_->addRow(reinterpret_cast(&vertex_)); + shaderForm_->addRow(reinterpret_cast(&fragment_)); } void ToolBox::updateFocus(const QString & name) diff --git a/src/designer-plugins/toolbox.h b/src/designer-plugins/toolbox.h index 18a3905..4a172ba 100644 --- a/src/designer-plugins/toolbox.h +++ b/src/designer-plugins/toolbox.h @@ -122,16 +122,23 @@ namespace Qtk }; SpinBoxHorizontal3D transformPanel_, scalePanel_; - class ShaderView + class ShaderView final : QWidget { public: explicit ShaderView(QWidget * parent = nullptr, const char * l = "ShaderView:") : - path(parent, l), editor(new QTextEdit(parent)) + layout(new QVBoxLayout(this)), path(parent, l), + editor(new QTextEdit(parent)) { + auto * pathLayout = new QHBoxLayout; + pathLayout->addWidget(path.label); + pathLayout->addWidget(path.value); + layout->addLayout(pathLayout); + layout->addWidget(editor); editor->setReadOnly(true); } + QVBoxLayout * layout; /// Shader name and path on disk. ObjectDetails::Item path; /// Read-only (for now) display of the shader source code.