Fix cut face list button state
parent
2800bf7c46
commit
ae478fc064
|
@ -1820,11 +1820,11 @@ void DocumentWindow::showCutFaceSettingPopup(const QPoint &globalPos, std::set<Q
|
||||||
QPushButton *buttons[(int)CutFace::Count] = {0};
|
QPushButton *buttons[(int)CutFace::Count] = {0};
|
||||||
|
|
||||||
CutFaceListWidget *cutFaceListWidget = new CutFaceListWidget(m_document);
|
CutFaceListWidget *cutFaceListWidget = new CutFaceListWidget(m_document);
|
||||||
size_t cutFaceTypeCount = (size_t)CutFace::Count;
|
size_t cutFaceTypeCount = (size_t)CutFace::UserDefined;
|
||||||
if (cutFaceListWidget->isEmpty())
|
|
||||||
cutFaceTypeCount = (size_t)CutFace::UserDefined;
|
|
||||||
|
|
||||||
auto updateCutFaceButtonState = [&](size_t index) {
|
auto updateCutFaceButtonState = [&](size_t index) {
|
||||||
|
if (index != (int)CutFace::UserDefined)
|
||||||
|
cutFaceListWidget->selectCutFace(QUuid());
|
||||||
for (size_t i = 0; i < (size_t)cutFaceTypeCount; ++i) {
|
for (size_t i = 0; i < (size_t)cutFaceTypeCount; ++i) {
|
||||||
auto button = buttons[i];
|
auto button = buttons[i];
|
||||||
if (i == index) {
|
if (i == index) {
|
||||||
|
@ -1835,8 +1835,6 @@ void DocumentWindow::showCutFaceSettingPopup(const QPoint &globalPos, std::set<Q
|
||||||
button->setEnabled(true);
|
button->setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (index != (int)CutFace::UserDefined)
|
|
||||||
cutFaceListWidget->selectCutFace(QUuid());
|
|
||||||
};
|
};
|
||||||
|
|
||||||
cutFaceListWidget->enableMultipleSelection(false);
|
cutFaceListWidget->enableMultipleSelection(false);
|
||||||
|
|
|
@ -558,11 +558,11 @@ void PartWidget::showCutRotationSettingPopup(const QPoint &pos)
|
||||||
QPushButton *buttons[(int)CutFace::Count] = {0};
|
QPushButton *buttons[(int)CutFace::Count] = {0};
|
||||||
|
|
||||||
CutFaceListWidget *cutFaceListWidget = new CutFaceListWidget(m_document);
|
CutFaceListWidget *cutFaceListWidget = new CutFaceListWidget(m_document);
|
||||||
size_t cutFaceTypeCount = (size_t)CutFace::Count;
|
size_t cutFaceTypeCount = (size_t)CutFace::UserDefined;
|
||||||
if (cutFaceListWidget->isEmpty())
|
|
||||||
cutFaceTypeCount = (size_t)CutFace::UserDefined;
|
|
||||||
|
|
||||||
auto updateCutFaceButtonState = [&](size_t index) {
|
auto updateCutFaceButtonState = [&](size_t index) {
|
||||||
|
if (index != (int)CutFace::UserDefined)
|
||||||
|
cutFaceListWidget->selectCutFace(QUuid());
|
||||||
for (size_t i = 0; i < (size_t)cutFaceTypeCount; ++i) {
|
for (size_t i = 0; i < (size_t)cutFaceTypeCount; ++i) {
|
||||||
auto button = buttons[i];
|
auto button = buttons[i];
|
||||||
if (i == index) {
|
if (i == index) {
|
||||||
|
@ -573,8 +573,6 @@ void PartWidget::showCutRotationSettingPopup(const QPoint &pos)
|
||||||
button->setEnabled(true);
|
button->setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (index != (int)CutFace::UserDefined)
|
|
||||||
cutFaceListWidget->selectCutFace(QUuid());
|
|
||||||
};
|
};
|
||||||
|
|
||||||
cutFaceListWidget->enableMultipleSelection(false);
|
cutFaceListWidget->enableMultipleSelection(false);
|
||||||
|
|
Loading…
Reference in New Issue