Part: handle Part_SectionCut in WorkbenchManipulator

This commit is contained in:
wmayer
2023-10-03 17:43:40 +02:00
committed by wwmayer
parent 6e12bbf79a
commit 09148fa617
3 changed files with 18 additions and 2 deletions

View File

@@ -31,6 +31,7 @@ using namespace PartGui;
void WorkbenchManipulator::modifyMenuBar([[maybe_unused]] Gui::MenuItem* menuBar)
{
addSectionCut(menuBar);
}
void WorkbenchManipulator::modifyContextMenu(const char* recipient, Gui::MenuItem* menuBar)
@@ -44,3 +45,17 @@ void WorkbenchManipulator::modifyToolBars(Gui::ToolBarItem* toolBar)
void WorkbenchManipulator::modifyDockWindows([[maybe_unused]] Gui::DockWindowItems* dockWindow)
{
}
void WorkbenchManipulator::addSectionCut(Gui::MenuItem* menuBar)
{
const char* toggleClipPlane = "Std_ToggleClipPlane";
auto par = menuBar->findParentOf(toggleClipPlane);
if (par) {
auto item = par->findItem(toggleClipPlane);
item = par->afterItem(item);
auto add = new Gui::MenuItem(); // NOLINT
add->setCommand("Part_SectionCut");
par->insertItem(item, add);
}
}