Skip to content

Commit

Permalink
Add mirrored configure UI
Browse files Browse the repository at this point in the history
  • Loading branch information
huxingyi committed Feb 11, 2023
1 parent 59a119c commit 0b58867
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions application/sources/component_property_widget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,19 @@ ComponentPropertyWidget::ComponentPropertyWidget(Document* document,
emit groupOperationAdded();
});

QCheckBox* mirrorStateBox = new QCheckBox();
Theme::initCheckbox(mirrorStateBox);
mirrorStateBox->setText(tr("Mirrored"));
mirrorStateBox->setChecked(m_part->xMirrored);

connect(mirrorStateBox, &QCheckBox::stateChanged, this, [=]() {
emit setPartXmirrorState(m_partId, mirrorStateBox->isChecked());
emit groupOperationAdded();
});

QHBoxLayout* deformUnifyLayout = new QHBoxLayout;
deformUnifyLayout->addStretch();
deformUnifyLayout->addWidget(mirrorStateBox);
deformUnifyLayout->addWidget(deformUnifyStateBox);

deformLayout->addLayout(thicknessLayout);
Expand Down Expand Up @@ -414,6 +425,7 @@ ComponentPropertyWidget::ComponentPropertyWidget(Document* document,
connect(this, &ComponentPropertyWidget::setPartSmoothCutoffDegrees, m_document, &Document::setPartSmoothCutoffDegrees);
connect(this, &ComponentPropertyWidget::setPartCutFace, m_document, &Document::setPartCutFace);
connect(this, &ComponentPropertyWidget::setPartCutFaceLinkedId, m_document, &Document::setPartCutFaceLinkedId);
connect(this, &ComponentPropertyWidget::setPartXmirrorState, m_document, &Document::setPartXmirrorState);
connect(this, &ComponentPropertyWidget::setComponentCombineMode, m_document, &Document::setComponentCombineMode);
connect(this, &ComponentPropertyWidget::groupOperationAdded, m_document, &Document::saveSnapshot);

Expand Down
1 change: 1 addition & 0 deletions application/sources/component_property_widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class ComponentPropertyWidget : public QWidget {
void setPartSmoothCutoffDegrees(const dust3d::Uuid& partId, float degrees);
void setPartCutFace(const dust3d::Uuid& partId, dust3d::CutFace cutFace);
void setPartCutFaceLinkedId(const dust3d::Uuid& partId, dust3d::Uuid linkedId);
void setPartXmirrorState(dust3d::Uuid partId, bool mirrored);
void setComponentCombineMode(dust3d::Uuid componentId, dust3d::CombineMode combineMode);
void groupOperationAdded();

Expand Down

0 comments on commit 0b58867

Please sign in to comment.