From 07e0eeb5ad9f81a62032aa37c0cfef84a9f6ed5c Mon Sep 17 00:00:00 2001 From: Treeki Date: Tue, 4 Sep 2012 16:25:47 +0200 Subject: the complete beginnings of a material editor, pushing so I can work from my netbook .. --- lslayoutwindow.cpp | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'lslayoutwindow.cpp') diff --git a/lslayoutwindow.cpp b/lslayoutwindow.cpp index 867b6c8..38e0417 100644 --- a/lslayoutwindow.cpp +++ b/lslayoutwindow.cpp @@ -1,6 +1,7 @@ #include "lslayoutwindow.h" #include "lsscenemodel.h" #include "lspaneeditor.h" +#include "lsmaterialeditor.h" #include "layoutgl/widget.h" #include #include @@ -39,11 +40,9 @@ LSLayoutWindow::LSLayoutWindow(LYTPackageBase *pkg, const QString &layoutName, Q connect(m_heightBox, SIGNAL(valueChanged(double)), SLOT(handleHeightChanged(double))); - QGroupBox *matGroup = new QGroupBox("Materials", this); QGroupBox *grpGroup = new QGroupBox("Groups", this); - sgrid->addWidget(matGroup, 1, 0, 1, 1); - sgrid->addWidget(grpGroup, 1, 1, 1, 1); + sgrid->addWidget(grpGroup, 1, 0, 1, 2); sgrid->setRowStretch(1, 1); m_tabWidget->addTab(w, "Layout"); @@ -85,6 +84,29 @@ LSLayoutWindow::LSLayoutWindow(LYTPackageBase *pkg, const QString &layoutName, Q m_tabWidget->addTab(m_sceneSplitter, "Scene Graph"); + // prepare the materials tab + m_materialSplitter = new QSplitter(this); + + w = new QWidget(this); + QGridLayout *mgrid = new QGridLayout(w); + + m_addMaterialButton = new QPushButton("Add", w); + m_removeMaterialButton = new QPushButton("Remove", w); + m_materialList = new QListView(w); + + mgrid->addWidget(m_materialList, 0, 0, 1, 2); + mgrid->addWidget(m_addMaterialButton, 1, 0, 1, 1); + mgrid->addWidget(m_removeMaterialButton, 1, 1, 1, 1); + + m_materialEditor = new LSMaterialEditor(m_materialSplitter); + + m_materialSplitter->addWidget(w); + m_materialSplitter->addWidget(m_materialEditor); + m_materialSplitter->setCollapsible(1, false); + + m_tabWidget->addTab(m_materialSplitter, "Materials"); + + // get the resource m_layout = new LYTLayout(*m_package, m_layoutName); @@ -138,6 +160,10 @@ void LSLayoutWindow::selectedPaneChanged(const QModelIndex ¤t, const QMode m_paneEditorSwitcher->setCurrentIndex(1); } +void LSLayoutWindow::selectedMaterialChanged(const QModelIndex ¤t, const QModelIndex &previous) { + +} + void LSLayoutWindow::handleWidthChanged(double v) { m_layout->width = v; -- cgit v1.2.3