Fix GUITable selection issues with trees
authorKahrl <kahrl@gmx.net>
Sat, 17 Oct 2015 21:34:45 +0000 (23:34 +0200)
committerKahrl <kahrl@gmx.net>
Sat, 17 Oct 2015 21:57:28 +0000 (23:57 +0200)
commitc4d18623440b58b9f90629c798687608bc32c6da
treed864e0ebbbf752a9909a69dda4685488f5e16e6a
parent6b408248a16b0c61007247d8bce23a349f86b45c
Fix GUITable selection issues with trees

- setOpenedTrees(): this internal function was calling setSelected()
  to update m_selected. Since setSelected() calls autoScroll(),
  this caused the scrollbar to scroll back to the selected row
  in some cases when that shouldn't be done.

  For example, clicking the "+" to open a tree caused autoscroll.

  Fix this by making setOpenedTrees() modify m_selected directly.

- setDynamicData(): set scrollbar position after calling
  setSelected(), not before. This avoids setSelected()'s autoscroll
  messing up the scrollbar position again.

- setSelected(): If an invisible row is selected, open all parents
  of the selected row in order to make the selected row visible.

  This fixes the issue where all the trees are closed again whenever
  you return from the setting edit dialog to the settings tab.
src/guiTable.cpp