KiCad PCB EDA Suite
Loading...
Searching...
No Matches
toolbars_display_footprints.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program 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 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
21
22#include <tool/action_toolbar.h>
23#include <tool/actions.h>
25#include <tools/pcb_actions.h>
26
27std::optional<TOOLBAR_CONFIGURATION> DISPLAY_FOOTPRINTS_TOOLBAR_SETTINGS::DefaultToolbarConfig( TOOLBAR_LOC aToolbar )
28{
30
31 // clang-format off
32 switch( aToolbar )
33 {
34 // Currently, no top aux or right toolbars
35 case TOOLBAR_LOC::RIGHT:
36 case TOOLBAR_LOC::TOP_AUX:
37 return std::nullopt;
38
39 case TOOLBAR_LOC::LEFT:
40 config.AppendAction( ACTIONS::selectionTool )
41 .AppendAction( ACTIONS::measureTool );
42
43 config.AppendSeparator()
44 .AppendAction( ACTIONS::toggleGrid )
45 .AppendAction( ACTIONS::togglePolarCoords )
46 .AppendAction( ACTIONS::inchesUnits )
47 .AppendAction( ACTIONS::milsUnits )
48 .AppendAction( ACTIONS::millimetersUnits )
49 .AppendAction( ACTIONS::toggleCursorStyle );
50
51 config.AppendSeparator()
52 .AppendAction( PCB_ACTIONS::showPadNumbers )
53 .AppendAction( PCB_ACTIONS::padDisplayMode )
54 .AppendAction( PCB_ACTIONS::textOutlines )
55 .AppendAction( PCB_ACTIONS::graphicsOutlines );
56 break;
57
58 case TOOLBAR_LOC::TOP_MAIN:
59 config.AppendAction( ACTIONS::zoomRedraw )
60 .AppendAction( ACTIONS::zoomInCenter )
61 .AppendAction( ACTIONS::zoomOutCenter )
62 .AppendAction( ACTIONS::zoomFitScreen )
63 .AppendAction( ACTIONS::zoomTool );
64
65 config.AppendSeparator()
66 .AppendAction( ACTIONS::show3DViewer );
67
68 config.AppendSeparator()
70
71 config.AppendSeparator()
73
74 config.AppendSeparator()
75 .AppendAction( PCB_ACTIONS::fpAutoZoom );
76 break;
77 }
78
79 // clang-format on
80 return config;
81}
static TOOL_ACTION toggleGrid
Definition: actions.h:191
static TOOL_ACTION zoomRedraw
Definition: actions.h:124
static TOOL_ACTION millimetersUnits
Definition: actions.h:199
static TOOL_ACTION show3DViewer
Definition: actions.h:213
static TOOL_ACTION zoomOutCenter
Definition: actions.h:128
static TOOL_ACTION togglePolarCoords
Definition: actions.h:202
static TOOL_ACTION milsUnits
Definition: actions.h:198
static TOOL_ACTION inchesUnits
Definition: actions.h:197
static TOOL_ACTION toggleCursorStyle
Definition: actions.h:144
static TOOL_ACTION measureTool
Definition: actions.h:207
static TOOL_ACTION selectionTool
Definition: actions.h:206
static TOOL_ACTION zoomFitScreen
Definition: actions.h:134
static TOOL_ACTION zoomTool
Definition: actions.h:138
static TOOL_ACTION zoomInCenter
Definition: actions.h:127
static ACTION_TOOLBAR_CONTROL gridSelect
static ACTION_TOOLBAR_CONTROL zoomSelect
std::optional< TOOLBAR_CONFIGURATION > DefaultToolbarConfig(TOOLBAR_LOC aToolbar) override
Get the default tools to show on the specified canvas toolbar.
static TOOL_ACTION padDisplayMode
Definition: pcb_actions.h:340
static TOOL_ACTION graphicsOutlines
Display footprint graphics as outlines.
Definition: pcb_actions.h:505
static TOOL_ACTION fpAutoZoom
Definition: pcb_actions.h:348
static TOOL_ACTION textOutlines
Display texts as lines.
Definition: pcb_actions.h:508
static TOOL_ACTION showPadNumbers
Definition: pcb_actions.h:347