4828 Commits

Author SHA1 Message Date
Thierry Crozat
530a972d4c GUI: Clear the selection when calling EditableWidget::setEditString
This fixes a crash (assert) due to an invalid selection in the EditableWidget
when typing anything in the widget after setEditString was called while some
text was selected.
Here is one way to get the crash (before this commit):
1. In the launcher search box type some text.
2. Select the text or part of the text.
3. Click the clear button.
4. Type something or use the backspace/delete key.
2023-07-20 00:46:48 +01:00
Eugene Sandulenko
43e0e87cd0
GUI: Regenerate the built-in theme 2023-07-19 21:44:06 +02:00
Eugene Sandulenko
d9dbed2d3c
GUI: Better wording for the fixed size font checkbox tooltip 2023-07-19 21:34:33 +02:00
Eugene Sandulenko
73ea1caedf
GUI: Added checkbox to disable BDF scaling. Bump theme version 2023-07-19 15:30:22 +02:00
Eugene Sandulenko
308e2fd340
GUI: Added possibility to disable BDF font scaling
Specify "gui_disable_fixed_font_scaling". The checkbox in the GUI will follow
2023-07-19 15:17:28 +02:00
Misty De Meo
1100f490ee GUI: FileBrowser: support initial filename
Certain callers may want to specify a default filename for their
savegames. This is used in Director, where the file browser can be
constructed with the filename field prefilled.
2023-07-08 22:14:41 +03:00
Eugene Sandulenko
45eb45686a
GUI: Re-enabled BDF font scaling since now the rendering was fixed by elasota 2023-07-08 21:10:19 +02:00
Thierry Crozat
431e805e72 GUI: Move buttons for the Grid Launcher below the grid area
This is more consistent with the layout of the List Launcher in
portrait mode and with the lowres layout which both have the
buttons at the bottom.
2023-07-08 22:03:09 +03:00
Eugene Sandulenko
0ccbcddb57
GUI: Disable BDF font scaling until it is fixed 2023-07-05 14:00:49 +02:00
Le Philousophe
a9bf813e86 GUI: Make thumbnail smaller than its background
This avoids the thumbnail to be drawn over the rounded borders
2023-07-04 21:23:43 +02:00
Le Philousophe
43bd4edcc1 GUI: Handle screen resize while displaying MessageDialog 2023-07-04 21:09:12 +02:00
Lothar Serra Mari
00ddb2266c
I18N: Update GUI translations datafile 2023-07-01 13:58:38 +02:00
Lothar Serra Mari
d9353c4c94
CREDITS: Update CREDITS 2023-07-01 13:55:59 +02:00
Eugene Sandulenko
254b3022f5
DIRECTOR: Gracefully process incorrect grouped list configuration 2023-06-28 00:05:19 +02:00
Eugene Sandulenko
a18864c646
GUI: Enable scaled BDF fonts 2023-06-26 15:05:51 +02:00
Eugene Sandulenko
96b0274fcc
GUI: Scale fonts for classic theme 2023-06-23 12:08:56 +02:00
Lars Sundström
40c376fd3a GUI: Change ThemeLayout::setPadding input types to int16
The theme layout padding values are parsed and stored as 16 bit
signed integers. However ThemeLayout::setPadding treated the
values as 8 bit signed integeres.

The padding values parsed from the STX file suited for the screen
resolution are multiplied with the device content scale factor.
The scale factor determines how content is mapped from the logical
coordinate space (measured in points) to the device coordinate
space (measured in pixels).

If the scale factor and the padding value results in a value
greater than 255 it will wrap since the 8 bit type can't hold
bigger values than that.

Running the iOS backend in debug configuration on an iPhone 12
mini, having the content scale factor value 3, and drawing the
launcher in vertical mode where the bottom padding value is 92,
the result became 3 * 92 = 276 which would wrap to 20.
That resulted in incorrect layout where the GameList was too
high and the buttons in the bottom would not fit on the screen.

Change the input type to int16 in ThemeLayout::setPadding to
conform with the padding type used everywhere else.
2023-06-23 12:32:51 +03:00
Le Philousophe
bfc87720de GUI: Fix bug #7124
A fake mouse moved event is generated to force a refresh of the current
hovered widget
2023-06-18 20:39:59 +02:00
Le Philousophe
c276e89888 GUI: Don't display tooltips while dragging mouse
Displaying it cancels the dragging.
2023-06-18 20:39:59 +02:00
Le Philousophe
0492a0e222 GUI: Update themes
Latest changes were not applied to zip and include
2023-06-18 16:18:14 +02:00
antoniou79
68c293a004 GUI: Ommit aspect ratio checkbox if this feature is missing
Also fix compilation when building for --disable-aspect (buggy end bracket in backends/graphics/surfacesdl/surfacesdl-graphics.cpp)
2023-06-17 20:21:29 +02:00
Miro Kropacek
e4dcd46b43 GUI: Don't parse all available engines and games on startup
When statically linked, this makes about 8000 variants.

This change takes only engines and games present in a domain into
account. This speeds up loading time on slower backends quite
noticeably.
2023-06-10 23:27:57 +02:00
Miro Kropacek
09a5e47636 GUI: Add debug outputs for easier profiling 2023-06-10 23:27:57 +02:00
Miro Kropacek
650ccb6ded GUI: Don't assume ManagedSurface's pitch
This caused corruption with small scale's cursor (18px) if
ManagedSurface's inner surface used a different pitch than w *
format.bytesPerPixel.
2023-06-10 23:27:57 +02:00
Misty De Meo
f208f8e00b
GUI: remove unused variable 2023-06-01 14:30:50 -07:00
Thierry Crozat
7b9ae88050 UPDATES: Fix saving the updates_check frequency in opt-in wizard
When ScummVM is started, if the updates_check value is not defined
in the config file and ScummVM was compiled with the Updates feature
(on macOS or Windows), an opt-in dialog asks the user if he wants
to check for available updates periodically. This should only be
shown once. However as ConfMan was not flushed to disk, it was
asked again the next time ScummVM is started, and again, until the
user accessed the options to change something else and this was
finally flushed to disk.
2023-05-25 22:26:37 +01:00
Donovan Watteau
51ac525263 GUI: Fix builds without USE_TRANSLATION 2023-05-15 18:06:35 +02:00
Abhinav Chennubhotla
7bbd62e846 GUI: Add message and about dialogs to dumpAllDialogs()
- Add arguement message with default arguement "test"
 - Create separate .png files for all dialogs
2023-05-14 22:47:22 +02:00
Abhinav Chennubhotla
f96eb9a7f1 GUI: Dump .png files of launcher to check UI for various translations
- Each resolution needs to be cycled manually in the code, default is
    800x640.
  - Dumps .png files in a snapshots folder for all languages at a given
    resolution.

TODO:
  - Cycle resolutions automatically through code.
  - Add more dialogs to the dumper.
2023-05-14 22:47:22 +02:00
Cameron Cawley
7ef8da53d7 GUI: Account for the scroll bar size in ScrollContainerWidget objects 2023-05-14 22:43:57 +02:00
elasota
6c8ceeae25 BACKENDS: Refactor some things to make getDoubleClickTime behavior with event recorder simpler. 2023-05-14 22:42:59 +02:00
elasota
74ddbe5eaa BACKENDS: Add double-click time feature to support OS-configurable double-click intervals, implement it for Windows. 2023-05-14 22:42:59 +02:00
Miro Kropacek
b5dc9dd949 GUI: Fix sliding up of the console
#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.
2023-05-11 23:53:17 +02:00
Miro Kropacek
6fff1690a5 GUI: Don't redraw whole dialog in Widget::setEnabled()
Until now, every (even the tiniest) widget's change of the enabled state
resulted in a redraw of a complete *dialog*. Why this was needed and how
it has been fixed requires a bit of explanation.

There are two buffers to render the widgets in: Backbuffer and Screen
(selected by ThemeEngine::drawToBackbuffer() and
ThemeEngine::drawToScreen() respectively, setting
VectorRenderer::_activeSurface). Then there are two layers/flags:
kDrawLayerBackground and kDrawLayerForeground
(selected in Dialog::drawDialog(), setting ThemeEngine::_layerToDraw).

When asked for a complete dialog rebuild in GuiManager::redraw()
(kRedrawCloseDialog, kRedrawFull) the widgets of every dialog,
regardless of their layer, are drawn into Backbuffer and then copied
into Screen.

When asked for a partial dialog rebuild (kRedrawOpenDialog,
kRedrawTopDialog) the widgets of the topmost dialog marked with
kDrawLayerBackground are drawn into Backbuffer, then copied into Screen
and finally the widgets marked with kDrawLayerForeground are drawn into
Screen *only*.

When redraw() is called just within the GuiManager's event loop the
widgets of the topmost dialog are drawn into Screen *only*. And this is
where the layers become important.

When rebuilding the dialog, it doesn't really matter which layer has
been defined for a widget: Backbuffer contains the ones with
kDrawLayerBackground and Screen will supply the rest with
kDrawLayerForeground, if needed. But which layer is taken into account
when calling Dialog::drawWidgets() ?

It is important to realize that the content of Backbuffer is
defined by the widget's initial state (idle or disabled): so Backbuffer
will contain either "idle color" or "disabled color" after dialog's
creation.

ThemeEngine::drawDD() does two checks:

1. if widget has kDrawLayerBackground set *and* _activeSurface is
  Screen, copy the widget from Backbuffer to Screen

2. if widget's layer is the same as _layerToDraw, draw the widget into
  _activeSurface

This is what happens in redraw(kRedrawDisabled) for kDrawLayerBackground
widgets:

- Backbuffer contains an idle/disabled (depending on its initial state)
  rendition of the widget
- widget is copied from Backbuffer to Screen (1st check in drawDD())
- widget is not drawn into Screen as _layerToDraw is
  kDrawLayerForeground (2nd check in drawDD())

Summary: when switching between idle/disabled state, widget's color is
not updated.

This is what happens in redraw(kRedrawDisabled) for kDrawLayerForeground
widgets:

- Backbuffer contains an idle/disabled (depending on its initial state)
  rendition of the widget
- widget is not copied from Backbuffer to Screen as widget has
  kDrawLayerForeground set (1st check in drawDD())
- widget is drawn into Screen as _layerToDraw is still
  kDrawLayerForeground from the last redraw() (2nd check in drawDD())

Summary: when switching between idle/disabled state, widget's color is
correctly updated and not restored from Backbuffer.

Initially, I set up "button idle" to be rendered in the foreground
layer, same as "button disabled". However @lephilousophe suggested a
great improvement: render "button idle" still in the background but make
"button disabled" its child (in the foreground). Worked like a charm as
it just mimics the hovering behaviour.

And this is why hovering doesn't require scheduleTopDialogRedraw():

- Backbuffer contains an idle [kDrawLayerBackground] rendition of the
  widget
- when highlighted [kDrawLayerForeground], widget is not copied from
  Backbuffer to Screen
- widget is drawn into Screen

Unhovering:

- Backbuffer contains an idle [kDrawLayerBackground] rendition of the
  widget
- when idle [kDrawLayerBackground], widget is copied from Backbuffer to
  Screen
- widget is not drawn into Screen
2023-05-10 22:52:48 +02:00
Miro Kropacek
6e4d7798f9 GUI: Remove redundant redraw calls
When calling any of:

- Widget::setEnabled
- EditTextWidget::setEditString
- EditableWidget::setEditString
- StaticTextWidget::setLabel

there is no need to call neither GuiManager::scheduleTopDialogRedraw nor
Widget::markAsDirty afterwards -- they set up the call by themselves.

Also, refactor a couple of code blocks into calling just
GuiManager::redrawFull as it does the same thing.
2023-05-10 22:52:48 +02:00
Le Philousophe
f2166b8e8a GUI: Reorganize GuiManager::redraw() to make it more readable 2023-05-10 22:52:48 +02:00
Miro Kropacek
915dce50ea Revert "GUI: Don't enforce full redraw upon closing tool tip"
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 19b7b2aa20aa31f3c81245d5fc87f47744399c34.
2023-05-01 03:37:26 +02:00
antoniou79
531bffa423 GUI: Fix syntax in a sentence 2023-04-29 22:36:48 +03:00
Miro Kropacek
19b7b2aa20 GUI: Don't enforce full redraw upon closing tool tip 2023-04-29 13:44:40 +02:00
eientei
83fd89d461 GUI: Correct some grammar in the cloud connection wizard 2023-04-29 13:26:54 +02:00
su-xingyu
630fe0e8d0 GUI: Fix inconsistent game title display for list and grid layout 2023-04-29 13:12:06 +02:00
Miro Kropacek
f824f8ad13 GUI: Don't redraw whole dialog stack with kRedrawTopDialog 2023-04-29 12:00:49 +02:00
Eugene Sandulenko
1a5442bb24
GUI: Merge multiline sentences into one string for easier translation 2023-04-23 16:29:49 +02:00
su-xingyu
c577b1d616
GUI: Fix hard shadow under HiDPI rendering (#4908) 2023-04-15 02:04:16 +02:00
hax0kartik
6a4e2b2694 GUI: Disable text selection in list widget 2023-04-14 14:10:20 +02:00
hax0kartik
bf0845a1d6 GUI: Modify inversion only if text selection is not disabled 2023-04-14 14:10:20 +02:00
hax0kartik
4d10720b5e GUI: Do not modify inversion directly in editable widget 2023-04-14 14:10:20 +02:00
hax0kartik
337960dc5f JANITORIAL: Remove trailing whitespaces in editable.cpp 2023-04-14 14:10:20 +02:00
Thierry Crozat
059781c89c GUI: Add guard to prevent recursive call of handleMouseWheel in dialogs
This fixes bug #14404.

The rercusive call was introduced with commit 325260f that changed
the implementation of Widget::handleMouseWheel to call handleMouseWheel
on the widget boss. If the widget boss is a dialog, its implementation
is to call handleMouseWheel on the widget under the cursor. And
we can end up with an infinite loop.

As indicated in bug #13106, which was fixed by commit 325260f, a
similar infinite loop when using the mouse wheel to scroll tabs in
the options dialog was caused by the commit and quickly fixed. But
the fix was only for that particular case. Here the fix should
be more global.
2023-04-12 23:34:10 +01:00
wyatt-radkiewicz
660fcf329d GUI: Collapsed game groups are persisted
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
2023-04-12 16:07:58 +02:00