Part: handle Part_SectionCut in WorkbenchManipulator
This commit is contained in:
@@ -36,10 +36,14 @@ void WorkbenchManipulator::modifyMenuBar([[maybe_unused]] Gui::MenuItem* menuBar
|
||||
|
||||
void WorkbenchManipulator::modifyContextMenu(const char* recipient, Gui::MenuItem* menuBar)
|
||||
{
|
||||
if (strcmp(recipient, "View") == 0) {
|
||||
addSelectionFilter(menuBar);
|
||||
}
|
||||
}
|
||||
|
||||
void WorkbenchManipulator::modifyToolBars(Gui::ToolBarItem* toolBar)
|
||||
{
|
||||
addSelectionFilter(toolBar);
|
||||
}
|
||||
|
||||
void WorkbenchManipulator::modifyDockWindows([[maybe_unused]] Gui::DockWindowItems* dockWindow)
|
||||
@@ -59,3 +63,27 @@ void WorkbenchManipulator::addSectionCut(Gui::MenuItem* menuBar)
|
||||
par->insertItem(item, add);
|
||||
}
|
||||
}
|
||||
|
||||
void WorkbenchManipulator::addSelectionFilter(Gui::ToolBarItem* toolBar)
|
||||
{
|
||||
if (auto view = toolBar->findItem("View")) {
|
||||
auto add = new Gui::ToolBarItem(); // NOLINT
|
||||
add->setCommand("Part_SelectFilter");
|
||||
auto item = view->findItem("Std_TreeViewActions");
|
||||
if (item) {
|
||||
view->insertItem(item, add);
|
||||
}
|
||||
else {
|
||||
view->appendItem(add);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WorkbenchManipulator::addSelectionFilter(Gui::MenuItem* menuBar)
|
||||
{
|
||||
if (auto measure = menuBar->findItem("Measure")) {
|
||||
auto add = new Gui::MenuItem(); // NOLINT
|
||||
add->setCommand("Part_SelectFilter");
|
||||
menuBar->insertItem(measure, add);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +59,8 @@ protected:
|
||||
|
||||
private:
|
||||
static void addSectionCut(Gui::MenuItem* menuBar);
|
||||
static void addSelectionFilter(Gui::ToolBarItem* toolBar);
|
||||
static void addSelectionFilter(Gui::MenuItem* menuBar);
|
||||
};
|
||||
|
||||
} // namespace PartGui
|
||||
|
||||
Reference in New Issue
Block a user