From dce7f63c02e7c3247513ca3749da9da82518c1af Mon Sep 17 00:00:00 2001 From: vocx-fc Date: Sat, 15 Feb 2020 22:54:34 -0600 Subject: [PATCH] Draft: add new viewprovider icons for specific objects When there are many Draft objects in the tree view the icon can be used to tell different objects apart quickly. One icon is used for objects that are "straight lines", whose Proxy is of type `Line`, `Wire` or `Polyline`; another icon for "regular geometrical" shapes of type `Rectangle` or `Polygon`; and another icon for "curved" objects of type `Circle`, `Ellipse`, `BSpline`, `BezCurve`, or `Fillet`. Other objects use the older default icon. --- src/Mod/Draft/Draft.py | 10 +- src/Mod/Draft/Resources/Draft.qrc | 3 + .../Draft/Resources/icons/Draft_N-Curve.svg | 112 +++++++++ .../Draft/Resources/icons/Draft_N-Linear.svg | 222 ++++++++++++++++++ .../Draft/Resources/icons/Draft_N-Polygon.svg | 136 +++++++++++ 5 files changed, 482 insertions(+), 1 deletion(-) create mode 100644 src/Mod/Draft/Resources/icons/Draft_N-Curve.svg create mode 100644 src/Mod/Draft/Resources/icons/Draft_N-Linear.svg create mode 100644 src/Mod/Draft/Resources/icons/Draft_N-Polygon.svg diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index 5d0a1d9816..d977432fc1 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -3283,7 +3283,15 @@ class _ViewProviderDraft: return False def getIcon(self): - return(":/icons/Draft_Draft.svg") + tp = self.Object.Proxy.Type + if tp in ('Line', 'Wire', 'Polyline'): + return ":/icons/Draft_N-Linear.svg" + elif tp in ('Rectangle', 'Polygon'): + return ":/icons/Draft_N-Polygon.svg" + elif tp in ('Circle', 'Ellipse', 'BSpline', 'BezCurve', 'Fillet'): + return ":/icons/Draft_N-Curve.svg" + else: + return ":/icons/Draft_Draft.svg" def claimChildren(self): objs = [] diff --git a/src/Mod/Draft/Resources/Draft.qrc b/src/Mod/Draft/Resources/Draft.qrc index 0eef2df32e..4a807bf01d 100644 --- a/src/Mod/Draft/Resources/Draft.qrc +++ b/src/Mod/Draft/Resources/Draft.qrc @@ -48,6 +48,9 @@ icons/Draft_Macro.svg icons/Draft_Mirror.svg icons/Draft_Move.svg + icons/Draft_N-Curve.svg + icons/Draft_N-Linear.svg + icons/Draft_N-Polygon.svg icons/Draft_Offset.svg icons/Draft_PathArray.svg icons/Draft_PathLinkArray.svg diff --git a/src/Mod/Draft/Resources/icons/Draft_N-Curve.svg b/src/Mod/Draft/Resources/icons/Draft_N-Curve.svg new file mode 100644 index 0000000000..08cfbe102c --- /dev/null +++ b/src/Mod/Draft/Resources/icons/Draft_N-Curve.svg @@ -0,0 +1,112 @@ + + + Draft_N-Curve + + + + + + + + + + + + + + + + + image/svg+xml + + Draft_N-Curve + + Sat Feb 15 23:00:00 2020 +0000 + + + [vocx] + + + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + FreeCAD/src/Mod/Draft/Resources/icons/Draft_N-Curve.svg + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + + + + + + curve + spline + bezier + + + A curve going up, with a bend to the left, then to the right, and then again to the left + + + + + diff --git a/src/Mod/Draft/Resources/icons/Draft_N-Linear.svg b/src/Mod/Draft/Resources/icons/Draft_N-Linear.svg new file mode 100644 index 0000000000..8ecf4b7a3c --- /dev/null +++ b/src/Mod/Draft/Resources/icons/Draft_N-Linear.svg @@ -0,0 +1,222 @@ + + + Draft_N-Linear + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Draft_N-Linear + + Sat Feb 15 23:00:00 2020 +0000 + + + [vocx] + + + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + FreeCAD/src/Mod/Draft/Resources/icons/Draft_N-Linear.svg + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + + + + + + line + wire + polyline + + + A polygonal line moving to the right: one line segment going up, another going down, and up again + + + + + + diff --git a/src/Mod/Draft/Resources/icons/Draft_N-Polygon.svg b/src/Mod/Draft/Resources/icons/Draft_N-Polygon.svg new file mode 100644 index 0000000000..c95a62c35d --- /dev/null +++ b/src/Mod/Draft/Resources/icons/Draft_N-Polygon.svg @@ -0,0 +1,136 @@ + + + Draft_N-Polygon + + + + + + + + + + + + + + + + + image/svg+xml + + Draft_N-Polygon + + Sat Feb 15 23:00:00 2020 +0000 + + + [vocx] + + + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + FreeCAD/src/Mod/Draft/Resources/icons/Draft_N-Polygon.svg + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + + + + + + rectangle + pentagon + polygon + + + The intersecting outlines of a rectangle and a pentagon + + + + + + + +