[PATCH] When switching sort order, scroll the dive list to the current dive

Linus Torvalds torvalds at linux-foundation.org
Thu Jan 31 14:40:54 PST 2013


Now that we actually seem to understand the whole notion of setting the
active dive, let's take that code a bit further, and always scroll to it
when we're introducing a new sort ordering.

Sure, there may be other selected dives, but we have one primary
(current) dive that we show the profile and dive data for, and when we
switch sort order we probably want to see that dive in the dive list.

Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
---

NOTE! I'm not 100% sure this is the right thing to do - please play
around with it.

In many cases, you *are* interested primarily in the current dive, and
when you switch sort order, you want to still see that current dive in
the dive list. HOWEVER, it is also possible that you are switching
sorting order in order to then select new dives ("change sort order to
see the deepest dives"), and it is possible that we should just always
scroll up to the top.

That said, scrolling up to the top is always easy regardless, while
finding the current dive is not necessarily so. So this conceptually
keeps the easy thing still fairly easy, and makes the potentially
annoying "try to find the current dive in the current sort list"
trivial for the cases when you want it.

Play with it, see if you like it, apply it or not.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-When-switching-sort-order-always-scroll-to-the-curre.patch
Type: application/octet-stream
Size: 3917 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130201/869f536f/attachment-0001.obj>


More information about the subsurface mailing list