From f30728d610844f93018da748c142b3315a19e735 Mon Sep 17 00:00:00 2001 From: carlopav Date: Sat, 28 Aug 2021 18:17:07 +0200 Subject: [PATCH] Gui: Group View Commands in toolbar Group view commands by default in the view toolbar. --- src/Gui/CommandView.cpp | 35 +++++++++++++++++++++++++++++++++++ src/Gui/Workbench.cpp | 5 ++--- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 4333cacebbf6..aacf81e97f99 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -1476,6 +1476,40 @@ void StdCmdViewRotateRight::activated(int iMsg) doCommand(Command::Gui,"Gui.activeDocument().activeView().viewRotateRight()"); } +//====================================================================== +// Std_ViewActions +//=========================================================================== +// +class StdCmdViewActions : public GroupCommand +{ +public: + StdCmdViewActions() + :GroupCommand("Std_ViewActions") + { + sGroup = QT_TR_NOOP("View"); + sMenuText = QT_TR_NOOP("View actions"); + sToolTipText = QT_TR_NOOP("Standard view actions"); + sWhatsThis = "Std_ViewActions"; + sStatusTip = QT_TR_NOOP("Standard view actions"); + eType = 0; + bCanLog = false; + + addCommand(new StdCmdViewIsometric()); + + addCommand(); + + addCommand(new StdCmdViewFront(), cmds.size()); + addCommand(new StdCmdViewTop(), cmds.size()); + addCommand(new StdCmdViewRight(), cmds.size()); + + addCommand(); + + addCommand(new StdCmdViewRear(), cmds.size()); + addCommand(new StdCmdViewBottom(), cmds.size()); + addCommand(new StdCmdViewLeft(), cmds.size()); + }; + virtual const char* className() const { return "StdCmdViewActions"; } +}; //=========================================================================== // Std_ViewFitAll @@ -3794,6 +3828,7 @@ void CreateViewStdCommands(void) rcCmdMgr.addCommand(new StdCmdViewFitSelection()); rcCmdMgr.addCommand(new StdCmdViewRotateLeft()); rcCmdMgr.addCommand(new StdCmdViewRotateRight()); + rcCmdMgr.addCommand(new StdCmdViewActions()); rcCmdMgr.addCommand(new StdCmdViewExample1()); rcCmdMgr.addCommand(new StdCmdViewExample2()); diff --git a/src/Gui/Workbench.cpp b/src/Gui/Workbench.cpp index 9917bc3944c4..c01e0df36723 100644 --- a/src/Gui/Workbench.cpp +++ b/src/Gui/Workbench.cpp @@ -732,9 +732,8 @@ ToolBarItem* StdWorkbench::setupToolBars() const view->setCommand("View"); *view << "Std_ViewFitAll" << "Std_ViewFitSelection" << "Std_DrawStyle" << "Std_SelBoundingBox" << "Separator" << "Std_SelBack" << "Std_SelForward" << "Std_LinkSelectActions" - << "Separator" << "Std_TreeViewActions" << "Std_ViewIsometric" << "Separator" << "Std_ViewFront" - << "Std_ViewTop" << "Std_ViewRight" << "Separator" << "Std_ViewRear" << "Std_ViewBottom" - << "Std_ViewLeft" << "Separator" << "Std_MeasureDistance" ; + << "Separator" << "Std_TreeViewActions" << "Separator" << "Std_ViewActions" + << "Separator" << "Std_MeasureDistance" ; // Structure ToolBarItem* structure = new ToolBarItem( root );