View: Adjust top margin when needed
authorSoeren Apel <soeren@apelpie.net>
Tue, 30 May 2017 06:07:50 +0000 (08:07 +0200)
committerUwe Hermann <uwe@hermann-uwe.de>
Tue, 30 May 2017 18:10:15 +0000 (20:10 +0200)
commit8a5fd81fea577663e8c0f17e53d5928599d0926d
tree983e282d292d13e231084f80ed9cf81d11c640a8
parent5f9b7de5c8c71801141d35497786bf57f75e3ca4
View: Adjust top margin when needed

When the view is big and the traces are vertically centered,
there will be blank space above and below the block of traces.
When the user then resizes the window and makes it smaller,
the white space stays, pushing traces out of the view that
could fit on-screen if the blank space was adjusted properly.

This is what we do with this patch.

If there is still enough space to make everything fit, we
center the traces vertically. If there's not enough space
to make everything fit, we make sure that the top traces
are shown.
pv/view/view.cpp
pv/view/view.hpp