View: Provide a clear setup path for the initial v_offset value
authorSoeren Apel <soeren@apelpie.net>
Sun, 3 Apr 2016 18:37:53 +0000 (20:37 +0200)
committerSoeren Apel <soeren@apelpie.net>
Sun, 3 Apr 2016 18:37:53 +0000 (20:37 +0200)
commit925763b09cd26608cf4b38ce7b44800948a0e5aa
treee9201c37301aa6f423e76b171855ad7dd7ed018c
parentd6128866e740f496a1bb3c9636e188648507fc3a
View: Provide a clear setup path for the initial v_offset value

- View::update_scroll():
  The range for the vertical scrollbar is only updated if there
  are traces in the view.

- View::set_scroll_default():
  This new function adjusts the vertical offset of the view so
  that all traces are visible. Needs to be executed once after a
  new device was selected.

- View::signals_changed():
  We want to be able to clear stale items in-between devices, so
  we no longer want to simply return when no device is selected.
  This means we need to handle a missing device more gracefully.

  Also, we now reset the vertical scroll bar when no device is
  selected and call set_scroll_default() when needed.
pv/view/view.cpp
pv/view/view.hpp