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 ) );