From 048da48080d5aa40cd2c950e6050e2fb91d38bbc Mon Sep 17 00:00:00 2001 From: vocx-fc Date: Sun, 4 Oct 2020 20:03:31 -0500 Subject: [PATCH] Part: activate Part_ColorPerFace in the menu and toolbar According to the source this command was deactivated until issue #0477 and hence #1954 could be solved. However, since those issues haven't been addressed the command has remained hidden for a long time. This command does not work with objects that reimplement their edit modes, meaning that it may work with Part and PartDesign created objects but not with Draft and Arch objects. The command is added to the standard `View` menu, and to one `Part tools` toolbar so that it is no longer hidden. The limitations of the command can be described in the documentation, and then somebody else can help solve the problem with the edit modes. A new icon for the command is also provided. --- src/Mod/Part/Gui/Command.cpp | 11 +- src/Mod/Part/Gui/Resources/Part.qrc | 1 + .../Resources/icons/tools/Part_ColorFace.svg | 249 ++++++++++++++++++ src/Mod/Part/Gui/Workbench.cpp | 14 +- 4 files changed, 272 insertions(+), 3 deletions(-) create mode 100644 src/Mod/Part/Gui/Resources/icons/tools/Part_ColorFace.svg diff --git a/src/Mod/Part/Gui/Command.cpp b/src/Mod/Part/Gui/Command.cpp index 2763193ead..7d7864703d 100644 --- a/src/Mod/Part/Gui/Command.cpp +++ b/src/Mod/Part/Gui/Command.cpp @@ -2158,9 +2158,18 @@ CmdColorPerFace::CmdColorPerFace() sAppModule = "Part"; sGroup = QT_TR_NOOP("Part"); sMenuText = QT_TR_NOOP("Color per face"); - sToolTipText = QT_TR_NOOP("Set color per face"); + sToolTipText = QT_TR_NOOP("Set the color of each individual face " + "of the selected object.\n" + "\n" + "At the moment, this command only works " + "with objects which have not reimplemented\n" + "their 'edit modes'; this means, it works " + "with Part and PartDesign created objects,\n" + "but not with most Draft or Arch objects. " + "See issues #0477 and #1954 in the tracker."); sStatusTip = sToolTipText; sWhatsThis = "Part_ColorPerFace"; + sPixmap = "Part_ColorFace"; } void CmdColorPerFace::activated(int iMsg) diff --git a/src/Mod/Part/Gui/Resources/Part.qrc b/src/Mod/Part/Gui/Resources/Part.qrc index e523834499..039bd7bca9 100644 --- a/src/Mod/Part/Gui/Resources/Part.qrc +++ b/src/Mod/Part/Gui/Resources/Part.qrc @@ -62,6 +62,7 @@ icons/tools/Part_Attachment.svg icons/tools/Part_Chamfer.svg + icons/tools/Part_ColorFace.svg icons/tools/Part_Element_Copy.svg icons/tools/Part_Extrude.svg icons/tools/Part_Fillet.svg diff --git a/src/Mod/Part/Gui/Resources/icons/tools/Part_ColorFace.svg b/src/Mod/Part/Gui/Resources/icons/tools/Part_ColorFace.svg new file mode 100644 index 0000000000..1c1bff3d84 --- /dev/null +++ b/src/Mod/Part/Gui/Resources/icons/tools/Part_ColorFace.svg @@ -0,0 +1,249 @@ + + + Part_ColorFace + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Part_ColorFace + + + [vocx] + + + 2020-10-05 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Part/Gui/Resources/icons/Part_ColorFace.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson, [wmayer] + + + Based on the 'Tree_Part' icon, the tree faces of the cube are each of a different color, one blue, one yellow, and the other red. + + + Cube + colors + blue + yellow + red + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Part/Gui/Workbench.cpp b/src/Mod/Part/Gui/Workbench.cpp index 33687de77c..0bf741e1e4 100644 --- a/src/Mod/Part/Gui/Workbench.cpp +++ b/src/Mod/Part/Gui/Workbench.cpp @@ -158,7 +158,16 @@ Gui::MenuItem* Workbench::setupMenuBar() const << "Part_Measure_Toggle_Delta"; // leave this for 0.14 until #0000477 is fixed -#if 0 + + // According to #0477 and #1954 + // `Part_ColorPerFace` does not work with objects that reimplement + // their edit modes, meaning it may work with Part and PartDesign + // created objects but not with Draft and Arch objects. + // However, it does not make much sense to keep it hidden; + // having it available in the interface will allow more people + // to use it, and maybe somebody will be able to investigate + // and fix the issue. +#if 1 Gui::MenuItem* view = root->findItem("&View"); if (view) { Gui::MenuItem* appr = view->findItem("Std_RandomColor"); @@ -199,7 +208,8 @@ Gui::ToolBarItem* Workbench::setupToolBars() const << "Part_Sweep" << "Part_CompOffset" << "Part_Thickness" - << "Part_ProjectionOnSurface"; + << "Part_ProjectionOnSurface" + << "Part_ColorPerFace"; // See issues #0477 and #1954 in the tracker Gui::ToolBarItem* boolop = new Gui::ToolBarItem(root); boolop->setCommand("Boolean");