Create a toolbar command group for default views.
Optional toolbar for all individual views is available.
This commit is contained in:
@@ -1633,6 +1633,40 @@ bool StdCmdViewFitSelection::isActive()
|
||||
return getGuiApplication()->sendHasMsgToActiveView("ViewSelection");
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
// Std_ViewCommandGroup
|
||||
//===========================================================================
|
||||
class StdCmdViewGroup: public Gui::GroupCommand
|
||||
{
|
||||
public:
|
||||
StdCmdViewGroup()
|
||||
: GroupCommand("Std_ViewGroup")
|
||||
{
|
||||
sGroup = "Standard-View";
|
||||
sMenuText = QT_TR_NOOP("Standard views");
|
||||
sToolTipText = QT_TR_NOOP("Change to a standard view");
|
||||
sStatusTip = QT_TR_NOOP("Change to a standard view");
|
||||
sWhatsThis = "Std_ViewGroup";
|
||||
sPixmap = "view-isometric";
|
||||
eType = Alter3DView;
|
||||
|
||||
setCheckable(false);
|
||||
setRememberLast(true);
|
||||
|
||||
addCommand("Std_ViewIsometric");
|
||||
addCommand("Std_ViewFront");
|
||||
addCommand("Std_ViewRight");
|
||||
addCommand("Std_ViewRear");
|
||||
addCommand("Std_ViewBottom");
|
||||
addCommand("Std_ViewLeft");
|
||||
}
|
||||
|
||||
const char* className() const override
|
||||
{
|
||||
return "StdCmdViewGroup";
|
||||
}
|
||||
};
|
||||
|
||||
//===========================================================================
|
||||
// Std_ViewDock
|
||||
//===========================================================================
|
||||
@@ -4180,6 +4214,7 @@ void CreateViewStdCommands()
|
||||
rcCmdMgr.addCommand(new StdCmdViewRotateRight());
|
||||
rcCmdMgr.addCommand(new StdStoreWorkingView());
|
||||
rcCmdMgr.addCommand(new StdRecallWorkingView());
|
||||
rcCmdMgr.addCommand(new StdCmdViewGroup());
|
||||
|
||||
rcCmdMgr.addCommand(new StdCmdViewExample1());
|
||||
rcCmdMgr.addCommand(new StdCmdViewExample2());
|
||||
|
||||
@@ -538,6 +538,7 @@ std::list<std::string> Workbench::listCommandbars() const
|
||||
qApp->translate("Workbench", "Workbench");
|
||||
qApp->translate("Workbench", "Structure");
|
||||
qApp->translate("Workbench", "Standard views");
|
||||
qApp->translate("Workbench", "Individual views");
|
||||
qApp->translate("Workbench", "Axonometric");
|
||||
qApp->translate("Workbench", "&Stereo");
|
||||
qApp->translate("Workbench", "&Zoom");
|
||||
@@ -661,7 +662,7 @@ MenuItem* StdWorkbench::setupMenuBar() const
|
||||
stdviews->setCommand("Standard views");
|
||||
*stdviews << "Std_ViewFitAll" << "Std_ViewFitSelection" << axoviews
|
||||
<< "Separator" << "Std_ViewHome" << "Std_ViewFront" << "Std_ViewTop"
|
||||
<< "Std_ViewRight" << "Separator" << "Std_ViewRear"
|
||||
<< "Std_ViewRight" << "Std_ViewRear"
|
||||
<< "Std_ViewBottom" << "Std_ViewLeft"
|
||||
<< "Separator" << "Std_ViewRotateLeft" << "Std_ViewRotateRight"
|
||||
<< "Separator" << "Std_StoreWorkingView" << "Std_RecallWorkingView";
|
||||
@@ -812,12 +813,21 @@ ToolBarItem* StdWorkbench::setupToolBars() const
|
||||
// View
|
||||
auto view = new ToolBarItem( root );
|
||||
view->setCommand("View");
|
||||
*view << "Std_ViewFitAll" << "Std_ViewFitSelection" << "Std_ViewIsometric"
|
||||
<< "Std_ViewFront"<< "Std_ViewTop" << "Std_ViewRight"
|
||||
<< "Std_ViewRear" << "Std_ViewBottom"<< "Std_ViewLeft"
|
||||
*view << "Std_ViewFitAll" << "Std_ViewFitSelection" << "Std_ViewGroup"
|
||||
<< "Separator" << "Std_DrawStyle" << "Std_TreeViewActions"
|
||||
<< "Separator" << "Std_MeasureDistance";
|
||||
|
||||
// Individual views
|
||||
auto individualViews = new ToolBarItem(root, ToolBarItem::DefaultVisibility::Hidden);
|
||||
individualViews->setCommand("Individual views");
|
||||
*individualViews << "Std_ViewIsometric"
|
||||
<< "Std_ViewFront"
|
||||
<< "Std_ViewRight"
|
||||
<< "Std_ViewTop"
|
||||
<< "Std_ViewRear"
|
||||
<< "Std_ViewLeft"
|
||||
<< "Std_ViewBottom";
|
||||
|
||||
// Structure
|
||||
auto structure = new ToolBarItem( root );
|
||||
structure->setCommand("Structure");
|
||||
@@ -827,7 +837,7 @@ ToolBarItem* StdWorkbench::setupToolBars() const
|
||||
auto help = new ToolBarItem( root );
|
||||
help->setCommand("Help");
|
||||
*help << "Std_WhatsThis";
|
||||
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
@@ -839,7 +849,7 @@ ToolBarItem* StdWorkbench::setupCommandBars() const
|
||||
auto view = new ToolBarItem( root );
|
||||
view->setCommand("Standard views");
|
||||
*view << "Std_ViewFitAll" << "Std_ViewFitSelection" << "Std_ViewIsometric" << "Separator"
|
||||
<< "Std_ViewFront" << "Std_ViewRight" << "Std_ViewTop" << "Separator"
|
||||
<< "Std_ViewFront" << "Std_ViewRight" << "Std_ViewTop"
|
||||
<< "Std_ViewRear" << "Std_ViewLeft" << "Std_ViewBottom";
|
||||
|
||||
// Special Ops
|
||||
|
||||
Reference in New Issue
Block a user