Part: handle Part_SectionCut in WorkbenchManipulator
This commit is contained in:
@@ -244,8 +244,6 @@ PyMOD_INIT_FUNC(PartGui)
|
||||
// add resources and reloads the translators
|
||||
loadPartResource();
|
||||
|
||||
Gui::Workbench::addPermanentMenuItem("Part_SectionCut", "Std_ToggleClipPlane");
|
||||
|
||||
// register bitmaps
|
||||
// Gui::BitmapFactoryInst& rclBmpFactory = Gui::BitmapFactory();
|
||||
// rclBmpFactory.addXPM("Part_Feature",(const char**) PartFeature_xpm);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,9 @@ protected:
|
||||
* The default implementation doesn't change anything.
|
||||
*/
|
||||
void modifyDockWindows([[maybe_unused]] Gui::DockWindowItems* dockWindow) override;
|
||||
|
||||
private:
|
||||
static void addSectionCut(Gui::MenuItem* menuBar);
|
||||
};
|
||||
|
||||
} // namespace PartGui
|
||||
|
||||
Reference in New Issue
Block a user