* [TD]add preferences for detail highlight snapping * [TD]fix highlight drag issues * Update src/Mod/TechDraw/Gui/TaskDetail.cpp minor format change from benj5378. Co-authored-by: Benjamin Bræstrup Sayoc <benj5378@outlook.com> --------- Co-authored-by: Benjamin Bræstrup Sayoc <benj5378@outlook.com>
This commit is contained in:
@@ -60,6 +60,7 @@
|
||||
#include "TaskProjGroup.h"
|
||||
#include "ViewProviderViewPart.h"
|
||||
#include "ViewProviderPage.h"
|
||||
#include "QGIViewPart.h"
|
||||
#include "QGIViewDimension.h"
|
||||
#include "QGIViewBalloon.h"
|
||||
#include "QGSPage.h"
|
||||
@@ -213,8 +214,8 @@ void ViewProviderViewPart::onChanged(const App::Property* prop)
|
||||
void ViewProviderViewPart::attach(App::DocumentObject *pcFeat)
|
||||
{
|
||||
// Base::Console().message("VPVP::attach(%s)\n", pcFeat->getNameInDocument());
|
||||
TechDraw::DrawViewMulti* dvm = dynamic_cast<TechDraw::DrawViewMulti*>(pcFeat);
|
||||
TechDraw::DrawViewDetail* dvd = dynamic_cast<TechDraw::DrawViewDetail*>(pcFeat);
|
||||
auto* dvm = dynamic_cast<TechDraw::DrawViewMulti*>(pcFeat);
|
||||
auto* dvd = dynamic_cast<TechDraw::DrawViewDetail*>(pcFeat);
|
||||
if (dvm) {
|
||||
sPixmap = "TechDraw_TreeMulti";
|
||||
} else if (dvd) {
|
||||
@@ -269,7 +270,7 @@ std::vector<App::DocumentObject*> ViewProviderViewPart::claimChildren() const
|
||||
}
|
||||
return temp;
|
||||
} catch (...) {
|
||||
return std::vector<App::DocumentObject*>();
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,25 +288,32 @@ bool ViewProviderViewPart::setEdit(int ModNum)
|
||||
Gui::Selection().clearSelection();
|
||||
|
||||
TechDraw::DrawViewPart* dvp = getViewObject();
|
||||
TechDraw::DrawViewDetail* dvd = dynamic_cast<TechDraw::DrawViewDetail*>(dvp);
|
||||
auto* dvd = dynamic_cast<TechDraw::DrawViewDetail*>(dvp);
|
||||
if (dvd) {
|
||||
if (!dvd->BaseView.getValue()) {
|
||||
Base::Console().error("DrawViewDetail - %s - has no BaseView!\n", dvd->getNameInDocument());
|
||||
return false;
|
||||
}
|
||||
Gui::Control().showDialog(new TaskDlgDetail(dvd));
|
||||
Gui::Selection().clearSelection();
|
||||
Gui::Selection().addSelection(dvd->getDocument()->getName(),
|
||||
dvd->getNameInDocument());
|
||||
}
|
||||
else {
|
||||
auto* view = getObject<TechDraw::DrawView>();
|
||||
Gui::Control().showDialog(new TaskDlgProjGroup(view, false));
|
||||
return setDetailEdit(ModNum, dvd);
|
||||
}
|
||||
auto* view = getObject<TechDraw::DrawView>();
|
||||
Gui::Control().showDialog(new TaskDlgProjGroup(view, false));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ViewProviderViewPart::setDetailEdit(int ModNum, DrawViewDetail* dvd)
|
||||
{
|
||||
Q_UNUSED(ModNum);
|
||||
|
||||
Gui::Control().showDialog(new TaskDlgDetail(dvd));
|
||||
Gui::Selection().clearSelection();
|
||||
Gui::Selection().addSelection(dvd->getDocument()->getName(),
|
||||
dvd->getNameInDocument());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool ViewProviderViewPart::doubleClicked()
|
||||
{
|
||||
setEdit(ViewProvider::Default);
|
||||
|
||||
Reference in New Issue
Block a user