In case there were less items in the list than on a page, it was possible
that a "scrollTo" call scrolled items out of the view even though all could
be displayed. This caused odd behavior in the load dialog in T7G. There
the list contains 10 entries. In case the last one was loaded via the dialog,
the next time it was brought up again it showed the 9th entry at the top
of the view and effectively hiding all the others. It furthermore did not
show the scroll bar because all entries would have fit onto one page.
To prevent this odd behavior, a boundary check has been added to all places
where the scroll position is set. This has been taken from "scrollToCurrent"
which already tried to prevent this.
This fixes the second issue described in bug #3610960
"T7G - savegame glitches".
This is consistent with the notification when the widget changes by
clicking. As far as I can tell, that notification was added shortly
before mouse wheel handling was added. It missing from the mouse
wheel handler was presumably just an oversight.
Otherwise, it will look like the value hasn't changed until the
widget is redrawn for other reasons, e.g. by mouse-over.
Incidentally, does anyone know why handleMouseDown() calls
sendCommand() when the selection changes, while handleMouseWheel()
does not?
This should give a better user experience, since the user will not have to
scroll back to where he was when he used the dialog last.
Thanks to wjp for suggesting this.
This adapts the related graphics code, which is the generic Font API and the
TTF font implementation.
It furthermore adapts the GUI to properly take care of kerning in text input
widgets.