From 02189fa973d3d27e68c1208235f7d16006e5486a Mon Sep 17 00:00:00 2001 From: vocx-fc Date: Sun, 12 Apr 2020 22:05:30 -0500 Subject: [PATCH] Draft: new utility toolbar with some useful commands These commands are useful but are "hiden" inside the "Utilities" menu, so not many poeple know about them. By placing them in a toolbar, they will be more discoverable. --- src/Mod/Draft/InitGui.py | 2 ++ src/Mod/Draft/draftutils/init_tools.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Mod/Draft/InitGui.py b/src/Mod/Draft/InitGui.py index 8c3dba77c1..bbbc7c0fca 100644 --- a/src/Mod/Draft/InitGui.py +++ b/src/Mod/Draft/InitGui.py @@ -102,11 +102,13 @@ class DraftWorkbench(FreeCADGui.Workbench): self.context_commands = it.get_draft_context_commands() self.line_commands = it.get_draft_line_commands() self.utility_commands = it.get_draft_utility_commands() + self.utility_small = it.get_draft_small_commands() # Set up toolbars self.appendToolbar(QT_TRANSLATE_NOOP("Draft", "Draft creation tools"), self.drawing_commands) self.appendToolbar(QT_TRANSLATE_NOOP("Draft", "Draft annotation tools"), self.annotation_commands) self.appendToolbar(QT_TRANSLATE_NOOP("Draft", "Draft modification tools"), self.modification_commands) + self.appendToolbar(QT_TRANSLATE_NOOP("Draft", "Draft utility tools"), self.utility_small) # Set up menus self.appendMenu(QT_TRANSLATE_NOOP("Draft", "&Drafting"), self.drawing_commands) diff --git a/src/Mod/Draft/draftutils/init_tools.py b/src/Mod/Draft/draftutils/init_tools.py index d9e71c7578..eec5493a37 100644 --- a/src/Mod/Draft/draftutils/init_tools.py +++ b/src/Mod/Draft/draftutils/init_tools.py @@ -57,6 +57,13 @@ def get_draft_array_commands(): return ["Draft_ArrayTools"] +def get_draft_small_commands(): + """Return a list with only some utilities.""" + return ["Draft_Layer", + "Draft_WorkingPlaneProxy", + "Draft_ToggleDisplayMode"] + + def get_draft_modification_commands(): """Return the modification commands list.""" lst = ["Draft_Move", "Draft_Rotate", @@ -74,8 +81,7 @@ def get_draft_modification_commands(): "Separator", "Draft_WireToBSpline", "Draft_Draft2Sketch", "Separator", - "Draft_Shape2DView", "Draft_Drawing", - "Draft_WorkingPlaneProxy"] + "Draft_Shape2DView", "Draft_Drawing"] return lst