Part: make changing face colors independent of edit-mode implementation of a view provider

This commit is contained in:
wmayer
2020-10-13 14:16:01 +02:00
parent 048da48080
commit f81c1cd31f
4 changed files with 21 additions and 35 deletions

View File

@@ -962,21 +962,26 @@ void ViewProviderPartExt::setupContextMenu(QMenu* menu, QObject* receiver, const
act->setData(QVariant((int)ViewProvider::Color));
}
bool ViewProviderPartExt::changeFaceColors()
{
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
if (dlg) {
Gui::Control().showDialog(dlg);
return false;
}
Gui::Selection().clearSelection();
Gui::Control().showDialog(new TaskFaceColors(this));
return true;
}
bool ViewProviderPartExt::setEdit(int ModNum)
{
if (ModNum == ViewProvider::Color) {
// When double-clicking on the item for this pad the
// object unsets and sets its edit mode without closing
// the task panel
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
if (dlg) {
Gui::Control().showDialog(dlg);
return false;
}
Gui::Selection().clearSelection();
Gui::Control().showDialog(new TaskFaceColors(this));
return true;
return changeFaceColors();
}
else {
return Gui::ViewProviderGeometryObject::setEdit(ModNum);