From e9651794d621d3986e5aa62d9dfd7ee2fca170bf Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 18 Nov 2024 14:48:30 +0100 Subject: [PATCH] View menus: fix show/hide panel inconsistencies in FP and Symbol editors Fixes https://gitlab.com/kicad/code/kicad/-/issues/19147 --- common/tool/actions.cpp | 2 +- eeschema/symbol_editor/menubar_symbol_editor.cpp | 9 +++++++-- eeschema/symbol_editor/symbol_edit_frame.cpp | 2 +- pcbnew/menubar_footprint_editor.cpp | 15 +++++++++------ 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/common/tool/actions.cpp b/common/tool/actions.cpp index 302b937304..00e5308f75 100644 --- a/common/tool/actions.cpp +++ b/common/tool/actions.cpp @@ -801,7 +801,7 @@ TOOL_ACTION ACTIONS::unpinLibrary( TOOL_ACTION_ARGS() TOOL_ACTION ACTIONS::showLibraryTree( TOOL_ACTION_ARGS() .Name( "common.Control.showLibraryTree" ) .Scope( AS_GLOBAL ) - .FriendlyName( _( "Show Library Tree" ) ) + .FriendlyName( _( "Library Tree" ) ) .Icon( BITMAPS::search_tree ) ); TOOL_ACTION ACTIONS::hideLibraryTree( TOOL_ACTION_ARGS() diff --git a/eeschema/symbol_editor/menubar_symbol_editor.cpp b/eeschema/symbol_editor/menubar_symbol_editor.cpp index fb22e7da90..3d408e7956 100644 --- a/eeschema/symbol_editor/menubar_symbol_editor.cpp +++ b/eeschema/symbol_editor/menubar_symbol_editor.cpp @@ -116,8 +116,14 @@ void SYMBOL_EDIT_FRAME::doReCreateMenuBar() // ACTION_MENU* viewMenu = new ACTION_MENU( false, selTool ); + ACTION_MENU* showHidePanels = new ACTION_MENU( false, selTool ); + showHidePanels->SetTitle( _( "Panels" ) ); + showHidePanels->Add( ACTIONS::showProperties, ACTION_MENU::CHECK ); + showHidePanels->Add( ACTIONS::showLibraryTree, ACTION_MENU::CHECK ); + viewMenu->Add( showHidePanels ); + viewMenu->AppendSeparator(); + viewMenu->Add( ACTIONS::showSymbolBrowser ); - viewMenu->Add( ACTIONS::showProperties, ACTION_MENU::CHECK ); viewMenu->AppendSeparator(); viewMenu->Add( ACTIONS::zoomInCenter ); @@ -127,7 +133,6 @@ void SYMBOL_EDIT_FRAME::doReCreateMenuBar() viewMenu->Add( ACTIONS::zoomRedraw ); viewMenu->AppendSeparator(); - viewMenu->Add( ACTIONS::showLibraryTree, ACTION_MENU::CHECK ); viewMenu->Add( EE_ACTIONS::showHiddenPins, ACTION_MENU::CHECK ); viewMenu->Add( EE_ACTIONS::showHiddenFields, ACTION_MENU::CHECK ); viewMenu->Add( EE_ACTIONS::togglePinAltIcons,ACTION_MENU::CHECK ); diff --git a/eeschema/symbol_editor/symbol_edit_frame.cpp b/eeschema/symbol_editor/symbol_edit_frame.cpp index 49b32d048f..f7a3575036 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.cpp +++ b/eeschema/symbol_editor/symbol_edit_frame.cpp @@ -556,7 +556,7 @@ void SYMBOL_EDIT_FRAME::setupUIConditions() mgr->SetConditions( EE_ACTIONS::showElectricalTypes, CHECK( pinTypeCond ) ); mgr->SetConditions( ACTIONS::toggleBoundingBoxes, CHECK( cond.BoundingBoxes() ) ); - mgr->SetConditions( EE_ACTIONS::showDesignBlockPanel, CHECK( showLibraryTreeCond ) ); + mgr->SetConditions( ACTIONS::showLibraryTree, CHECK( showLibraryTreeCond ) ); mgr->SetConditions( ACTIONS::showProperties, CHECK( propertiesCond ) ); mgr->SetConditions( EE_ACTIONS::showHiddenPins, CHECK( hiddenPinCond ) ); mgr->SetConditions( EE_ACTIONS::showHiddenFields, CHECK( hiddenFieldCond ) ); diff --git a/pcbnew/menubar_footprint_editor.cpp b/pcbnew/menubar_footprint_editor.cpp index 714557382a..1a4a0eb3b6 100644 --- a/pcbnew/menubar_footprint_editor.cpp +++ b/pcbnew/menubar_footprint_editor.cpp @@ -4,7 +4,7 @@ * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2015 SoftPLC Corporation, Dick Hollenbeck * Copyright (C) 2015 Wayne Stambaugh - * Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2024 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -120,6 +120,14 @@ void FOOTPRINT_EDIT_FRAME::doReCreateMenuBar() // ACTION_MENU* viewMenu = new ACTION_MENU( false, selTool ); + ACTION_MENU* showHidePanels = new ACTION_MENU( false, selTool ); + showHidePanels->SetTitle( _( "Panels" ) ); + showHidePanels->Add( ACTIONS::showProperties, ACTION_MENU::CHECK ); + showHidePanels->Add( ACTIONS::showLibraryTree, ACTION_MENU::CHECK ); + showHidePanels->Add( PCB_ACTIONS::showLayersManager, ACTION_MENU::CHECK ); + viewMenu->Add( showHidePanels ); + viewMenu->AppendSeparator(); + viewMenu->Add( ACTIONS::showFootprintBrowser ); viewMenu->Add( ACTIONS::show3DViewer ); @@ -153,11 +161,6 @@ void FOOTPRINT_EDIT_FRAME::doReCreateMenuBar() viewMenu->Add( PCB_ACTIONS::flipBoard, ACTION_MENU::CHECK ); - viewMenu->AppendSeparator(); - viewMenu->Add( ACTIONS::showProperties, ACTION_MENU::CHECK ); - viewMenu->Add( ACTIONS::showLibraryTree, ACTION_MENU::CHECK ); - viewMenu->Add( PCB_ACTIONS::showLayersManager, ACTION_MENU::CHECK ); - //-- Place menu ------------------------------------------------------- //