From: vsv Date: Fri, 10 Jul 2015 07:31:22 +0000 (+0300) Subject: Issue #621: Set toolbars positions X-Git-Tag: V_1.3.0~40 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=580c9c9d4550bcc955837d6138d4e7d09a84da57;p=modules%2Fshaper.git Issue #621: Set toolbars positions --- diff --git a/src/NewGeom/NewGeom_Module.cpp b/src/NewGeom/NewGeom_Module.cpp index 05e5c735c..d88a4ca6b 100644 --- a/src/NewGeom/NewGeom_Module.cpp +++ b/src/NewGeom/NewGeom_Module.cpp @@ -366,8 +366,21 @@ QAction* NewGeom_Module::addFeature(const QString& theWBName, const QString& the const QIcon& theIcon, const QKeySequence& theKeys, bool isCheckable) { + static QString aLastTool = ""; + static int aNb = 0; + if (aLastTool.isEmpty()) + aLastTool = theWBName; + else if (theWBName != aLastTool) { + aLastTool = theWBName; + if (aNb > 20) { + desktop()->addToolBarBreak(); + aNb = 0; + } + } + aNb++; + int aMenu = createMenu(theWBName, -1, -1, 50); - int aTool = createTool(theWBName); + int aTool = createTool(theWBName, theWBName); int aId = myActionsList.size(); myActionsList.append(theId); @@ -390,7 +403,7 @@ QAction* NewGeom_Module::addNestedFeature(const QString& theWBName, const QList& theNestedActions) { int aMenu = createMenu(theWBName, -1, -1, 50); - int aTool = createTool(theWBName); + int aTool = createTool(theWBName, theWBName); int aId = myActionsList.size(); myActionsList.append(theInfo.id);