All: Reformat according to new standard
This commit is contained in:
committed by
Kacper Donat
parent
eafd18dac0
commit
25c3ba7338
@@ -22,8 +22,8 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
# include <QAction>
|
||||
# include <QMenu>
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
|
||||
#include <Gui/ActionFunction.h>
|
||||
#include <Gui/BitmapFactory.h>
|
||||
@@ -44,24 +44,27 @@ ViewProviderAttachExtension::ViewProviderAttachExtension()
|
||||
initExtensionType(ViewProviderAttachExtension::getExtensionClassTypeId());
|
||||
}
|
||||
|
||||
QIcon ViewProviderAttachExtension::extensionMergeColorfullOverlayIcons (const QIcon & orig) const
|
||||
QIcon ViewProviderAttachExtension::extensionMergeColorfullOverlayIcons(const QIcon& orig) const
|
||||
{
|
||||
QIcon mergedicon = orig;
|
||||
|
||||
if (getExtendedViewProvider()->getObject()->hasExtension(Part::AttachExtension::getExtensionClassTypeId())) {
|
||||
if (getExtendedViewProvider()->getObject()->hasExtension(
|
||||
Part::AttachExtension::getExtensionClassTypeId()
|
||||
)) {
|
||||
|
||||
auto* attach = getExtendedViewProvider()->getObject()->getExtensionByType<Part::AttachExtension>();
|
||||
auto* attach
|
||||
= getExtendedViewProvider()->getObject()->getExtensionByType<Part::AttachExtension>();
|
||||
|
||||
if (attach) {
|
||||
|
||||
if(!attach->isAttacherActive()) {
|
||||
static QPixmap px(
|
||||
Gui::BitmapFactory().pixmapFromSvg("Part_Detached", QSize(10, 10)));
|
||||
if (!attach->isAttacherActive()) {
|
||||
static QPixmap px(Gui::BitmapFactory().pixmapFromSvg("Part_Detached", QSize(10, 10)));
|
||||
|
||||
mergedicon =
|
||||
Gui::BitmapFactoryInst::mergePixmap(mergedicon,
|
||||
px,
|
||||
Gui::BitmapFactoryInst::BottomLeft);
|
||||
mergedicon = Gui::BitmapFactoryInst::mergePixmap(
|
||||
mergedicon,
|
||||
px,
|
||||
Gui::BitmapFactoryInst::BottomLeft
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -75,37 +78,37 @@ void ViewProviderAttachExtension::extensionUpdateData(const App::Property* prop)
|
||||
if (obj && obj->hasExtension(Part::AttachExtension::getExtensionClassTypeId())) {
|
||||
auto* attach = obj->getExtensionByType<Part::AttachExtension>();
|
||||
|
||||
if(attach) {
|
||||
if( prop == &(attach->AttachmentSupport) ||
|
||||
prop == &(attach->MapMode) ||
|
||||
prop == &(attach->MapPathParameter) ||
|
||||
prop == &(attach->MapReversed) ||
|
||||
prop == &(attach->AttachmentOffset) ||
|
||||
prop == &(attach->AttacherType) ) {
|
||||
if (attach) {
|
||||
if (prop == &(attach->AttachmentSupport) || prop == &(attach->MapMode)
|
||||
|| prop == &(attach->MapPathParameter) || prop == &(attach->MapReversed)
|
||||
|| prop == &(attach->AttachmentOffset) || prop == &(attach->AttacherType)) {
|
||||
|
||||
getExtendedViewProvider()->signalChangeIcon(); // signal icon change
|
||||
getExtendedViewProvider()->signalChangeIcon(); // signal icon change
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void ViewProviderAttachExtension::extensionSetupContextMenu(QMenu* menu, QObject*, const char*)
|
||||
{
|
||||
bool attach = getExtendedViewProvider()->getObject()->hasExtension(Part::AttachExtension::getExtensionClassTypeId());
|
||||
bool attach = getExtendedViewProvider()->getObject()->hasExtension(
|
||||
Part::AttachExtension::getExtensionClassTypeId()
|
||||
);
|
||||
if (attach) {
|
||||
// toggle command to display components
|
||||
Gui::ActionFunction* func = new Gui::ActionFunction(menu);
|
||||
QAction* act = menu->addAction(QObject::tr("Attachment Editor"));
|
||||
if (Gui::Control().activeDialog())
|
||||
if (Gui::Control().activeDialog()) {
|
||||
act->setDisabled(true);
|
||||
func->trigger(act, [this](){
|
||||
this->showAttachmentEditor();
|
||||
});
|
||||
}
|
||||
func->trigger(act, [this]() { this->showAttachmentEditor(); });
|
||||
}
|
||||
}
|
||||
|
||||
void ViewProviderAttachExtension::showAttachmentEditor(std::function<void()> onAccept, std::function<void()> onReject)
|
||||
void ViewProviderAttachExtension::showAttachmentEditor(
|
||||
std::function<void()> onAccept,
|
||||
std::function<void()> onReject
|
||||
)
|
||||
{
|
||||
if (Gui::Control().activeDialog()) {
|
||||
Gui::Control().closeDialog();
|
||||
@@ -115,9 +118,13 @@ void ViewProviderAttachExtension::showAttachmentEditor(std::function<void()> onA
|
||||
Gui::Control().showDialog(task);
|
||||
}
|
||||
|
||||
namespace Gui {
|
||||
EXTENSION_PROPERTY_SOURCE_TEMPLATE(PartGui::ViewProviderAttachExtensionPython, PartGui::ViewProviderAttachExtension)
|
||||
namespace Gui
|
||||
{
|
||||
EXTENSION_PROPERTY_SOURCE_TEMPLATE(
|
||||
PartGui::ViewProviderAttachExtensionPython,
|
||||
PartGui::ViewProviderAttachExtension
|
||||
)
|
||||
|
||||
// explicit template instantiation
|
||||
template class PartGuiExport ViewProviderExtensionPythonT<PartGui::ViewProviderAttachExtension>;
|
||||
}
|
||||
template class PartGuiExport ViewProviderExtensionPythonT<PartGui::ViewProviderAttachExtension>;
|
||||
} // namespace Gui
|
||||
|
||||
Reference in New Issue
Block a user