GroupedListWidget and GridWidget can save what groups they have
collapsed to the config file and reload them. "launcher.cpp" uses those
functions to persist those collapsed groups through
- changing how the games are grouped by
- going from list to grid mode and vice versa
- quitting scummvm and starting it again
The resize() function has the option to do the scaling, but
adding it to the construtor avoids having to then call resize().
Also this makes more explicit that by default the sizes are not
scaled. The reason for not scaling by default is because values
with get from the ThemeEngine are already scaled.
This code has been written by @sev-
TODOs:
1. Investigate and fix characters jumping/shaking during selection.
2. Make code compatible with RTL languages such as hebrew.
Currently file containing \1 in its name causes erroring out
with "Wrong string format".
Hades Challenge Mac partiton has such files in the root. So if they are
copied then it's impossible to select folder with Hades Challenge. Many tools
skip (as they are hidden) or rename them while saving original name in
AppleDouble or MacBinary. dumper-companion also renames them but scummvm
transparently decodes punycode back.
This avoids the filter text to take the focus.
In Android this prevents the launcher to start with the virtual keyboard
displayed.
In the future, the widget could also take keyboards event into account
like the ListWidget one.
The previous commit was not sufficient as getIconsSet() returns a
reference to the SearchSet and it could then be used after the
mutex had been unlocked and while it was being modified in
initIconsSet() called in another thread.
When using the mouse wheel (scroll up/down) in the Grid view, item tray for a selected game, ScummVM would exit
I didn't notice any side-effects from the fix, but someone more familiar with the code should confirm.
The crash was not systematic but occured in the case where adding
the game did not change the indexes for the first and last visible
items. The issue was that in setEntryList() was called it did not
cleat the _visibleEntryList array that still contained dangling
pointers to the old items in the _dataEntryList. In most cases
the _visibleEntryList would be updated with pointers to the new
items when calcVisibleEntries() was called from reflowLayout(),
before being used in assignEntriesToItems() (also called from
reflowLayout()). But if the indexes of the first and last visible
items did not change, _visibleEntryList was not updated and we
got a crash in assignEntriesToItems() when trying to access freed
memory.
Strip formatting from the list widget string before taking the length of
it to calculate the caret position. This can be seen e.g. in the save
dialog when not using the icon view.