summaryrefslogtreecommitdiff
path: root/lsmaterialeditor.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 /lsmaterialeditor.cpp
parent824b2fa6b700ec7b50f0388b649480a689cf22f3 (diff)
downloadLayoutStudio-f928869357765e3a73501064408bb7bc0ee363ef.tar.gz
LayoutStudio-f928869357765e3a73501064408bb7bc0ee363ef.zip
improving the material editor
Diffstat (limited to 'lsmaterialeditor.cpp')
-rw-r--r--lsmaterialeditor.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/lsmaterialeditor.cpp b/lsmaterialeditor.cpp
index 20f36f5..f1c5736 100644
--- a/lsmaterialeditor.cpp
+++ b/lsmaterialeditor.cpp
@@ -1,4 +1,5 @@
#include "lsmaterialeditor.h"
+#include <QGroupBox>
LSMaterialEditor::LSMaterialEditor(QWidget *parent) :
QWidget(parent) {
@@ -10,6 +11,25 @@ LSMaterialEditor::LSMaterialEditor(QWidget *parent) :
grid->addWidget(new QLabel("Name:", this), 0, 0, 1, 1);
grid->addWidget(m_nameEntry, 0, 1, 1, 1);
+ // TEV colour box
+ QGroupBox *tevCBox = new QGroupBox("TEV Colours", this);
+ QGridLayout *tevCLayout = new QGridLayout(tevCBox);
+
+ tevCLayout->addWidget(new QLabel("Registers:", tevCBox), 0, 0, 1, 4);
+ tevCLayout->addWidget(new QLabel("Constant:", tevCBox), 2, 0, 1, 4);
+
+ for (int i = 0; i < 7; i++) {
+ m_colourPickers[i] = new LSColorPicker(tevCBox);
+ bool isKonst = (i >= 3);
+ tevCLayout->addWidget(m_colourPickers[i], isKonst?3:1, isKonst?(i-3):i, 1, 1);
+ }
+
+ grid->addWidget(tevCBox, 1, 0, 1, 2);
+
+
+ grid->setRowStretch(2, 1);
+
+
m_currentlyLoadingMaterial = false;
m_material = 0;
}
@@ -18,6 +38,13 @@ void LSMaterialEditor::setMaterial(LYTMaterial *mat) {
m_currentlyLoadingMaterial = true;
m_material = mat;
+ m_nameEntry->setText(mat->name);
+
+ for (int i = 0; i < 3; i++)
+ m_colourPickers[i]->setColor(mat->colours[i]);
+ for (int i = 0; i < 4; i++)
+ m_colourPickers[i+3]->setColor(mat->tevKColour[i]);
+
m_currentlyLoadingMaterial = false;
}
@@ -29,3 +56,7 @@ void LSMaterialEditor::handleNameChanged(QString value) {
void LSMaterialEditor::handleSaveChangedName() {
}
+
+void LSMaterialEditor::handleColourPicked(QColor value) {
+
+}