src/dialogs/subfilereferenceeditor.cpp

changeset 1298
dbc8bb2a4d84
parent 1297
389516787a4c
child 1299
b692088dc1a6
--- a/src/dialogs/subfilereferenceeditor.cpp	Sun Mar 18 12:00:39 2018 +0200
+++ b/src/dialogs/subfilereferenceeditor.cpp	Sun Mar 18 12:33:29 2018 +0200
@@ -3,6 +3,7 @@
 #include "../linetypes/modelobject.h"
 #include "../primitives.h"
 #include "../guiutilities.h"
+#include "../dialogs/colorselector.h"
 
 SubfileReferenceEditor::SubfileReferenceEditor(LDSubfileReference* reference, QWidget* parent) :
 	QDialog {parent},
@@ -15,7 +16,17 @@
 	this->ui.positionX->setValue(reference->position().x());
 	this->ui.positionY->setValue(reference->position().y());
 	this->ui.positionZ->setValue(reference->position().z());
-	::setupColorButton(parent, this->ui.colorButton, &this->color);
+
+	connect(
+		this->ui.colorButton,
+		&QPushButton::clicked,
+		[&]()
+		{
+			if (ColorSelector::selectColor(this, this->color, this->color))
+				::setColorButton(this->ui.colorButton, this->color);
+		}
+	);
+
 	for (int i : {0, 1, 2})
 	for (int j : {0, 1, 2})
 	{

mercurial