Skip to content

Commit

Permalink
Hide stitching line configure for normal components
Browse files Browse the repository at this point in the history
  • Loading branch information
huxingyi committed Feb 5, 2023
1 parent bba0d36 commit f54fbcf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
20 changes: 19 additions & 1 deletion application/sources/component_property_widget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ ComponentPropertyWidget::ComponentPropertyWidget(Document* document,
skinLayout->addWidget(colorImageGroupBox);

QGroupBox* stitchingLineGroupBox = nullptr;
if (!m_componentIds.empty()) {
if (!m_componentIds.empty() && hasStitchingLineConfigure()) {
QCheckBox* closeStateBox = new QCheckBox();
Theme::initCheckbox(closeStateBox);
closeStateBox->setText(tr("Closed"));
Expand Down Expand Up @@ -557,3 +557,21 @@ void ComponentPropertyWidget::showColorDialog()
}
emit groupOperationAdded();
}

bool ComponentPropertyWidget::hasStitchingLineConfigure()
{
for (const auto& componentId : m_componentIds) {
const Document::Component* component = m_document->findComponent(componentId);
if (nullptr != component) {
for (const auto& childId : component->childrenIds) {
const Document::Component* child = m_document->findComponent(childId);
if (nullptr != child) {
const Document::Part* part = m_document->findPart(child->linkToPartId);
if (dust3d::PartTarget::StitchingLine == part->target)
return true;
}
}
}
}
return false;
}
1 change: 1 addition & 0 deletions application/sources/component_property_widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public slots:
std::vector<QString> m_cutFaceList;

void updateCutFaceButtonState(size_t index);
bool hasStitchingLineConfigure();
};

#endif

0 comments on commit f54fbcf

Please sign in to comment.