From d14950c3f88fce8e573025cce9ff13c32ffc57bf Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 15 Dec 2019 13:56:26 +0100 Subject: [PATCH] Pcbnew: Add missing options to show graphics in fill or sketch mode. These options where settable in stable version, but not in master. So, the options set from the stable version cannot be modified in master version. --- bitmaps_png/CMakeLists.txt | 1 + bitmaps_png/cpp_26/show_graphics_mode.cpp | 45 +++++++ .../include/bitmaps_png/bitmaps_list.h | 1 + bitmaps_png/sources/show_graphics_mode.svg | 111 ++++++++++++++++++ pcbnew/menubar_pcb_editor.cpp | 13 ++ pcbnew/tools/pcb_actions.cpp | 6 +- 6 files changed, 175 insertions(+), 2 deletions(-) create mode 100644 bitmaps_png/cpp_26/show_graphics_mode.cpp create mode 100644 bitmaps_png/sources/show_graphics_mode.svg diff --git a/bitmaps_png/CMakeLists.txt b/bitmaps_png/CMakeLists.txt index c8d7d31152..cba63dfbda 100644 --- a/bitmaps_png/CMakeLists.txt +++ b/bitmaps_png/CMakeLists.txt @@ -462,6 +462,7 @@ set( BMAPS_MID show_dcodenumber show_footprint show_mod_edge + show_graphics_mode showtrack show_zone show_zone_disable diff --git a/bitmaps_png/cpp_26/show_graphics_mode.cpp b/bitmaps_png/cpp_26/show_graphics_mode.cpp new file mode 100644 index 0000000000..a23d80d3bd --- /dev/null +++ b/bitmaps_png/cpp_26/show_graphics_mode.cpp @@ -0,0 +1,45 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x01, 0xb9, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xb5, 0xd6, 0xcd, 0x4b, 0xc2, + 0x60, 0x1c, 0x07, 0xf0, 0xdf, 0x04, 0xff, 0x84, 0xfe, 0x8e, 0x5e, 0x8e, 0x9d, 0xfa, 0x17, 0x84, + 0x2e, 0x5d, 0xa2, 0x4e, 0x1e, 0x3c, 0x78, 0x88, 0x2c, 0x23, 0xe6, 0x33, 0x4f, 0x5e, 0x7a, 0x91, + 0x4a, 0xb7, 0x22, 0x35, 0x13, 0x3c, 0x75, 0xf0, 0xd9, 0x32, 0xe8, 0xee, 0x4c, 0x53, 0x0f, 0x61, + 0x41, 0x2f, 0x42, 0x44, 0xd8, 0xa1, 0x82, 0xa2, 0x6b, 0xb0, 0x9e, 0x67, 0x2a, 0x53, 0xd4, 0xb9, + 0xcd, 0xa7, 0x07, 0xbe, 0xb0, 0x87, 0xed, 0x79, 0x3e, 0x3c, 0x1b, 0x7c, 0x19, 0x80, 0xc9, 0x90, + 0x65, 0xf0, 0x91, 0x7c, 0x93, 0xbc, 0x77, 0xe5, 0x33, 0x27, 0xc3, 0x15, 0x58, 0x18, 0x08, 0x21, + 0x97, 0x24, 0x49, 0xfb, 0x24, 0x92, 0xe9, 0x83, 0x8a, 0x02, 0x2b, 0x58, 0x06, 0x2d, 0x87, 0x7b, + 0x83, 0x31, 0xdc, 0x59, 0x41, 0x44, 0x51, 0x4c, 0x12, 0x43, 0x23, 0xd9, 0xfb, 0x17, 0xa8, 0x7d, + 0x92, 0x14, 0x45, 0x28, 0x46, 0xe7, 0xcc, 0x21, 0xdb, 0x88, 0x13, 0xc8, 0x11, 0x62, 0x17, 0x72, + 0x8c, 0xd8, 0x81, 0xc6, 0x42, 0xac, 0x42, 0x63, 0x23, 0x56, 0x20, 0x26, 0xc8, 0x28, 0x88, 0x19, + 0x32, 0x14, 0xd2, 0xe7, 0xdc, 0x0b, 0x33, 0x64, 0x18, 0x84, 0x31, 0xa7, 0xa5, 0xd3, 0xcb, 0xbf, + 0xf6, 0x11, 0xa1, 0x96, 0x07, 0x54, 0xa9, 0x0f, 0xca, 0x82, 0xe4, 0x7d, 0xeb, 0x85, 0x28, 0xb2, + 0x44, 0x2b, 0x45, 0xf3, 0x46, 0xb3, 0x1f, 0x1c, 0x52, 0xab, 0x60, 0x29, 0x85, 0x22, 0x81, 0x2a, + 0x5f, 0x80, 0x1e, 0x34, 0x40, 0xf7, 0x7d, 0xf1, 0xc4, 0xd7, 0x34, 0x03, 0x32, 0x90, 0x13, 0x72, + 0x22, 0x77, 0x58, 0x9d, 0x86, 0x70, 0x69, 0xd2, 0x52, 0x90, 0xfa, 0xdc, 0x82, 0x42, 0x8f, 0x64, + 0xe3, 0xa7, 0xbe, 0x78, 0xe2, 0xc1, 0x36, 0x64, 0x20, 0x89, 0x44, 0xb0, 0x8c, 0x65, 0xae, 0x66, + 0xeb, 0x1b, 0x20, 0xb5, 0x61, 0x0a, 0xcd, 0x8b, 0x01, 0x02, 0x19, 0x48, 0xec, 0x70, 0x5b, 0x91, + 0x65, 0xf7, 0x0c, 0xc1, 0xab, 0x4c, 0x21, 0x3e, 0x33, 0xa7, 0xa5, 0x4f, 0x5b, 0xc8, 0x8e, 0x18, + 0x53, 0xe8, 0x87, 0x3f, 0x3f, 0x87, 0x29, 0xe7, 0x10, 0xba, 0x25, 0x1b, 0xd7, 0x49, 0x6e, 0x48, + 0xaa, 0x7a, 0x38, 0x54, 0xd1, 0x76, 0x8f, 0x57, 0x75, 0xc4, 0x1f, 0xcd, 0x34, 0x5c, 0x42, 0x21, + 0x44, 0x16, 0xf0, 0xb3, 0xd1, 0x48, 0x2c, 0x79, 0x36, 0xd1, 0xa4, 0xd7, 0xd6, 0x53, 0x68, 0x12, + 0xed, 0x7a, 0x11, 0x84, 0xb2, 0x5f, 0x4f, 0xb8, 0xb4, 0x01, 0x42, 0x31, 0xcf, 0x85, 0x8a, 0x17, + 0xbe, 0x68, 0xf6, 0x95, 0x22, 0x5b, 0x47, 0x9b, 0x3f, 0x2e, 0xbe, 0x10, 0xe9, 0x2c, 0x72, 0x06, + 0xa9, 0xeb, 0xa6, 0x55, 0x9f, 0x48, 0x05, 0x6a, 0x39, 0xd9, 0x15, 0xea, 0xbe, 0xef, 0xe8, 0xd5, + 0x8d, 0xaa, 0x7a, 0x8a, 0x60, 0x05, 0x78, 0xa6, 0xd0, 0xa0, 0xee, 0xa2, 0x08, 0x53, 0x68, 0x58, + 0x41, 0x32, 0x85, 0xcc, 0x5a, 0x98, 0x29, 0xd4, 0xf9, 0x25, 0x1a, 0x54, 0x90, 0x4c, 0x21, 0xb3, + 0x16, 0xa6, 0x08, 0xe9, 0xb9, 0xcb, 0x0e, 0xa8, 0x07, 0xc3, 0x81, 0x13, 0xe8, 0x0f, 0x8d, 0x3c, + 0xed, 0x05, 0xbe, 0x16, 0xd6, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, + 0x60, 0x82, +}; + +const BITMAP_OPAQUE show_graphics_mode_xpm[1] = {{ png, sizeof( png ), "show_graphics_mode_xpm" }}; + +//EOF diff --git a/bitmaps_png/include/bitmaps_png/bitmaps_list.h b/bitmaps_png/include/bitmaps_png/bitmaps_list.h index c80448479e..d49a145d44 100644 --- a/bitmaps_png/include/bitmaps_png/bitmaps_list.h +++ b/bitmaps_png/include/bitmaps_png/bitmaps_list.h @@ -421,6 +421,7 @@ EXTERN_BITMAP( setcolor_board_body_xpm ) EXTERN_BITMAP( shape_3d_xpm ) EXTERN_BITMAP( show_dcodenumber_xpm ) EXTERN_BITMAP( show_footprint_xpm ) +EXTERN_BITMAP( show_graphics_mode_xpm ) EXTERN_BITMAP( show_mod_edge_xpm ) EXTERN_BITMAP( show_all_layers_xpm ) EXTERN_BITMAP( show_no_layers_xpm ) diff --git a/bitmaps_png/sources/show_graphics_mode.svg b/bitmaps_png/sources/show_graphics_mode.svg new file mode 100644 index 0000000000..b72705b3a1 --- /dev/null +++ b/bitmaps_png/sources/show_graphics_mode.svg @@ -0,0 +1,111 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pcbnew/menubar_pcb_editor.cpp b/pcbnew/menubar_pcb_editor.cpp index 02d57459c5..b06586a906 100644 --- a/pcbnew/menubar_pcb_editor.cpp +++ b/pcbnew/menubar_pcb_editor.cpp @@ -313,6 +313,14 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() { return !disp_opt.m_ContrastModeDisplay; }; + auto sketchGraphicsCondition = [ &disp_opt ]( const SELECTION &aSel ) + { + return !disp_opt.m_DisplayDrawItemsFill; + }; + auto sketchModuleEdgeOutlinesCondition = [ &disp_opt ]( const SELECTION &aSel ) + { + return !disp_opt.m_DisplayModEdgeFill; + }; viewMenu->AddCheckItem( PCB_ACTIONS::showLayersManager, layersPaletteShownCondition ); viewMenu->AddCheckItem( PCB_ACTIONS::showMicrowaveToolbar, microwaveToolbarShownCondition ); @@ -359,6 +367,11 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() drawingModeSubMenu->AddCheckItem( PCB_ACTIONS::padDisplayMode, sketchPadsCondition ); drawingModeSubMenu->AddCheckItem( PCB_ACTIONS::viaDisplayMode, sketchViasCondition ); drawingModeSubMenu->AddCheckItem( PCB_ACTIONS::trackDisplayMode, sketchTracksCondition ); + + drawingModeSubMenu->AddSeparator(); + drawingModeSubMenu->AddCheckItem( PCB_ACTIONS::graphicDisplayMode, sketchGraphicsCondition ); + drawingModeSubMenu->AddCheckItem( PCB_ACTIONS::moduleEdgeOutlines, sketchModuleEdgeOutlinesCondition ); + viewMenu->AddMenu( drawingModeSubMenu ); // Contrast Mode Submenu diff --git a/pcbnew/tools/pcb_actions.cpp b/pcbnew/tools/pcb_actions.cpp index 7ac4fcefaf..59c25e381a 100644 --- a/pcbnew/tools/pcb_actions.cpp +++ b/pcbnew/tools/pcb_actions.cpp @@ -682,11 +682,13 @@ TOOL_ACTION PCB_ACTIONS::viaDisplayMode( "pcbnew.Control.viaDisplayMode", via_sketch_xpm ); TOOL_ACTION PCB_ACTIONS::graphicDisplayMode( "pcbnew.Control.graphicDisplayMode", - AS_GLOBAL ); + AS_GLOBAL, 0, "", + _( "Sketch Board Graphic Items" ), _( "Show board graphic items in outline mode" ), + show_graphics_mode_xpm ); TOOL_ACTION PCB_ACTIONS::moduleEdgeOutlines( "pcbnew.Control.graphicOutlines", AS_GLOBAL, 0, "", - _( "Sketch Graphics" ), _( "Show footprint graphic items in outline mode" ), + _( "Sketch Footprint Graphic Items" ), _( "Show footprint graphic items in outline mode" ), show_mod_edge_xpm ); TOOL_ACTION PCB_ACTIONS::zoneDisplayEnable( "pcbnew.Control.zoneDisplayEnable",