From d900e89382fb8d2b40840c5f759ed94b4edc7c6e Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 14 Nov 2017 12:12:50 +0100 Subject: [PATCH] Library Editor: fixed a bug when multiple components were shown as active --- eeschema/lib_manager.h | 8 ++++++++ eeschema/lib_manager_adapter.cpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/eeschema/lib_manager.h b/eeschema/lib_manager.h index 31cddd85e0..2b82eda263 100644 --- a/eeschema/lib_manager.h +++ b/eeschema/lib_manager.h @@ -255,6 +255,14 @@ public: m_currentPart = aPart; } + /** + * Returns the current library and part name as LIB_ID. + */ + LIB_ID GetCurrentLibId() const + { + return LIB_ID( m_currentLib, m_currentPart ); + } + private: ///> Parent frame LIB_EDIT_FRAME& m_frame; diff --git a/eeschema/lib_manager_adapter.cpp b/eeschema/lib_manager_adapter.cpp index 6c4d4b19b9..717a72d724 100644 --- a/eeschema/lib_manager_adapter.cpp +++ b/eeschema/lib_manager_adapter.cpp @@ -247,7 +247,7 @@ bool LIB_MANAGER_ADAPTER::GetAttr( wxDataViewItem const& aItem, unsigned int aCo aAttr.SetItalic( !node->IsRoot ); // mark current library with inverted colors - if( node->Name == m_libMgr->GetCurrentPart() ) + if( node->LibId == m_libMgr->GetCurrentLibId() ) { aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) ); aAttr.SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );