diff --git a/src/Mod/TechDraw/App/DrawViewDetail.cpp b/src/Mod/TechDraw/App/DrawViewDetail.cpp index b4d662ab67..1fe3feebf8 100644 --- a/src/Mod/TechDraw/App/DrawViewDetail.cpp +++ b/src/Mod/TechDraw/App/DrawViewDetail.cpp @@ -83,6 +83,13 @@ DrawViewDetail::DrawViewDetail() : m_waitingForDetail(false), m_saveDvp(nullptr) ADD_PROPERTY_TYPE(Radius, (10.0), dgroup, App::Prop_None, "Size of detail area"); ADD_PROPERTY_TYPE(Reference, ("1"), dgroup, App::Prop_None, "An identifier for this detail"); + static const char* agroup{"Appearance"}; + ADD_PROPERTY_TYPE(ShowMatting, (Preferences::showDetailMatting()), agroup, App::Prop_None, + "Show or hide the matting around the detail view"); + ADD_PROPERTY_TYPE(ShowHighlight, (Preferences::showDetailHighlight()), agroup, App::Prop_None, + "Show or hide the detail highlight in the source view"); + + getParameters(); m_fudge = 1.01; diff --git a/src/Mod/TechDraw/App/DrawViewDetail.h b/src/Mod/TechDraw/App/DrawViewDetail.h index f80173c9ad..16b967cb8b 100644 --- a/src/Mod/TechDraw/App/DrawViewDetail.h +++ b/src/Mod/TechDraw/App/DrawViewDetail.h @@ -61,6 +61,9 @@ public: App::PropertyFloat Radius; App::PropertyString Reference; + App::PropertyBool ShowMatting; + App::PropertyBool ShowHighlight; + short mustExecute() const override; App::DocumentObjectExecReturn *execute() override; void onChanged(const App::Property* prop) override; diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotation.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotation.ui index e488b15a07..0d5b73fed5 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotation.ui +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotation.ui @@ -34,215 +34,7 @@ - - - - - true - - - - Length of horizontal portion of Balloon leader - - - Ballon Leader Kink Length - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Show arc centers in printed output - - - Print Center Marks - - - PrintCenterMarks - - - Mod/TechDraw/Decorations - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Length of balloon leader line kink - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 5.000000000000000 - - - BalloonKink - - - Mod/TechDraw/Dimensions - - - - - - - - true - - - - Balloon Shape - - - - - - - - 0 - 22 - - - - Default appearance of cut surface in section view - - - 2 - - - CutSurfaceDisplay - - - /Mod/TechDraw/Decorations - - - - Hide - - - - - Solid Color - - - - - SVG Hatch - - - - - PAT Hatch - - - - - - - - - true - - - - Balloon Leader End - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Restrict Filled Triangle line end to vertical or horizontal directions - - - Balloon Orthogonal Triangle - - - true - - - PyramidOrtho - - - Mod/TechDraw/Decorations - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - true - - - - Show or hide marks at direction changes on ComplexSection lines. - - - Complex Section Line Marks - - - true - - - SectionLineMarks - - - Mod/TechDraw/Decorations - - - - + @@ -273,6 +65,93 @@ + + + + + 0 + 0 + + + + + 0 + 0 + + + + + true + + + + Show arc center marks in views + + + Show Center Marks + + + true + + + ShowCenterMarks + + + Mod/TechDraw/Decorations + + + + + + + + true + + + + Show or hide marks at direction changes on ComplexSection lines. + + + Complex Section Line Marks + + + true + + + SectionLineMarks + + + Mod/TechDraw/Decorations + + + + + + + + true + + + + Section Cut Surface + + + + + + + + true + + + + Length of horizontal portion of Balloon leader + + + Ballon Leader Kink Length + + + @@ -316,68 +195,7 @@ - - - - - 0 - 0 - - - - - 0 - 0 - - - - Style for balloon leader line ends - - - BalloonArrow - - - Mod/TechDraw/Decorations - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - true - - - - Show arc center marks in views - - - Show Center Marks - - - true - - - ShowCenterMarks - - - Mod/TechDraw/Decorations - - - - + @@ -474,15 +292,121 @@ - - + + + + + 0 + 0 + + + + + 0 + 0 + + + + Length of balloon leader line kink + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 5.000000000000000 + + + BalloonKink + + + Mod/TechDraw/Dimensions + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Restrict Filled Triangle line end to vertical or horizontal directions + + + Balloon Orthogonal Triangle + + + true + + + PyramidOrtho + + + Mod/TechDraw/Decorations + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + true - Section Cut Surface + Balloon Leader End + + + + + + + This checkbox controls whether or not to display the outline around a detail view. + + + Detail View Show Matting + + + true + + + ShowDetailMatting + + + /Mod/TechDraw/General + + + + + + + + true + + + + Balloon Shape @@ -498,6 +422,120 @@ + + + + + 0 + 0 + + + + + 0 + 0 + + + + Show arc centers in printed output + + + Print Center Marks + + + PrintCenterMarks + + + Mod/TechDraw/Decorations + + + + + + + + 0 + 22 + + + + Default appearance of cut surface in section view + + + 2 + + + CutSurfaceDisplay + + + /Mod/TechDraw/Decorations + + + + Hide + + + + + Solid Color + + + + + SVG Hatch + + + + + PAT Hatch + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Style for balloon leader line ends + + + BalloonArrow + + + Mod/TechDraw/Decorations + + + + + + + This checkbox controls whether or not to display a highlight around the detail area in the detail's source view. + + + Detail Source Show Highlight + + + true + + + ShowDetailHighlight + + + /Mod/TechDraw/General + + + diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotationImp.cpp b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotationImp.cpp index 0e7539ed5a..9a588ac70d 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotationImp.cpp +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotationImp.cpp @@ -94,6 +94,8 @@ void DlgPrefsTechDrawAnnotationImp::saveSettings() ui->pcbHighlightStyle->onSave(); ui->cbEndCap->onSave(); ui->pcbHiddenStyle->onSave(); + ui->pcbDetailMatting->onSave(); + ui->pcbDetailHighlight->onSave(); } void DlgPrefsTechDrawAnnotationImp::loadSettings() @@ -129,6 +131,9 @@ void DlgPrefsTechDrawAnnotationImp::loadSettings() ui->pcbMatting->onRestore(); ui->pdsbBalloonKink->onRestore(); ui->cbCutSurface->onRestore(); + ui->pcbDetailMatting->onRestore(); + ui->pcbDetailHighlight->onRestore(); + ui->pcbBalloonArrow->onRestore(); DrawGuiUtil::loadArrowBox(ui->pcbBalloonArrow); diff --git a/src/Mod/TechDraw/Gui/QGIViewPart.cpp b/src/Mod/TechDraw/Gui/QGIViewPart.cpp index f11bae9e41..6ce86f0fa4 100644 --- a/src/Mod/TechDraw/Gui/QGIViewPart.cpp +++ b/src/Mod/TechDraw/Gui/QGIViewPart.cpp @@ -826,9 +826,6 @@ void QGIViewPart::drawCenterLines(bool b) void QGIViewPart::drawAllHighlights() { - if (!Preferences::showDetailHighlight()) { - return; - } // dvp and vp already validated auto dvp(static_cast(getViewObject())); @@ -853,6 +850,11 @@ void QGIViewPart::drawHighlight(TechDraw::DrawViewDetail* viewDetail, bool b) if (!vpDetail) { return; } + + if (!viewDetail->ShowHighlight.getValue()) { + return; + } + if (b) { double fontSize = Preferences::labelFontSizeMM(); QGIHighlight* highlight = new QGIHighlight(); @@ -907,9 +909,6 @@ void QGIViewPart::highlightMoved(QGIHighlight* highlight, QPointF newPos) void QGIViewPart::drawMatting() { - if (!Preferences::showDetailMatting()) { - return; - } auto viewPart(dynamic_cast(getViewObject())); TechDraw::DrawViewDetail* dvd = nullptr; if (viewPart && viewPart->isDerivedFrom(TechDraw::DrawViewDetail::getClassTypeId())) { @@ -919,6 +918,10 @@ void QGIViewPart::drawMatting() return; } + if (!dvd->ShowMatting.getValue()) { + return; + } + double scale = dvd->getScale(); double radius = dvd->Radius.getValue() * scale; QGIMatting* mat = new QGIMatting();