Skip to content

Commit

Permalink
Gui: Group View Commands in toolbar
Browse files Browse the repository at this point in the history
Group view commands by default in the view toolbar.
  • Loading branch information
carlopav committed Sep 26, 2021
1 parent 1b20118 commit f30728d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
35 changes: 35 additions & 0 deletions src/Gui/CommandView.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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());
Expand Down
5 changes: 2 additions & 3 deletions src/Gui/Workbench.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit f30728d

Please sign in to comment.