summaryrefslogtreecommitdiff
path: root/lslayoutwindow.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-09-05 01:36:57 +0200
committerTreeki <treeki@gmail.com>2012-09-05 01:36:57 +0200
commitf928869357765e3a73501064408bb7bc0ee363ef (patch)
tree1c75962f64e4a7bfc38315c21ccadd83092aa0d4 /lslayoutwindow.cpp
parent824b2fa6b700ec7b50f0388b649480a689cf22f3 (diff)
downloadLayoutStudio-f928869357765e3a73501064408bb7bc0ee363ef.tar.gz
LayoutStudio-f928869357765e3a73501064408bb7bc0ee363ef.zip
improving the material editor
Diffstat (limited to '')
-rw-r--r--lslayoutwindow.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lslayoutwindow.cpp b/lslayoutwindow.cpp
index 38e0417..3323803 100644
--- a/lslayoutwindow.cpp
+++ b/lslayoutwindow.cpp
@@ -1,5 +1,6 @@
#include "lslayoutwindow.h"
#include "lsscenemodel.h"
+#include "lsmaterialmodel.h"
#include "lspaneeditor.h"
#include "lsmaterialeditor.h"
#include "layoutgl/widget.h"
@@ -123,6 +124,12 @@ LSLayoutWindow::LSLayoutWindow(LYTPackageBase *pkg, const QString &layoutName, Q
m_sceneGraph->expandAll();
connect(m_sceneGraph->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), SLOT(selectedPaneChanged(QModelIndex,QModelIndex)));
+ LSMaterialModel *matModel = new LSMaterialModel(&m_layout->materials, this);
+
+ m_materialList->setSelectionMode(QAbstractItemView::SingleSelection);
+ m_materialList->setModel(matModel);
+ connect(m_materialList->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), SLOT(selectedMaterialChanged(QModelIndex,QModelIndex)));
+
setWindowTitle(m_layoutName);
@@ -161,7 +168,10 @@ void LSLayoutWindow::selectedPaneChanged(const QModelIndex &current, const QMode
}
void LSLayoutWindow::selectedMaterialChanged(const QModelIndex &current, const QModelIndex &previous) {
+ (void)previous;
+ LYTMaterial *mat = m_layout->materials.getMaterialByIndex(current.row());
+ m_materialEditor->setMaterial(mat);
}