FreeCAD

Форк
0
/
WorkbenchManipulator.cpp 
51 строка · 2.2 Кб
1
/***************************************************************************
2
 *   Copyright (c) 2024 David Friedli <david[at]friedli-be.ch>             *
3
 *                                                                         *
4
 *   This file is part of FreeCAD.                                         *
5
 *                                                                         *
6
 *   FreeCAD is free software: you can redistribute it and/or modify it    *
7
 *   under the terms of the GNU Lesser General Public License as           *
8
 *   published by the Free Software Foundation, either version 2.1 of the  *
9
 *   License, or (at your option) any later version.                       *
10
 *                                                                         *
11
 *   FreeCAD is distributed in the hope that it will be useful, but        *
12
 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      *
14
 *   Lesser General Public License for more details.                       *
15
 *                                                                         *
16
 *   You should have received a copy of the GNU Lesser General Public      *
17
 *   License along with FreeCAD. If not, see                               *
18
 *   <https://www.gnu.org/licenses/>.                                      *
19
 *                                                                         *
20
 **************************************************************************/
21

22

23
#include "PreCompiled.h"
24
#include "WorkbenchManipulator.h"
25
#include <Gui/MenuManager.h>
26
#include <Gui/ToolBarManager.h>
27

28
using namespace MeasureGui;
29

30
void WorkbenchManipulator::modifyMenuBar([[maybe_unused]] Gui::MenuItem* menuBar)
31
{
32
    auto menuTools = menuBar->findItem("&Tools");
33
    if (!menuTools) {
34
        return;
35
    }
36
    auto itemMeasure = new Gui::MenuItem();
37
    itemMeasure->setCommand("Std_Measure");
38
    menuTools->appendItem(itemMeasure);
39
}
40

41
void WorkbenchManipulator::modifyToolBars(Gui::ToolBarItem* toolBar)
42
{
43
    auto tbView = toolBar->findItem("View");
44
    if (!tbView) {
45
        return;
46
    }
47

48
    auto itemMeasure = new Gui::ToolBarItem();
49
    itemMeasure->setCommand("Std_Measure");
50
    tbView->appendItem(itemMeasure);
51
}
52

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.