# HG changeset patch # User Teemu Piippo # Date 1655931066 -10800 # Node ID fe094d0687ad2834aafcebd45626fcc272c29ff6 # Parent afdab56e8210fd95d2b3c975ed56e8d5994eae6b Add widgets to object editor diff -r afdab56e8210 -r fe094d0687ad src/ui/objecteditor.cpp --- a/src/ui/objecteditor.cpp Wed Jun 22 23:32:34 2022 +0300 +++ b/src/ui/objecteditor.cpp Wed Jun 22 23:51:06 2022 +0300 @@ -119,14 +119,4 @@ QWidget{parent} { this->ui.setupUi(this); - this->editorwidgets.resize(NUM_PROPERTIES); - QFormLayout* layout = new QFormLayout{this}; - for (std::size_t i = 0; i < NUM_PROPERTIES; ++i) { - const auto key = static_cast(i); - QLabel* const label = new QLabel{propertyName(key), this}; - QWidget* const field = new QWidget{this}; - this->editorwidgets[i] = field; - layout->addRow(label, field); - } - this->ui.properties->setLayout(layout); } diff -r afdab56e8210 -r fe094d0687ad src/ui/objecteditor.ui --- a/src/ui/objecteditor.ui Wed Jun 22 23:32:34 2022 +0300 +++ b/src/ui/objecteditor.ui Wed Jun 22 23:51:06 2022 +0300 @@ -6,8 +6,8 @@ 0 0 - 492 - 336 + 941 + 400 @@ -24,42 +24,183 @@ 0 0 - 472 - 316 + 908 + 857 - + - + - - - <icon> - - + + + + + <icon> + + + + + + + font-weight: bold + + + Object + + + + - - - font-weight: bold + + + Properties - - Object - + + + + + Point 1 + + + point1Label + + + + + + + + + + Point 2 + + + point2Label + + + + + + + + + + Point 3 + + + + + + + + + + Point 4 + + + + + + + + + + Control 1 + + + + + + + + + + Control 2 + + + + + + + + + + Transform + + + + + + + + + + Name + + + name + + + + + + + Text + + + text + + + + + + + Code + + + code + + + + + + + Fraction + + + + + + + + + + + + + + + + Colour + + + color + + + + + + + - - - Properties - - - - Qt::Vertical @@ -93,6 +234,24 @@ + + + VectorInput + QWidget +
vec3editor.h
+
+ + MatrixEditor + QWidget +
matrixeditor.h
+
+ + ColorIndexInput + QWidget +
widgets/colorindexinput.h
+ 1 +
+
diff -r afdab56e8210 -r fe094d0687ad src/widgets/colorindexinput.cpp --- a/src/widgets/colorindexinput.cpp Wed Jun 22 23:32:34 2022 +0300 +++ b/src/widgets/colorindexinput.cpp Wed Jun 22 23:51:06 2022 +0300 @@ -3,11 +3,12 @@ #include "colorselectdialog.h" #include "uiutilities.h" -ColorIndexInput::ColorIndexInput(ColorTable *colorTable, ColorIndex color, QWidget *parent) : +ColorIndexInput::ColorIndexInput(QWidget *parent) : QWidget{parent}, - colorTable{colorTable}, ui{*new Ui_ColorIndexInput} { + static const ColorTable emptyColorTable; + this->colorTable = &emptyColorTable; this->ui.setupUi(this); connect(this->ui.button, &QPushButton::clicked, [this]() { @@ -28,7 +29,7 @@ } Q_EMIT this->colorChanged({value}); }); - this->ui.index->setValue(color.index); + this->ui.index->setValue(MAIN_COLOR.index); } ColorIndexInput::~ColorIndexInput() diff -r afdab56e8210 -r fe094d0687ad src/widgets/colorindexinput.h --- a/src/widgets/colorindexinput.h Wed Jun 22 23:32:34 2022 +0300 +++ b/src/widgets/colorindexinput.h Wed Jun 22 23:51:06 2022 +0300 @@ -4,14 +4,14 @@ class ColorIndexInput : public QWidget { Q_OBJECT + const ColorTable* colorTable = nullptr; + class Ui_ColorIndexInput& ui; public: - ColorIndexInput(ColorTable *colorTable, ColorIndex color = MAIN_COLOR, QWidget *parent = nullptr); + ColorIndexInput(QWidget *parent = nullptr); ~ColorIndexInput(); ldraw::Color selectedColor() const; void setSelectedColor(ldraw::Color color); Q_SIGNALS: void colorChanged(ldraw::Color color); private: - ColorTable* const colorTable; - class Ui_ColorIndexInput& ui; }; diff -r afdab56e8210 -r fe094d0687ad src/widgets/colorindexinput.ui --- a/src/widgets/colorindexinput.ui Wed Jun 22 23:32:34 2022 +0300 +++ b/src/widgets/colorindexinput.ui Wed Jun 22 23:51:06 2022 +0300 @@ -7,7 +7,7 @@ 0 0 370 - 47 + 53 diff -r afdab56e8210 -r fe094d0687ad src/widgets/colorselectdialog.ui --- a/src/widgets/colorselectdialog.ui Wed Jun 22 23:32:34 2022 +0300 +++ b/src/widgets/colorselectdialog.ui Wed Jun 22 23:51:06 2022 +0300 @@ -33,8 +33,8 @@ 0 0 - 732 - 329 + 730 + 285