]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #621: Set toolbars positions
authorvsv <vitaly.smetannikov@opencascade.com>
Fri, 10 Jul 2015 07:31:22 +0000 (10:31 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Fri, 10 Jul 2015 07:31:54 +0000 (10:31 +0300)
src/NewGeom/NewGeom_Module.cpp

index 05e5c735cdfe8813e4d5fbaf07a4d8dda4e236f5..d88a4ca6b2de72a0126d0a984720ef12cb312be3 100644 (file)
@@ -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<QAction*>& 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);