Browse Source

Fix lexical sort in component tree widget on Windows

Apparently explicitly requesting a column to be sorted breaks component
filtering on Windows. Without SetSortOrder() call the list is sorted and
filtering still works as expected.

Fixes: lp:1739412
* https://bugs.launchpad.net/kicad/+bug/1739412
pull/5/merge
Maciej Suminski 8 years ago
parent
commit
7f9876ec27
  1. 4
      eeschema/cmp_tree_model_adapter_base.cpp
  2. 8
      eeschema/widgets/component_tree.cpp

4
eeschema/cmp_tree_model_adapter_base.cpp

@ -189,10 +189,6 @@ void CMP_TREE_MODEL_ADAPTER_BASE::AttachTo( wxDataViewCtrl* aDataViewCtrl )
ColWidth( m_tree, 0, part_head ) );
m_col_desc = aDataViewCtrl->AppendTextColumn( desc_head, 1, wxDATAVIEW_CELL_INERT,
ColWidth( m_tree, 1, desc_head ) );
// Enabling sort order breaks node selection on Windows, so unfortunately the list
// stays sorted in inverted lexical order. On Linux it does not change anything.
m_col_part->SetSortOrder( 0 );
}

8
eeschema/widgets/component_tree.cpp

@ -253,19 +253,11 @@ void COMPONENT_TREE::onQueryCharHook( wxKeyEvent& aKeyStroke )
switch( aKeyStroke.GetKeyCode() )
{
#ifndef __WINDOWS__
case WXK_UP:
#else
case WXK_DOWN:
#endif
selectIfValid( GetPrevItem( *m_tree_ctrl, sel ) );
break;
#ifndef __WINDOWS__
case WXK_DOWN:
#else
case WXK_UP:
#endif
selectIfValid( GetNextItem( *m_tree_ctrl, sel ) );
break;

Loading…
Cancel
Save