From c05801d6edff634a4edab338e4f66ceca6da3b72 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 3 Jun 2014 11:24:49 +0200 Subject: [PATCH] + fixes for sketcher --- src/Mod/PartDesign/Gui/Workbench.cpp | 2 + src/Mod/Sketcher/Gui/CommandCreateGeo.cpp | 4 +- .../Resources/icons/Sketcher_CreateSlot.svg | 256 ++++++++++++------ src/Mod/Sketcher/Gui/Workbench.cpp | 4 +- src/Mod/Sketcher/ProfileLib/Hexagon.py | 2 +- src/Mod/Sketcher/Profiles.py | 9 +- 6 files changed, 179 insertions(+), 98 deletions(-) diff --git a/src/Mod/PartDesign/Gui/Workbench.cpp b/src/Mod/PartDesign/Gui/Workbench.cpp index d1488d4e5cf7..49a3738a4e8e 100644 --- a/src/Mod/PartDesign/Gui/Workbench.cpp +++ b/src/Mod/PartDesign/Gui/Workbench.cpp @@ -173,6 +173,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const << "Sketcher_CreateLine" << "Sketcher_CreatePolyline" << "Sketcher_CreateRectangle" + << "Sketcher_CreateSlot" << "Separator" << "Sketcher_CreateFillet" << "Sketcher_Trimming" @@ -266,6 +267,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const << "Sketcher_CreateLine" << "Sketcher_CreatePolyline" << "Sketcher_CreateRectangle" + << "Sketcher_CreateSlot" << "Separator" << "Sketcher_CreateFillet" << "Sketcher_Trimming" diff --git a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp index b53527f23ab1..4f71d127b4c7 100644 --- a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp +++ b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp @@ -3076,7 +3076,7 @@ CmdSketcherCreateSlot::CmdSketcherCreateSlot() sWhatsThis = sToolTipText; sStatusTip = sToolTipText; sPixmap = "Sketcher_CreateSlot"; - sAccel = "R"; + sAccel = ""; eType = ForEdit; } @@ -3104,10 +3104,10 @@ void CreateSketcherCommandsCreateGeo(void) rcCmdMgr.addCommand(new CmdSketcherCreateLine()); rcCmdMgr.addCommand(new CmdSketcherCreatePolyline()); rcCmdMgr.addCommand(new CmdSketcherCreateRectangle()); + rcCmdMgr.addCommand(new CmdSketcherCreateSlot()); rcCmdMgr.addCommand(new CmdSketcherCreateFillet()); //rcCmdMgr.addCommand(new CmdSketcherCreateText()); //rcCmdMgr.addCommand(new CmdSketcherCreateDraftLine()); rcCmdMgr.addCommand(new CmdSketcherTrimming()); rcCmdMgr.addCommand(new CmdSketcherExternal()); - rcCmdMgr.addCommand(new CmdSketcherCreateSlot()); } diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSlot.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSlot.svg index 9a25a5e56cb6..6a0c985b3d87 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSlot.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSlot.svg @@ -10,20 +10,18 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="64px" - height="64px" - id="svg2825" - sodipodi:version="0.32" - inkscape:version="0.48.1 r9760" - sodipodi:docname="Sketcher_CreateRectangle.svg" - inkscape:output_extension="org.inkscape.output.svg.inkscape" - version="1.1"> + width="64" + height="64" + id="svg4564" + version="1.1" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="Sketcher_CreateSlot.svg"> + id="defs4566"> + id="linearGradient3144-3"> + id="stop3146-7" /> + id="stop3148-0" /> - + + + + + id="metadata4569"> image/svg+xml + + transform="translate(0,-988.36218)"> - - + id="g3864"> + transform="translate(-82.839357,-9.4600504)" + id="g3858"> + + + + + + + + + + + + + + + + + + + + + + + sodipodi:rx="48.57143" + sodipodi:cy="655.2193" + sodipodi:cx="197.14285" + id="path3187-4" + style="fill:#ff2000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:5.79999971;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" + sodipodi:type="arc" /> + sodipodi:ry="23.991123" + sodipodi:rx="34.345188" + sodipodi:cy="672.79736" + sodipodi:cx="225.26402" + id="path3189-2" + style="fill:url(#radialGradient4572);fill-opacity:1;stroke:none" + sodipodi:type="arc" /> + id="g3185-9" + transform="matrix(-0.14592237,0.00572413,-0.00572413,-0.14592237,73.651419,1097.3598)" + inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/circle.png" + inkscape:export-xdpi="7.2934141" + inkscape:export-ydpi="7.2934141"> + sodipodi:rx="48.57143" + sodipodi:cy="655.2193" + sodipodi:cx="197.14285" + id="path3187-2" + style="fill:#ff2000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:5.79999971;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" + sodipodi:type="arc" /> + sodipodi:ry="23.991123" + sodipodi:rx="34.345188" + sodipodi:cy="672.79736" + sodipodi:cx="225.26402" + id="path3189-3" + style="fill:url(#radialGradient4574);fill-opacity:1;stroke:none" + sodipodi:type="arc" /> diff --git a/src/Mod/Sketcher/Gui/Workbench.cpp b/src/Mod/Sketcher/Gui/Workbench.cpp index 2147903e23c2..08f8dab32ecf 100644 --- a/src/Mod/Sketcher/Gui/Workbench.cpp +++ b/src/Mod/Sketcher/Gui/Workbench.cpp @@ -60,7 +60,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const root->insertItem(item, profile); profile->setCommand("P&rofiles"); - *profile << "Sketcher_ProfilesHexagon1"; + *profile << "Sketcher_ProfilesHexagon1"; // == Sketcher menu ========================================== @@ -78,7 +78,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const << "Separator" << "Sketcher_CreatePolyline" << "Sketcher_CreateRectangle" - << "Sketcher_CreateSlot" + << "Sketcher_CreateSlot" << "Separator" << "Sketcher_CreateFillet" << "Sketcher_Trimming" diff --git a/src/Mod/Sketcher/ProfileLib/Hexagon.py b/src/Mod/Sketcher/ProfileLib/Hexagon.py index fb268deda10a..268668741745 100644 --- a/src/Mod/Sketcher/ProfileLib/Hexagon.py +++ b/src/Mod/Sketcher/ProfileLib/Hexagon.py @@ -27,7 +27,7 @@ __author__ = "Juergen Riegel" __url__ = "http://www.freecadweb.org" - + def makeHexagonSimple(): return diff --git a/src/Mod/Sketcher/Profiles.py b/src/Mod/Sketcher/Profiles.py index fb469ad00d9c..d9dfd7695494 100644 --- a/src/Mod/Sketcher/Profiles.py +++ b/src/Mod/Sketcher/Profiles.py @@ -33,15 +33,15 @@ __author__ = "Juergen Riegel" __url__ = "http://www.freecadweb.org" - + def isProfileActive(): - return True + return not FreeCAD.ActiveDocument is None class _CommandProfileHexagon1: "The basis hexagon profile command definition" def GetResources(self): return {'Pixmap' : 'Sketcher_Hexagon', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Sketcher_ProfilesHexagon1","Creates a hexagon profile in the sketch"), + 'MenuText': QtCore.QT_TRANSLATE_NOOP("Sketcher_ProfilesHexagon1","Creates a hexagon profile"), 'Accel': "", 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Sketcher_ProfilesHexagon1","Creates a hexagon profile in the sketch")} @@ -50,10 +50,9 @@ def Activated(self): FreeCAD.ActiveDocument.openTransaction("Create hexagon profile") FreeCADGui.addModule("ProfileLib.Hexagon") FreeCADGui.doCommand("ProfileLib.Hexagon.makeHexagonSimple()") - + def IsActive(self): return isProfileActive() - FreeCADGui.addCommand('Sketcher_ProfilesHexagon1',_CommandProfileHexagon1())