4838 Commits

Author SHA1 Message Date
antoniou79
fa004835b3 GUI: Improve time difference checks in gui manager
Basically using unsigned integer difference to address potential errors around the overflow point of getMillis()
2023-08-09 18:51:42 +02:00
Eugene Sandulenko
97a172f22a
GUI: Remove unused variable 2023-08-07 10:49:54 +02:00
elasota
eea428cbc3 GUI: Update theme binaries 2023-08-07 10:22:09 +02:00
elasota
7bacf7b430 GUI: Add image album dialog for viewing images exported by an engine, mainly for supporting printing features 2023-08-07 10:22:09 +02:00
elasota
3777a3bf9a GUI: Force Unix newlines on Windows for default.inc 2023-08-07 10:22:09 +02:00
Thierry Crozat
d10e4d682a GUI: Notify the backend when starting or finishing an icons or shaders pack download 2023-08-06 23:07:35 +02:00
Eugene Sandulenko
3ff0d353be
GUI: FIx dialog dumping to PNG 2023-07-30 21:34:30 +02:00
Torbjörn Andersson
1b0e110df3 GUI: Eliminate "WideSlider"
We currently have two widget types for sliders: "Slider" and
"WideSlider". This eliminates the latter, making all sliders use the
available space. This arguably makes them look better, and should make
them easier to manipulate on touch devices like phones.

Did I say "all"? Not quite. In the high resolution layout, the volume
sliders share space with the "Mute all" checkbox. The layout engine does
not cope well with two side-by-side layouts of indeterminate width,
apparently, so there we set a width, cross our fingers and hope that the
checkbox will still have enough space in all translations.
2023-07-29 08:10:13 +02:00
Le Philousophe
5d0c894636 CLOUD: Add a load button to fetch JSON from a file
This can be used on handhelds where there is no browser.

The user does the login process on its desktop, saves the JSON in a file
and uploads it to its handheld through an unspecified mean and loads it
on ScummVM using this new button.
2023-07-27 09:12:59 +02:00
Cameron Cawley
238670f3cd GUI: Fix indentation in GroupedListWidget with monospaced fonts 2023-07-22 12:50:31 +02:00
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