diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index 90a6adc86c..16bd431f4f 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -186,6 +186,7 @@ set( EESCHEMA_DLGS dialogs/panel_sym_color_settings.cpp dialogs/panel_sym_color_settings_base.cpp dialogs/panel_sym_display_options.cpp + dialogs/panel_sym_display_options_base.cpp dialogs/panel_sym_editing_options.cpp dialogs/panel_sym_editing_options_base.cpp dialogs/panel_sym_lib_table.cpp diff --git a/eeschema/dialogs/panel_sym_display_options.cpp b/eeschema/dialogs/panel_sym_display_options.cpp index b01bca72ba..ff1aa11d74 100644 --- a/eeschema/dialogs/panel_sym_display_options.cpp +++ b/eeschema/dialogs/panel_sym_display_options.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2021-2023 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 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 @@ -21,33 +21,39 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "panel_sym_display_options.h" + +#include #include -#include -#include +#include #include -#include -#include -PANEL_SYM_DISPLAY_OPTIONS::PANEL_SYM_DISPLAY_OPTIONS( wxWindow* aParent, +PANEL_SYM_DISPLAY_OPTIONS::PANEL_SYM_DISPLAY_OPTIONS( wxWindow* aParent, APP_SETTINGS_BASE* aAppSettings ) : - RESETTABLE_PANEL( aParent ) + PANEL_SYM_DISPLAY_OPTIONS_BASE( aParent ) { - wxBoxSizer* bPanelSizer = new wxBoxSizer( wxHORIZONTAL ); - wxBoxSizer* bLeftCol = new wxBoxSizer( wxVERTICAL ); - m_galOptsPanel = new GAL_OPTIONS_PANEL( this, aAppSettings ); - bLeftCol->Add( m_galOptsPanel, 1, wxEXPAND|wxRIGHT, 15 ); - bPanelSizer->Add( bLeftCol, 0, wxLEFT, 5 ); + m_galOptionsSizer->Add( m_galOptsPanel, 1, wxEXPAND | wxRIGHT, 15 ); +} - this->SetSizerAndFit( bPanelSizer ); - this->Layout(); + +void PANEL_SYM_DISPLAY_OPTIONS::loadSymEditorSettings( SYMBOL_EDITOR_SETTINGS* cfg ) +{ + m_checkShowHiddenPins->SetValue( cfg->m_ShowHiddenPins ); + m_checkShowHiddenFields->SetValue( cfg->m_ShowHiddenFields ); + m_showPinElectricalTypes->SetValue( cfg->m_ShowPinElectricalType ); } bool PANEL_SYM_DISPLAY_OPTIONS::TransferDataToWindow() { + SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager(); + SYMBOL_EDITOR_SETTINGS* cfg = mgr.GetAppSettings(); + + loadSymEditorSettings( cfg ); + m_galOptsPanel->TransferDataToWindow(); return true; @@ -56,6 +62,12 @@ bool PANEL_SYM_DISPLAY_OPTIONS::TransferDataToWindow() bool PANEL_SYM_DISPLAY_OPTIONS::TransferDataFromWindow() { + SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager(); + SYMBOL_EDITOR_SETTINGS* cfg = mgr.GetAppSettings(); + + cfg->m_ShowHiddenPins = m_checkShowHiddenPins->GetValue(); + cfg->m_ShowHiddenFields = m_checkShowHiddenFields->GetValue(); + cfg->m_ShowPinElectricalType = m_showPinElectricalTypes->GetValue(); m_galOptsPanel->TransferDataFromWindow(); return true; @@ -65,9 +77,9 @@ bool PANEL_SYM_DISPLAY_OPTIONS::TransferDataFromWindow() void PANEL_SYM_DISPLAY_OPTIONS::ResetPanel() { SYMBOL_EDITOR_SETTINGS cfg; - cfg.Load(); // Loading without a file will init to defaults + cfg.Load(); // Loading without a file will init to defaults + + loadSymEditorSettings( &cfg ); m_galOptsPanel->ResetPanel( &cfg ); } - - diff --git a/eeschema/dialogs/panel_sym_display_options.h b/eeschema/dialogs/panel_sym_display_options.h index 91573837ac..59da39175b 100644 --- a/eeschema/dialogs/panel_sym_display_options.h +++ b/eeschema/dialogs/panel_sym_display_options.h @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 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 as published by the @@ -17,17 +17,16 @@ * with this program. If not, see . */ -#ifndef PANEL_SYM_DISPLAY_OPTIONS_H -#define PANEL_SYM_DISPLAY_OPTIONS_H - -#include +#pragma once +#include "panel_sym_display_options_base.h" class APP_SETTINGS_BASE; class GAL_OPTIONS_PANEL; +class SYMBOL_EDITOR_SETTINGS; -class PANEL_SYM_DISPLAY_OPTIONS : public RESETTABLE_PANEL +class PANEL_SYM_DISPLAY_OPTIONS : public PANEL_SYM_DISPLAY_OPTIONS_BASE { public: PANEL_SYM_DISPLAY_OPTIONS( wxWindow* aParent, APP_SETTINGS_BASE* aAppSettings ); @@ -37,9 +36,9 @@ public: void ResetPanel() override; +private: + void loadSymEditorSettings( SYMBOL_EDITOR_SETTINGS* aCfg ); + private: GAL_OPTIONS_PANEL* m_galOptsPanel; }; - - -#endif // PANEL_SYM_DISPLAY_OPTIONS_H diff --git a/eeschema/dialogs/panel_sym_display_options_base.cpp b/eeschema/dialogs/panel_sym_display_options_base.cpp new file mode 100644 index 0000000000..aab1bee739 --- /dev/null +++ b/eeschema/dialogs/panel_sym_display_options_base.cpp @@ -0,0 +1,59 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "panel_sym_display_options_base.h" + +/////////////////////////////////////////////////////////////////////////// + +PANEL_SYM_DISPLAY_OPTIONS_BASE::PANEL_SYM_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : RESETTABLE_PANEL( parent, id, pos, size, style, name ) +{ + wxBoxSizer* bPanelSizer; + bPanelSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_galOptionsSizer = new wxBoxSizer( wxVERTICAL ); + + + bPanelSizer->Add( m_galOptionsSizer, 0, wxEXPAND|wxRIGHT, 15 ); + + wxBoxSizer* bRightColumn; + bRightColumn = new wxBoxSizer( wxVERTICAL ); + + m_appearanceLabel = new wxStaticText( this, wxID_ANY, _("Appearance"), wxDefaultPosition, wxDefaultSize, 0 ); + m_appearanceLabel->Wrap( -1 ); + bRightColumn->Add( m_appearanceLabel, 0, wxTOP|wxRIGHT|wxLEFT, 13 ); + + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bRightColumn->Add( m_staticline1, 0, wxEXPAND|wxBOTTOM, 7 ); + + wxBoxSizer* bAppearanceSizer; + bAppearanceSizer = new wxBoxSizer( wxVERTICAL ); + + m_checkShowHiddenPins = new wxCheckBox( this, wxID_ANY, _("S&how hidden pins"), wxDefaultPosition, wxDefaultSize, 0 ); + bAppearanceSizer->Add( m_checkShowHiddenPins, 0, wxEXPAND|wxALL, 5 ); + + m_checkShowHiddenFields = new wxCheckBox( this, wxID_ANY, _("Show hidden fields"), wxDefaultPosition, wxDefaultSize, 0 ); + bAppearanceSizer->Add( m_checkShowHiddenFields, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + m_showPinElectricalTypes = new wxCheckBox( this, wxID_ANY, _("Show pin &electrical type"), wxDefaultPosition, wxDefaultSize, 0 ); + m_showPinElectricalTypes->SetValue(true); + bAppearanceSizer->Add( m_showPinElectricalTypes, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bRightColumn->Add( bAppearanceSizer, 0, wxEXPAND|wxTOP|wxLEFT, 5 ); + + + bPanelSizer->Add( bRightColumn, 0, wxEXPAND|wxBOTTOM|wxLEFT, 10 ); + + + this->SetSizer( bPanelSizer ); + this->Layout(); + bPanelSizer->Fit( this ); +} + +PANEL_SYM_DISPLAY_OPTIONS_BASE::~PANEL_SYM_DISPLAY_OPTIONS_BASE() +{ +} diff --git a/eeschema/dialogs/panel_sym_display_options_base.fbp b/eeschema/dialogs/panel_sym_display_options_base.fbp new file mode 100644 index 0000000000..add0dddd24 --- /dev/null +++ b/eeschema/dialogs/panel_sym_display_options_base.fbp @@ -0,0 +1,415 @@ + + + + + C++ + + 1 + table + none + + + 0 + 1 + res + UTF-8 + panel_sym_display_options_base + 1000 + 1 + 1 + UI + PanelSymDisplayOptions + . + 0 + source_name + 1 + 0 + source_name + + + 1 + 1 + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 0 + 1 + impl_virtual + + + 0 + wxID_ANY + + + PANEL_SYM_DISPLAY_OPTIONS_BASE + + -1,-1 + RESETTABLE_PANEL; widgets/resettable_panel.h; Not forward_declare + + 0 + + + wxTAB_TRAVERSAL + + + bPanelSizer + wxHORIZONTAL + none + + 15 + wxEXPAND|wxRIGHT + 0 + + + m_galOptionsSizer + wxVERTICAL + protected + + + + 10 + wxEXPAND|wxBOTTOM|wxLEFT + 0 + + + bRightColumn + wxVERTICAL + none + + 13 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Appearance + 0 + + 0 + + + 0 + + 1 + m_appearanceLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 7 + wxEXPAND|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline1 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + + + 5 + wxEXPAND|wxTOP|wxLEFT + 0 + + + bAppearanceSizer + wxVERTICAL + none + + 5 + wxEXPAND|wxALL + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + S&how hidden pins + + 0 + + + 0 + + 1 + m_checkShowHiddenPins + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 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 + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Show pin &electrical type + + 0 + + + 0 + + 1 + m_showPinElectricalTypes + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + diff --git a/eeschema/dialogs/panel_sym_display_options_base.h b/eeschema/dialogs/panel_sym_display_options_base.h new file mode 100644 index 0000000000..00514b45ee --- /dev/null +++ b/eeschema/dialogs/panel_sym_display_options_base.h @@ -0,0 +1,49 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include +#include +#include +#include "widgets/resettable_panel.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class PANEL_SYM_DISPLAY_OPTIONS_BASE +/////////////////////////////////////////////////////////////////////////////// +class PANEL_SYM_DISPLAY_OPTIONS_BASE : public RESETTABLE_PANEL +{ + private: + + protected: + wxBoxSizer* m_galOptionsSizer; + wxStaticText* m_appearanceLabel; + wxStaticLine* m_staticline1; + wxCheckBox* m_checkShowHiddenPins; + wxCheckBox* m_checkShowHiddenFields; + wxCheckBox* m_showPinElectricalTypes; + + public: + + PANEL_SYM_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + + ~PANEL_SYM_DISPLAY_OPTIONS_BASE(); + +}; + diff --git a/eeschema/dialogs/panel_sym_editing_options.cpp b/eeschema/dialogs/panel_sym_editing_options.cpp index e3123d1d28..b47309e4f3 100644 --- a/eeschema/dialogs/panel_sym_editing_options.cpp +++ b/eeschema/dialogs/panel_sym_editing_options.cpp @@ -55,7 +55,6 @@ void PANEL_SYM_EDITING_OPTIONS::loadSymEditorSettings( SYMBOL_EDITOR_SETTINGS* a m_pinNameSize.SetValue( schIUScale.MilsToIU( aCfg->m_Defaults.pin_name_size ) ); m_pinPitch.SetValue( schIUScale.MilsToIU( aCfg->m_Repeat.pin_step ) ); m_spinRepeatLabel->SetValue( aCfg->m_Repeat.label_delta ); - m_cbShowPinElectricalType->SetValue( aCfg->m_ShowPinElectricalType ); m_dragPinsWithEdges->SetValue( aCfg->m_dragPinsAlongWithEdges ); } @@ -83,7 +82,6 @@ bool PANEL_SYM_EDITING_OPTIONS::TransferDataFromWindow() settings->m_Defaults.pin_name_size = schIUScale.IUToMils( m_pinNameSize.GetIntValue() ); settings->m_Repeat.label_delta = m_spinRepeatLabel->GetValue(); settings->m_Repeat.pin_step = schIUScale.IUToMils( m_pinPitch.GetIntValue() ); - settings->m_ShowPinElectricalType = m_cbShowPinElectricalType->GetValue(); settings->m_dragPinsAlongWithEdges = m_dragPinsWithEdges->GetValue(); // Force pin_step to a grid multiple diff --git a/eeschema/dialogs/panel_sym_editing_options_base.cpp b/eeschema/dialogs/panel_sym_editing_options_base.cpp index 469a5d9d3e..f48208d640 100644 --- a/eeschema/dialogs/panel_sym_editing_options_base.cpp +++ b/eeschema/dialogs/panel_sym_editing_options_base.cpp @@ -95,9 +95,6 @@ PANEL_SYM_EDITING_OPTIONS_BASE::PANEL_SYM_EDITING_OPTIONS_BASE( wxWindow* parent leftColumn->Add( gbSizer1, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 ); - m_cbShowPinElectricalType = new wxCheckBox( this, wxID_ANY, _("Show pin &electrical type"), wxDefaultPosition, wxDefaultSize, 0 ); - leftColumn->Add( m_cbShowPinElectricalType, 0, wxBOTTOM|wxLEFT, 10 ); - leftColumn->Add( 0, 15, 0, wxEXPAND, 5 ); @@ -143,12 +140,12 @@ PANEL_SYM_EDITING_OPTIONS_BASE::PANEL_SYM_EDITING_OPTIONS_BASE( wxWindow* parent wxBoxSizer* rightColumn; rightColumn = new wxBoxSizer( wxVERTICAL ); - m_generalOption = new wxStaticText( this, wxID_ANY, _("General editing"), wxDefaultPosition, wxDefaultSize, 0 ); - m_generalOption->Wrap( -1 ); - rightColumn->Add( m_generalOption, 0, wxLEFT|wxTOP, 13 ); + m_generalOption1 = new wxStaticText( this, wxID_ANY, _("General editing"), wxDefaultPosition, wxDefaultSize, 0 ); + m_generalOption1->Wrap( -1 ); + rightColumn->Add( m_generalOption1, 0, wxLEFT|wxRIGHT|wxTOP, 13 ); - m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - rightColumn->Add( m_staticline3, 0, wxEXPAND | wxALL, 5 ); + m_staticline4 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + rightColumn->Add( m_staticline4, 0, wxEXPAND | wxALL, 5 ); m_dragPinsWithEdges = new wxCheckBox( this, wxID_ANY, _("Keep pins attached when dragging edges"), wxDefaultPosition, wxDefaultSize, 0 ); rightColumn->Add( m_dragPinsWithEdges, 0, wxBOTTOM|wxLEFT, 10 ); @@ -157,7 +154,7 @@ PANEL_SYM_EDITING_OPTIONS_BASE::PANEL_SYM_EDITING_OPTIONS_BASE( wxWindow* parent rightColumn->Add( 0, 15, 1, wxEXPAND, 5 ); - p1mainSizer->Add( rightColumn, 1, wxEXPAND, 5 ); + p1mainSizer->Add( rightColumn, 1, wxEXPAND|wxLEFT, 5 ); this->SetSizer( p1mainSizer ); diff --git a/eeschema/dialogs/panel_sym_editing_options_base.fbp b/eeschema/dialogs/panel_sym_editing_options_base.fbp index fca927c371..f8b86d6e27 100644 --- a/eeschema/dialogs/panel_sym_editing_options_base.fbp +++ b/eeschema/dialogs/panel_sym_editing_options_base.fbp @@ -1272,71 +1272,6 @@ - - 10 - wxBOTTOM|wxLEFT - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Show pin &electrical type - - 0 - - - 0 - - 1 - m_cbShowPinElectricalType - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - 5 wxEXPAND @@ -1829,7 +1764,7 @@ 5 - wxEXPAND + wxEXPAND|wxLEFT 1 @@ -1838,7 +1773,7 @@ none 13 - wxLEFT|wxTOP + wxLEFT|wxRIGHT|wxTOP 0 1 @@ -1878,7 +1813,7 @@ 0 1 - m_generalOption + m_generalOption1 1 @@ -1938,7 +1873,7 @@ 0 1 - m_staticline3 + m_staticline4 1 diff --git a/eeschema/dialogs/panel_sym_editing_options_base.h b/eeschema/dialogs/panel_sym_editing_options_base.h index 80fb0a3141..907f38ea20 100644 --- a/eeschema/dialogs/panel_sym_editing_options_base.h +++ b/eeschema/dialogs/panel_sym_editing_options_base.h @@ -20,9 +20,9 @@ #include #include #include -#include #include #include +#include #include /////////////////////////////////////////////////////////////////////////// @@ -53,7 +53,6 @@ class PANEL_SYM_EDITING_OPTIONS_BASE : public RESETTABLE_PANEL wxStaticText* m_pinNameSizeLabel; wxTextCtrl* m_pinNameSizeCtrl; wxStaticText* m_pinNameSizeUnits; - wxCheckBox* m_cbShowPinElectricalType; wxStaticText* m_repeatLabel; wxStaticLine* m_staticline2; wxStaticText* m_pinPitchLabel; @@ -61,8 +60,8 @@ class PANEL_SYM_EDITING_OPTIONS_BASE : public RESETTABLE_PANEL wxStaticText* m_pinPitchUnits; wxStaticText* m_labelIncrementLabel1; wxSpinCtrl* m_spinRepeatLabel; - wxStaticText* m_generalOption; - wxStaticLine* m_staticline3; + wxStaticText* m_generalOption1; + wxStaticLine* m_staticline4; wxCheckBox* m_dragPinsWithEdges; // Virtual event handlers, override them in your derived class diff --git a/eeschema/symbol_editor/symbol_edit_frame.cpp b/eeschema/symbol_editor/symbol_edit_frame.cpp index 57173fc407..975b6a9ada 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.cpp +++ b/eeschema/symbol_editor/symbol_edit_frame.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include @@ -506,19 +506,19 @@ void SYMBOL_EDIT_FRAME::setupUIConditions() auto pinTypeCond = [this]( const SELECTION& ) { - return GetRenderSettings() && GetRenderSettings()->m_ShowPinsElectricalType; + return libeditconfig()->m_ShowPinElectricalType; }; auto hiddenPinCond = [this]( const SELECTION& ) { - return GetRenderSettings() && GetRenderSettings()->m_ShowHiddenPins; + return libeditconfig()->m_ShowHiddenPins; }; auto hiddenFieldCond = [this]( const SELECTION& ) { - return GetRenderSettings() && GetRenderSettings()->m_ShowHiddenFields; + return libeditconfig()->m_ShowHiddenFields; }; auto showLibraryTreeCond = @@ -1904,12 +1904,12 @@ void SYMBOL_EDIT_FRAME::updateSelectionFilterVisbility() bool SYMBOL_EDIT_FRAME::GetShowInvisibleFields() { // Returns the current render option for invisible fields - return GetRenderSettings()->m_ShowHiddenFields; + return libeditconfig()->m_ShowHiddenFields; } bool SYMBOL_EDIT_FRAME::GetShowInvisiblePins() { // Returns the current render option for invisible pins - return GetRenderSettings()->m_ShowHiddenPins; + return libeditconfig()->m_ShowHiddenPins; } diff --git a/eeschema/tools/symbol_editor_control.cpp b/eeschema/tools/symbol_editor_control.cpp index 6992cc2fca..945341094e 100644 --- a/eeschema/tools/symbol_editor_control.cpp +++ b/eeschema/tools/symbol_editor_control.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -580,12 +581,14 @@ int SYMBOL_EDITOR_CONTROL::ToggleHiddenPins( const TOOL_EVENT& aEvent ) if( !m_isSymbolEditor ) return 0; - SYMBOL_EDIT_FRAME* editFrame = getEditFrame(); - editFrame->GetRenderSettings()->m_ShowHiddenPins = - !editFrame->GetRenderSettings()->m_ShowHiddenPins; + SYMBOL_EDITOR_SETTINGS* cfg = m_frame->libeditconfig(); + cfg->m_ShowHiddenPins = !cfg->m_ShowHiddenPins; + + getEditFrame()->GetRenderSettings()->m_ShowHiddenPins = + cfg->m_ShowHiddenPins; getView()->UpdateAllItems( KIGFX::REPAINT ); - editFrame->GetCanvas()->Refresh(); + m_frame->GetCanvas()->Refresh(); return 0; } @@ -595,12 +598,15 @@ int SYMBOL_EDITOR_CONTROL::ToggleHiddenFields( const TOOL_EVENT& aEvent ) if( !m_isSymbolEditor ) return 0; - SYMBOL_EDIT_FRAME* editFrame = getEditFrame(); - editFrame->GetRenderSettings()->m_ShowHiddenFields = - !editFrame->GetRenderSettings()->m_ShowHiddenFields; + SYMBOL_EDITOR_SETTINGS* cfg = m_frame->libeditconfig(); + cfg->m_ShowHiddenFields = !cfg->m_ShowHiddenFields; + + // TODO: Why is this needed in symbol edit and not in schematic edit? + getEditFrame()->GetRenderSettings()->m_ShowHiddenFields = + cfg->m_ShowHiddenFields; getView()->UpdateAllItems( KIGFX::REPAINT ); - editFrame->GetCanvas()->Refresh(); + m_frame->GetCanvas()->Refresh(); return 0; }