Library Editor: fixed a bug when multiple components were shown as active

This commit is contained in:
Maciej Suminski 2017-11-14 12:12:50 +01:00
parent ba4515885b
commit d900e89382
2 changed files with 9 additions and 1 deletions

View File

@ -255,6 +255,14 @@ public:
m_currentPart = aPart; 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: private:
///> Parent frame ///> Parent frame
LIB_EDIT_FRAME& m_frame; LIB_EDIT_FRAME& m_frame;

View File

@ -247,7 +247,7 @@ bool LIB_MANAGER_ADAPTER::GetAttr( wxDataViewItem const& aItem, unsigned int aCo
aAttr.SetItalic( !node->IsRoot ); aAttr.SetItalic( !node->IsRoot );
// mark current library with inverted colors // 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.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
aAttr.SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) ); aAttr.SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );