From 1322e0bc73179f6065c8b0b8d92e42f5add4f84d Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 27 May 2024 17:02:00 +0200 Subject: [PATCH] symbol editor: allows rotation of fields in derived symbols. Fields in derived symbols are editable, so the context menu must allow rotations. Fixes https://gitlab.com/kicad/code/kicad/-/issues/18003 --- eeschema/symbol_editor/symbol_edit_frame.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/eeschema/symbol_editor/symbol_edit_frame.cpp b/eeschema/symbol_editor/symbol_edit_frame.cpp index 899975defa..19b5444a13 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.cpp +++ b/eeschema/symbol_editor/symbol_edit_frame.cpp @@ -431,6 +431,15 @@ void SYMBOL_EDIT_FRAME::setupUIConditions() return IsSymbolEditable() && !IsSymbolAlias(); }; + auto isEditableInAliasCond = + [this]( const SELECTION& ) + { + // Less restrictive than isEditableCond + // Symbols fields (root symbols and aliases) from the new s-expression libraries + // or in the schematic are editable. + return IsSymbolEditable(); + }; + auto symbolModifiedCondition = [this]( const SELECTION& sel ) { @@ -482,8 +491,10 @@ void SYMBOL_EDIT_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::selectAll, ENABLE( haveSymbolCond ) ); mgr->SetConditions( ACTIONS::unselectAll, ENABLE( haveSymbolCond ) ); - mgr->SetConditions( EE_ACTIONS::rotateCW, ENABLE( isEditableCond ) ); - mgr->SetConditions( EE_ACTIONS::rotateCCW, ENABLE( isEditableCond ) ); + // These actions in symbol editor when editing alias field rotations are allowed. + mgr->SetConditions( EE_ACTIONS::rotateCW, ENABLE( isEditableInAliasCond ) ); + mgr->SetConditions( EE_ACTIONS::rotateCCW, ENABLE( isEditableInAliasCond ) ); + mgr->SetConditions( EE_ACTIONS::mirrorH, ENABLE( isEditableCond ) ); mgr->SetConditions( EE_ACTIONS::mirrorV, ENABLE( isEditableCond ) );