diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2.ui index 973785771f..f25d234778 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2.ui +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2.ui @@ -7,7 +7,7 @@ 0 0 521 - 420 + 463 @@ -145,7 +145,7 @@ 10 190 501 - 201 + 231 @@ -157,7 +157,7 @@ 20 30 471 - 161 + 194 @@ -349,6 +349,82 @@ + + + + Arrow Style + + + + + + + Preferred arrowhead style + + + 0 + + + 5 + + + ArrowStyle + + + Mod/TechDraw/Decorations + + + + 0 - Filled Triangle + + + + :/icons/arrowfilled.svg + + + + + + 1 - Open Arrowhead + + + + :/icons/arrowopen.svg + + + + + + 2 - Tick + + + + :/icons/arrowtick.svg + + + + + + 3 - Dot + + + + :/icons/arrowdot.svg + + + + + + 4 - Open Circle + + + + :/icons/arrowopendot.svg + + + + + @@ -385,6 +461,8 @@
Gui/PrefWidgets.h
- + + + diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2Imp.cpp b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2Imp.cpp index f94478eb8c..b34d35526c 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2Imp.cpp +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2Imp.cpp @@ -52,6 +52,7 @@ void DlgPrefsTechDraw2Imp::saveSettings() colCenterLine->onSave(); pcbSectionStyle->onSave(); colSectionLine->onSave(); + pcbArrow->onSave(); } void DlgPrefsTechDraw2Imp::loadSettings() @@ -65,6 +66,7 @@ void DlgPrefsTechDraw2Imp::loadSettings() colCenterLine->onRestore(); pcbSectionStyle->onRestore(); colSectionLine->onRestore(); + pcbArrow->onRestore(); } /** diff --git a/src/Mod/TechDraw/Gui/QGIArrow.cpp b/src/Mod/TechDraw/Gui/QGIArrow.cpp index 3d3c4165e6..1d5037f120 100644 --- a/src/Mod/TechDraw/Gui/QGIArrow.cpp +++ b/src/Mod/TechDraw/Gui/QGIArrow.cpp @@ -63,11 +63,17 @@ void QGIArrow::flip(bool state) { void QGIArrow::draw() { QPainterPath path; if (m_style == 0) { - path = makeFilledTriangle(m_size,m_size/6.0,isFlipped); //"arrow l/w sb 3/1" ?? + path = makeFilledTriangle(m_size,m_size/6.0,isFlipped); //"arrow l/w sb 3/1" ?? } else if (m_style == 1) { - path = makeOpenArrow(m_size,m_size/3.0,isFlipped); //broad arrow? + path = makeOpenArrow(m_size,m_size/3.0,isFlipped); //broad arrow? } else if (m_style == 2) { - path = makeHashMark(m_size/2.0,m_size/2.0,isFlipped); //big enough? + path = makeHashMark(m_size/2.0,m_size/2.0,isFlipped); //big enough? + } else if (m_style == 3) { + path = makeDot(m_size/2.0,m_size/2.0,isFlipped); + } else if (m_style == 4) { + path = makeOpenDot(m_size/2.0,m_size/2.0,isFlipped); + } else { + path = makeFilledTriangle(m_size,m_size/6.0,isFlipped); //sb a question mark or ??? } setPath(path); } @@ -109,7 +115,7 @@ QPainterPath QGIArrow::makeOpenArrow(double length, double width, bool flipped) return path; } -QPainterPath QGIArrow::makeHashMark(double length, double width, bool flipped) +QPainterPath QGIArrow::makeHashMark(double length, double width, bool flipped) //Arch tick { double adjWidth = 1.0; //(0,0) is tip of arrow @@ -124,6 +130,27 @@ QPainterPath QGIArrow::makeHashMark(double length, double width, bool flipped) return path; } +QPainterPath QGIArrow::makeDot(double length, double width, bool flipped) //closed dot +{ + Q_UNUSED(flipped); + QPainterPath path; + path.moveTo(0.0,0.0); ////(0,0) is Center of dot + path.addEllipse(Rez::guiX(-length/2.0), Rez::guiX(-width/2.0), Rez::guiX(length), Rez::guiX(width)); + m_fill = Qt::SolidPattern; + return path; +} + +QPainterPath QGIArrow::makeOpenDot(double length, double width, bool flipped) +{ + Q_UNUSED(flipped); + QPainterPath path; + path.moveTo(0.0,0.0); ////(0,0) is Center of dot + path.addEllipse(Rez::guiX(-length/2.0), Rez::guiX(-width/2.0), Rez::guiX(length), Rez::guiX(width)); + m_fill = Qt::NoBrush; + return path; +} + + int QGIArrow::getPrefArrowStyle() { Base::Reference hGrp = App::GetApplication().GetUserParameter(). diff --git a/src/Mod/TechDraw/Gui/QGIArrow.h b/src/Mod/TechDraw/Gui/QGIArrow.h index 3c6019505e..f3f6764067 100644 --- a/src/Mod/TechDraw/Gui/QGIArrow.h +++ b/src/Mod/TechDraw/Gui/QGIArrow.h @@ -44,22 +44,21 @@ public: public: void draw(); - //void setHighlighted(bool state); void flip(bool state); double getSize() { return m_size; } void setSize(double s); int getStyle() { return m_style; } void setStyle(int s) { m_style = s; } - //QPainterPath shape() const; static int getPrefArrowStyle(); virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ); protected: - //QVariant itemChange(GraphicsItemChange change, const QVariant &value); QPainterPath makeFilledTriangle(double length, double width, bool flipped); QPainterPath makeOpenArrow(double length, double width, bool flipped); QPainterPath makeHashMark(double length, double width, bool flipped); + QPainterPath makeDot(double length, double width, bool flipped); + QPainterPath makeOpenDot(double length, double width, bool flipped); private: QBrush m_brush; @@ -69,6 +68,6 @@ private: bool isFlipped; }; -} // namespace MDIViewPageGui +} #endif // DRAWINGGUI_QGRAPHICSITEMARROW_H diff --git a/src/Mod/TechDraw/Gui/Resources/TechDraw.qrc b/src/Mod/TechDraw/Gui/Resources/TechDraw.qrc index d5f2fe60f4..b44da796f3 100644 --- a/src/Mod/TechDraw/Gui/Resources/TechDraw.qrc +++ b/src/Mod/TechDraw/Gui/Resources/TechDraw.qrc @@ -30,6 +30,11 @@ icons/TechDraw_Dimension_Vertical.svg icons/TechDraw_Dimension_Link.svg icons/preferences-techdraw.svg + icons/arrowdot.svg + icons/arrowopendot.svg + icons/arrowfilled.svg + icons/arrowopen.svg + icons/arrowtick.svg icons/actions/techdraw-new-default.svg icons/actions/techdraw-new-pick.svg icons/actions/techdraw-view.svg diff --git a/src/Mod/TechDraw/Gui/Resources/icons/arrowdot.svg b/src/Mod/TechDraw/Gui/Resources/icons/arrowdot.svg new file mode 100644 index 0000000000..61bf98896a --- /dev/null +++ b/src/Mod/TechDraw/Gui/Resources/icons/arrowdot.svg @@ -0,0 +1,49 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/src/Mod/TechDraw/Gui/Resources/icons/arrowfilled.svg b/src/Mod/TechDraw/Gui/Resources/icons/arrowfilled.svg new file mode 100644 index 0000000000..17c58bb9a0 --- /dev/null +++ b/src/Mod/TechDraw/Gui/Resources/icons/arrowfilled.svg @@ -0,0 +1,61 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/src/Mod/TechDraw/Gui/Resources/icons/arrowopen.svg b/src/Mod/TechDraw/Gui/Resources/icons/arrowopen.svg new file mode 100644 index 0000000000..2eddb2f78c --- /dev/null +++ b/src/Mod/TechDraw/Gui/Resources/icons/arrowopen.svg @@ -0,0 +1,84 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/TechDraw/Gui/Resources/icons/arrowopendot.svg b/src/Mod/TechDraw/Gui/Resources/icons/arrowopendot.svg new file mode 100644 index 0000000000..e60f4a4e39 --- /dev/null +++ b/src/Mod/TechDraw/Gui/Resources/icons/arrowopendot.svg @@ -0,0 +1,58 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/src/Mod/TechDraw/Gui/Resources/icons/arrowtick.svg b/src/Mod/TechDraw/Gui/Resources/icons/arrowtick.svg new file mode 100644 index 0000000000..b3f8ac37be --- /dev/null +++ b/src/Mod/TechDraw/Gui/Resources/icons/arrowtick.svg @@ -0,0 +1,74 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + +