From a41457e224a1cc5fcde70fa9e75d1c82abd20fc9 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 16 Apr 2013 23:11:37 +0200 Subject: GUI: Always try to show as many entries as possible in ListWidget. 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". --- gui/widgets/list.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gui/widgets/list.h') diff --git a/gui/widgets/list.h b/gui/widgets/list.h index 47613b79f3..d18a82dd3f 100644 --- a/gui/widgets/list.h +++ b/gui/widgets/list.h @@ -145,6 +145,7 @@ protected: void receivedFocusWidget(); void lostFocusWidget(); + void checkBounds(); void scrollToCurrent(); int *_textWidth; -- cgit v1.2.3