From 580c9c9d4550bcc955837d6138d4e7d09a84da57 Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 10 Jul 2015 10:31:22 +0300 Subject: [PATCH] Issue #621: Set toolbars positions --- src/NewGeom/NewGeom_Module.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) 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); -- 2.39.2