diff --git a/eeschema/dialogs/panel_eeschema_display_options.cpp b/eeschema/dialogs/panel_eeschema_display_options.cpp index 97bdc7b68c..51dc13c398 100644 --- a/eeschema/dialogs/panel_eeschema_display_options.cpp +++ b/eeschema/dialogs/panel_eeschema_display_options.cpp @@ -52,6 +52,7 @@ bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow() EESCHEMA_SETTINGS* cfg = m_frame->eeconfig(); m_checkShowHiddenPins->SetValue( cfg->m_Appearance.show_hidden_pins ); + m_checkShowHiddenFields->SetValue( cfg->m_Appearance.show_hidden_fields ); m_checkPageLimits->SetValue( cfg->m_Appearance.show_page_limits ); m_checkSelTextBox->SetValue( cfg->m_Selection.text_as_box ); @@ -70,6 +71,7 @@ bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow() EESCHEMA_SETTINGS* cfg = m_frame->eeconfig(); cfg->m_Appearance.show_hidden_pins = m_checkShowHiddenPins->GetValue(); + cfg->m_Appearance.show_hidden_fields = m_checkShowHiddenFields->GetValue(); cfg->m_Appearance.show_page_limits = m_checkPageLimits->GetValue(); cfg->m_Selection.text_as_box = m_checkSelTextBox->GetValue(); @@ -79,6 +81,7 @@ bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow() // Update canvas m_frame->GetRenderSettings()->m_ShowHiddenPins = m_checkShowHiddenPins->GetValue(); + m_frame->GetRenderSettings()->m_ShowHiddenText = m_checkShowHiddenFields->GetValue(); m_frame->GetRenderSettings()->SetShowPageLimits( cfg->m_Appearance.show_page_limits ); m_frame->GetCanvas()->GetView()->MarkDirty(); m_frame->GetCanvas()->GetView()->UpdateAllItems( KIGFX::REPAINT ); diff --git a/eeschema/dialogs/panel_eeschema_display_options_base.cpp b/eeschema/dialogs/panel_eeschema_display_options_base.cpp index af9e3f79cc..5530781de1 100644 --- a/eeschema/dialogs/panel_eeschema_display_options_base.cpp +++ b/eeschema/dialogs/panel_eeschema_display_options_base.cpp @@ -28,6 +28,9 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWind m_checkShowHiddenPins = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("S&how hidden pins"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizer1->Add( m_checkShowHiddenPins, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + m_checkShowHiddenFields = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Show hidden fields"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer1->Add( m_checkShowHiddenFields, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + m_checkPageLimits = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Show page limi&ts"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkPageLimits->SetValue(true); sbSizer1->Add( m_checkPageLimits, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); diff --git a/eeschema/dialogs/panel_eeschema_display_options_base.fbp b/eeschema/dialogs/panel_eeschema_display_options_base.fbp index 161c408b22..920a01f03b 100644 --- a/eeschema/dialogs/panel_eeschema_display_options_base.fbp +++ b/eeschema/dialogs/panel_eeschema_display_options_base.fbp @@ -150,6 +150,70 @@ + + 5 + wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Show hidden fields + + 0 + + + 0 + + 1 + m_checkShowHiddenFields + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + 5 wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT diff --git a/eeschema/dialogs/panel_eeschema_display_options_base.h b/eeschema/dialogs/panel_eeschema_display_options_base.h index 3ca734e575..4953a0171c 100644 --- a/eeschema/dialogs/panel_eeschema_display_options_base.h +++ b/eeschema/dialogs/panel_eeschema_display_options_base.h @@ -34,6 +34,7 @@ class PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE : public wxPanel protected: wxBoxSizer* m_galOptionsSizer; wxCheckBox* m_checkShowHiddenPins; + wxCheckBox* m_checkShowHiddenFields; wxCheckBox* m_checkPageLimits; wxCheckBox* m_checkSelTextBox; wxCheckBox* m_checkSelDrawChildItems; diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index 6e72aedade..d752806ce4 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -394,6 +394,7 @@ void SCH_EDIT_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg ) GetRenderSettings()->m_ShowPinsElectricalType = false; GetRenderSettings()->m_ShowHiddenText = false; GetRenderSettings()->m_ShowHiddenPins = eeconfig()->m_Appearance.show_hidden_pins; + GetRenderSettings()->m_ShowHiddenText = eeconfig()->m_Appearance.show_hidden_fields; GetRenderSettings()->SetShowPageLimits( eeconfig()->m_Appearance.show_page_limits ); GetRenderSettings()->m_ShowUmbilicals = true; } diff --git a/eeschema/eeschema_settings.cpp b/eeschema/eeschema_settings.cpp index 5a7994a5cc..643f04be7e 100644 --- a/eeschema/eeschema_settings.cpp +++ b/eeschema/eeschema_settings.cpp @@ -59,6 +59,9 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() : APP_SETTINGS_BASE( "eeschema", eeschema m_params.emplace_back( new PARAM( "appearance.show_hidden_pins", &m_Appearance.show_hidden_pins, false ) ); + m_params.emplace_back( new PARAM( "appearance.show_hidden_fields", + &m_Appearance.show_hidden_fields, false ) ); + m_params.emplace_back( new PARAM( "appearance.show_illegal_symbol_lib_dialog", &m_Appearance.show_illegal_symbol_lib_dialog, true ) ); diff --git a/eeschema/eeschema_settings.h b/eeschema/eeschema_settings.h index 04c3a4496e..6bf2624c33 100644 --- a/eeschema/eeschema_settings.h +++ b/eeschema/eeschema_settings.h @@ -43,6 +43,7 @@ public: bool navigator_stays_open; bool print_sheet_reference; bool show_hidden_pins; + bool show_hidden_fields; bool show_illegal_symbol_lib_dialog; bool show_page_limits; bool show_sheet_filename_case_sensitivity_dialog; diff --git a/eeschema/tools/ee_actions.cpp b/eeschema/tools/ee_actions.cpp index 82acda7209..790bfcdedb 100644 --- a/eeschema/tools/ee_actions.cpp +++ b/eeschema/tools/ee_actions.cpp @@ -598,6 +598,11 @@ TOOL_ACTION EE_ACTIONS::toggleHiddenPins( "eeschema.EditorControl.showHiddenPins _( "Show Hidden Pins" ), "", hidden_pin_xpm ); +TOOL_ACTION EE_ACTIONS::toggleHiddenFields( "eeschema.EditorControl.showHiddenFields", + AS_GLOBAL, 0, "", + _( "Show Hidden Fields" ), "", + nullptr ); + TOOL_ACTION EE_ACTIONS::toggleForceHV( "eeschema.EditorControl.forceHVLines", AS_GLOBAL, 0, "", _( "Force H/V Wires and Buses" ), "", diff --git a/eeschema/tools/ee_actions.h b/eeschema/tools/ee_actions.h index 315c2b753c..60e2ac6920 100644 --- a/eeschema/tools/ee_actions.h +++ b/eeschema/tools/ee_actions.h @@ -181,6 +181,7 @@ public: static TOOL_ACTION cleanupSheetPins; static TOOL_ACTION editTextAndGraphics; static TOOL_ACTION toggleHiddenPins; + static TOOL_ACTION toggleHiddenFields; static TOOL_ACTION toggleSyncedPinsMode; static TOOL_ACTION restartMove; static TOOL_ACTION explicitCrossProbe; diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 60df317e7b..f023459f83 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -1462,6 +1462,21 @@ int SCH_EDITOR_CONTROL::ToggleHiddenPins( const TOOL_EVENT& aEvent ) } +int SCH_EDITOR_CONTROL::ToggleHiddenFields( const TOOL_EVENT& aEvent ) +{ + EESCHEMA_SETTINGS* cfg = m_frame->eeconfig(); + cfg->m_Appearance.show_hidden_fields = !cfg->m_Appearance.show_hidden_fields; + + KIGFX::SCH_PAINTER* painter = static_cast( getView()->GetPainter() ); + painter->GetSettings()->m_ShowHiddenText = cfg->m_Appearance.show_hidden_fields; + + getView()->UpdateAllItems( KIGFX::REPAINT ); + m_frame->GetCanvas()->Refresh(); + + return 0; +} + + int SCH_EDITOR_CONTROL::ToggleForceHV( const TOOL_EVENT& aEvent ) { m_frame->eeconfig()->m_Drawing.hv_lines_only = !m_frame->eeconfig()->m_Drawing.hv_lines_only; @@ -1535,5 +1550,6 @@ void SCH_EDITOR_CONTROL::setTransitions() Go( &SCH_EDITOR_CONTROL::NavigateHierarchy, EE_ACTIONS::navigateHierarchy.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::ToggleHiddenPins, EE_ACTIONS::toggleHiddenPins.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ToggleHiddenFields, EE_ACTIONS::toggleHiddenFields.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::ToggleForceHV, EE_ACTIONS::toggleForceHV.MakeEvent() ); } diff --git a/eeschema/tools/sch_editor_control.h b/eeschema/tools/sch_editor_control.h index cc8158c8d6..33b18cce69 100644 --- a/eeschema/tools/sch_editor_control.h +++ b/eeschema/tools/sch_editor_control.h @@ -119,6 +119,7 @@ public: int NavigateHierarchy( const TOOL_EVENT& aEvent ); int ToggleHiddenPins( const TOOL_EVENT& aEvent ); + int ToggleHiddenFields( const TOOL_EVENT& aEvent ); int ToggleForceHV( const TOOL_EVENT& aEvent ); void BackAnnotateFootprints( const std::string& aChangedSetOfReferences );