The same condition was scattered around in the code to switch between
normal labels and images and their lowres counterparts. Factorizing
that condition in a function will allow changing it easily.
#4953 optimized redrawing of the top dialog in commit f824f8a. This
however broke console's sliding up as the code in question depended on
the fact that it was internally equivalent to a full redraw.
Unfortunately, it is not that simple. Tooltip may be placed also outside
of the dialog. Current implementation leaves tooltip leftovers over
the dialog below the topmost one, so reverting until I find a correct
way to achieve the goal.
This reverts commit 19b7b2aa20.
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.
The icons download dialog was triggering the grid launcher update after
icons had been downloaded. But that means no update was done if the
dialog had been closed during the download.
Now the GUIManager triggers the update. This fixes the missing update
when hiding the download dialog while downloading an icon set.
GuiManager::initIconsSet is called from a callback of the iconset
download dialog, which runs in a separate thread. That means the
iconset can be accessed from two separate thread (the GUI thread,
and the download thread).
This was not an issue until the previous commit as closing the
download dialog while a download was ongoing would crash ScummVM.
But now that the crash is fixed, a race condition was possible.
The tooltip will show only if mouse cursor was moved but not on a hovered focused editText field
Changes and implications in this commit:
- Fix _lastMousePosition coordinates and time being updated upon giving focus to the tooltip
- Check for mouse cursor movement first in the decision for showing the tooltip, then check if sufficient time for mouse resting position has passed (kTooltipDelay).
- Prevents showing a tooltip for a widget if it is an editable field (editText) and has both mouse hovering above it and the current focus.
This is so that typing text is not interrupted / slowed down by a periodical display of the tooltip, if the mouse is hovering over the same text field that the user is editing.
- If mouse cursor is moved but lands on the same widget as the one that had its tooltip shown last, then show the tooltip but after a different (larger) delay kTooltipSameWidgetDelay.
- Still shows tooltip for other widgets, including editText ones, if the mouse is hovered over them and they are not the current focused editText widget.
The bug was mentioned for the Android port on the forums here:
https://forums.scummvm.org/viewtopic.php?p=95531#p95531
However, it is not Android specific, even though the slowdown is a lot more noticeable on an Android device.
The idea is to allow backends to start a game even after the
LauncherDialog has been created, and for that they need a way
to close the existing GUI dialogs.
* Delete multiple empty rows
* Make getVolume non-virtual and leave just the implementation
in base class
* Resolve warning about signed / unsigned comparison in
gui-manager
* Clear availableVoices when updating voices on linux
* By default set language to transMan language on windows
(if the transMan is available)
* Remove freeVoices method from Windows ttsMan, it isn't needed
anymore
This is achieved by adding a list of GuiObject to delete to GuiManager
and doing the deletion in GuiManager::runLoop.
The main purpose of this is to avoid the deletion of ButtonWidget object
while their ButtonWidget::sendCommand function is being called. For
example the sendCommand of the Apply button of the OptionsDialog
may cause a rebuild (if the GUI language was changed) which tries to
delete the widgets inside the OptionsDialog, including the Apply button.
Previously, they only reacted to the mouse position once it was moved.
This meant that if the cursor was on a button that just gained focus,
it did not highlight.
Fixes#7101.
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.
This fixes a problem where opening the keymapper dialog would cause the current game
keymap to be displayed as the active keymap but then changing the keymap selection
back to it would cause the GUI keymap to be displayed as the active one. The GUI keymap
was indeed at the top of the stack but that's not the desired effect.
Also move the pushing and popping of the keymap to Dialog::Open/Close
Also constantify the GUI keymap name