Apply new on-canvas-item marking to footprint editor tree.
This commit is contained in:
parent
530b72972d
commit
d382a11c2a
|
@ -91,7 +91,7 @@ public:
|
|||
// We should be able to pass wxDATAVIEW_CELL_SELECTED into RenderText() and have it do
|
||||
// the right thing -- but it picks wxSYS_COLOUR_HIGHLIGHTTEXT on MacOS and GTK (instead
|
||||
// of wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT).
|
||||
if ( aState & wxDATAVIEW_CELL_SELECTED )
|
||||
if( aState & wxDATAVIEW_CELL_SELECTED )
|
||||
dc->SetTextForeground( wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT ) );
|
||||
|
||||
aRect.Deflate( 1 );
|
||||
|
|
|
@ -329,22 +329,11 @@ bool SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetAttr( wxDataViewItem const& aItem, un
|
|||
// mark the current library if it's collapsed
|
||||
if( curSymbol && curSymbol->GetLibId().GetLibNickname() == node->m_LibId.GetLibNickname() )
|
||||
{
|
||||
#if 1
|
||||
if( !m_widget->IsExpanded( ToItem( node ) ) )
|
||||
{
|
||||
// LIB_TREE_RENDERER uses strikethrough as a proxy for is-canvas-item
|
||||
aAttr.SetStrikethrough( true );
|
||||
aAttr.SetStrikethrough( true ); // LIB_TREE_RENDERER uses strikethrough as a
|
||||
// proxy for "is canvas item"
|
||||
}
|
||||
#else
|
||||
#ifdef __WXGTK__
|
||||
// The native wxGTK+ impl ignores background colour, so set the text colour instead.
|
||||
// This works reasonably well in dark themes, and quite poorly in light ones....
|
||||
aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
|
||||
#else
|
||||
aAttr.SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
|
||||
aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT ) );
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -358,19 +347,8 @@ bool SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetAttr( wxDataViewItem const& aItem, un
|
|||
// mark the current (on-canvas) part
|
||||
if( curSymbol && curSymbol->GetLibId() == node->m_LibId )
|
||||
{
|
||||
#if 1
|
||||
// LIB_TREE_RENDERER uses strikethrough as a proxy for is-canvas-item
|
||||
aAttr.SetStrikethrough( true );
|
||||
#else
|
||||
#ifdef __WXGTK__
|
||||
// The native wxGTK+ impl ignores background colour, so set the text colour instead.
|
||||
// This works reasonably well in dark themes, and quite poorly in light ones....
|
||||
aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
|
||||
#else
|
||||
aAttr.SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
|
||||
aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT ) );
|
||||
#endif
|
||||
#endif
|
||||
aAttr.SetStrikethrough( true ); // LIB_TREE_RENDERER uses strikethrough as a
|
||||
// proxy for "is canvas item"
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -280,14 +280,12 @@ bool FP_TREE_SYNCHRONIZING_ADAPTER::GetAttr( wxDataViewItem const& aItem, unsign
|
|||
case LIB_TREE_NODE::LIBRARY:
|
||||
if( node->m_Name == m_frame->GetLoadedFPID().GetLibNickname() )
|
||||
{
|
||||
#ifdef __WXGTK__
|
||||
// The native wxGTK+ impl ignores background colour, so set the text colour
|
||||
// instead. Works reasonably well in dark themes, less well in light ones....
|
||||
aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
|
||||
#else
|
||||
aAttr.SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
|
||||
aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT ) );
|
||||
#endif
|
||||
// mark the current library if it's collapsed
|
||||
if( !m_widget->IsExpanded( ToItem( node ) ) )
|
||||
{
|
||||
aAttr.SetStrikethrough( true ); // LIB_TREE_RENDERER uses strikethrough as a
|
||||
// proxy for "is canvas item"
|
||||
}
|
||||
|
||||
// mark modified libs with bold font
|
||||
if( m_frame->GetScreen()->IsContentModified() && !m_frame->IsCurrentFPFromBoard() )
|
||||
|
@ -298,14 +296,9 @@ bool FP_TREE_SYNCHRONIZING_ADAPTER::GetAttr( wxDataViewItem const& aItem, unsign
|
|||
case LIB_TREE_NODE::ITEM:
|
||||
if( node->m_LibId == m_frame->GetLoadedFPID() )
|
||||
{
|
||||
#ifdef __WXGTK__
|
||||
// The native wxGTK+ impl ignores background colour, so set the text colour
|
||||
// instead. Works reasonably well in dark themes, less well in light ones....
|
||||
aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
|
||||
#else
|
||||
aAttr.SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
|
||||
aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT ) );
|
||||
#endif
|
||||
// mark the current (on-canvas) part
|
||||
aAttr.SetStrikethrough( true ); // LIB_TREE_RENDERER uses strikethrough as a
|
||||
// proxy for "is canvas item"
|
||||
|
||||
// mark modified part with bold font
|
||||
if( m_frame->GetScreen()->IsContentModified() && !m_frame->IsCurrentFPFromBoard() )
|
||||
|
|
Loading…
Reference in New Issue