issue #0004188: Editing a subtractive box in PartDesign doesn't show the shaded box

This commit is contained in:
wmayer
2020-01-15 10:00:47 +01:00
parent 798edb8a55
commit 0a5028f181
3 changed files with 4 additions and 14 deletions

View File

@@ -109,11 +109,11 @@ void TaskAttacher::makeRefStrings(std::vector<QString>& refstrings, std::vector<
}
TaskAttacher::TaskAttacher(Gui::ViewProviderDocumentObject *ViewProvider, QWidget *parent,
QString picture, QString text)
QString picture, QString text, TaskAttacher::VisibilityFunction visFunc)
: TaskBox(Gui::BitmapFactory().pixmap(picture.toLatin1()), text, true, parent),
SelectionObserver(ViewProvider),
ViewProvider(ViewProvider),
visibilityFunc(0)
visibilityFunc(visFunc)
{
//check if we are attachable
if (!ViewProvider->getObject()->hasExtension(Part::AttachExtension::getExtensionClassTypeId()))

View File

@@ -57,7 +57,7 @@ public:
TaskAttacher(Gui::ViewProviderDocumentObject *ViewProvider, QWidget *parent = 0,
QString picture = QString(),
QString text = QString::fromLatin1("Attachment"));
QString text = QString::fromLatin1("Attachment"), VisibilityFunction func = 0);
~TaskAttacher();
bool getFlip(void) const;
@@ -69,15 +69,6 @@ public:
*/
Attacher::eMapMode getActiveMapMode();
/**
* @brief setCustomVisibilityAutomation sets a customized function
* in order to allow to handle visibility automation differently than
* the default implementation.
*/
void setCustomVisibilityAutomation(VisibilityFunction func) {
visibilityFunc = func;
}
bool isCompleted() const { return completed; }
private Q_SLOTS:

View File

@@ -690,8 +690,7 @@ TaskPrimitiveParameters::TaskPrimitiveParameters(ViewProviderPrimitive* Primitiv
}
};
parameter = new PartGui::TaskAttacher(PrimitiveView);
parameter->setCustomVisibilityAutomation(customvisfunc);
parameter = new PartGui::TaskAttacher(PrimitiveView, nullptr, QString(), tr("Attachment"), customvisfunc);
Content.push_back(parameter);
}