Commit Graph

183 Commits

Author SHA1 Message Date
Hubert Maier
2b102beb6c JANITORIAL: Fix choosen typo in dialog.cpp 2024-05-18 13:52:31 +02:00
Kurian Jojo
595a3d7724 GUI: Use Keymapper for EditableWidget 2023-10-24 19:01:12 +02: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
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
Thierry Crozat
b1fcd15cad GUI: Allow scaling dialog and widget sizes in constructors
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.
2023-03-25 11:27:02 +01:00
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Eugene Sandulenko
ae7254da5d
GUI: Fix GUI layout debugging 2021-11-21 20:00:08 +01:00
Orgad Shaneh
18fb0498b5 GUI: Support keypad Enter key in dialogs 2021-08-18 00:39:42 +03:00
antoniou79
da461da6f6 GUI: Fix tooltip behavior to be less interruptive
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.
2021-06-19 14:39:34 +02:00
sluicebox
93eeffc84d JANITORIAL: Update old bug tracker numbers 2021-03-03 02:15:05 +02:00
Bastien Bouclet
bcfb7145fa GUI: Allow engines to define a fully custom tab in the edit game dialog
By implementing MetaEngine::buildEngineOptionsWidget, engines can
instantiate a container widget that will be shown in the Engine tab of
the edit game dialog. The default implementation retains the existing
behavior and shows the extra GUI options.
2020-03-28 07:38:39 +01:00
Bastien Bouclet
ada44ca760 GUI: Remove unneeded includes 2020-01-26 19:07:53 +01:00
Bastien Bouclet
7edff01e69 KEYMAPPER: Move the remap event capture logic out of the keymapper 2020-01-26 19:07:53 +01:00
Bastien Bouclet
6e1abf064a GUI: Use nullptr instead of 0 or NULL where appropriate 2020-01-19 15:08:37 +01:00
Bastien Bouclet
c0d8b6d9fc GUI: Introduce dynamic layouts
Prior to this change, a GUI layout was only affected by the screen size.
Now, a layout can additionally be influenced by the GUI dialog and widgets
that uses it. This capability is leveraged to implement the following
features:

* Layout elements that are not bound to a GUI widget do not take space.
   This means that dialogs where the widgets shown depend on for example
   a feature being enabled at configure time no longer have blank spaces.
* Widgets can define a minimal required size for their contents not to be
   cut. For now this is only used for buttons so their width is always
   sufficient for their caption not to be cut. This mechanism could be
   applied to other widget types in the future.
2020-01-04 10:56:25 +01:00
Bastien Bouclet
1d764bd787 GRAPHICS: Vector renderer clipping rect related cleanups
Selecting whether a clipping variant of a draw call needs to be used is
no longer the responsibility to the caller. The clipping rect is now
part of the state of the renderer.

Also fix some of the draw calls to better apply the clipping rect.
2019-10-07 21:47:42 +02:00
D G Turner
30c366ee5d GUI: Add Missing Switch Default Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-10-03 06:03:46 +01:00
Cameron Cawley
d7b2b1b8f9 GUI: Support adding games via Drag and Drop 2019-04-30 22:17:04 +01:00
Bastien Bouclet
4d29ce21d0 GUI: Unify clip and non-clip draw calls 2018-04-19 19:18:39 +02:00
Bastien Bouclet
4d0bb753e4 GUI: Remove the ThemeItem draw queues
Drawing nows happens directly when the Dialog or Widget draw methods are
called. This makes it easy to debug why a particular low level draw
method was called, by inspecting the call stack.

This replaces the notion of "buffering" by two independant ways to
control what is drawn and where:
- The active layer is used to select whether the foreground or
  background part of the dialogs are rendered by the draw calls.
- The active surface is used to select if the draw calls affect the back
  buffer or the screen.

The foreground layer of the active dialog is drawn directly to the
screen. Its background layer is drawn to the back buffer. This way
widgets can restore the back buffer in order to update without having to
redraw the dialog's background.

Dialogs lower in the dialog stack are drawn entirely to the back buffer.
2018-03-12 11:46:04 +01:00
Bastien Bouclet
5878c618c9 GUI: Remove Dialog::markAsDirty to expose full GUI redraws 2018-01-27 18:12:34 +01:00
Bastien Bouclet
0496ede62f GUI: Implement dirty-checking for widget redraws 2018-01-27 18:12:34 +01:00
Bastien Bouclet
9bb9c0d58e GUI: Focus the first 'focusable' widget when rebuilding dialogs
Fixes Trac#9838.
2017-06-13 07:21:34 +02:00
Thierry Crozat
78561ca94d GUI: Fix access to deleted widget after rebuilding a dialog
The issue was with the focus or mouse widget as it may not be a
direct child of the dialog (it may for example be a child of the tab
widget in the options dialog) and removing a widget was not
resetting the mouse of focus widget if that widget was not a
direct child.
2017-04-06 21:55:28 +01:00
Alexander Tkachev
24963ac97d GUI: Fix Dialog's and TabWidget's reflowLayout() 2016-07-03 12:19:48 +02:00
Eugene Sandulenko
c7ad2155fc GUI: More object initialization cleanup 2016-06-01 13:16:12 +02:00
Ori Avtalion
be1fdf59bb GUI: When dialogs gain focus, inform them of the current mouse position
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.
2016-04-06 17:51:30 +03:00
Torbjörn Andersson
16ba21259b GUI: Adjust x and y to handleMouseWheel() for consistency
This means x and y has the same meaning as in the other handlers,
e.g. handleMouseUp(). Though as far as I can tell, these coordinates
aren't actually used anywhere at the moment.
2015-03-21 17:45:05 +01:00
Zerophase
80d34a8a7c GUI: Add Tab cycling to TabWidget
Tab and Shift-Tab can now cycle between each Tab of the Edit Game menu.
2014-04-01 07:28:48 -05:00
Johannes Schickel
f5dfe6725a GUI: Make GPL headers consistent in themselves. 2014-02-18 02:39:35 +01:00
Oleksiy Kurochko
e6c317a922 GUI: Implemented pressed state for buttons 2012-05-03 19:32:08 +03:00
Tarek Soliman
d12f21b31d KEYMAPPER: Map non-key custom input events
This also makes the keymapper be in charge of keymapping logic
2012-03-02 20:48:50 -06:00
Torbjörn Andersson
6b17507b76 GUI: Fix "clear" buttons after theme switch (bug #3482459)
Because the "clear" buttons are very different between themes (in
the Modern theme they have a graphical symbol, while in the Classic
theme they have a letter), they have to be removed and re-added
when reflowing the layout. This is patterned after how the
LauncherDialog class handles the larger changes in layout.

Removing widgets from a tab turned out to be trickier than I first
thought, so I had to move the removeWidget() method from Dialog to
GuiObject.
2012-02-24 22:20:50 +01:00
Tarek Soliman
6523454db5 KEYMAPPER: Put the gui keymap pushing/popping back in GuiManager::runLoop
This because theoretically the GUI could be run without a dialog.
This also fixes the situations where the GUI keymap gets popped more times than pushed.

Thanks sev
2011-10-31 22:59:55 -05:00
Tarek Soliman
a5082ffa5d KEYMAPPER: Skip GUI keymap when displaying active keymap in keymapper dialog
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
2011-10-27 10:46:22 -05:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion
9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Max Horn
668adaa461 GUI: Rename gui/GuiManager.* to gui/gui-manager.*
svn-id: r54265
2010-11-16 10:19:01 +00:00
Max Horn
427dc1ae93 GUI: Move major widgets to new directory gui/widgets
Also renamed the source/header files, now they are more closely
aligned to how we rename most other source files

svn-id: r54264
2010-11-16 10:11:57 +00:00
Willem Jan Palenstijn
225fd20bee Revert r53747: "GUI: added close() call to Dialog::runModal()"
It broke the launcher after adding new games.

svn-id: r53765
2010-10-24 13:26:58 +00:00
Yotam Barnoy
deb461d200 GUI: added close() call to Dialog::runModal()
This should prevent a small leak in the GuiManager when adding the dialog to the stack. Check for any regressions.

svn-id: r53747
2010-10-23 21:30:39 +00:00
Max Horn
651e2760a3 Fix spelling, cleanup
svn-id: r49843
2010-06-15 12:33:20 +00:00
Max Horn
f906c4e80f GUI: Tweaked the launcher so that TAB switches focus between the list and the quick search field
svn-id: r41311
2009-06-06 23:22:48 +00:00
Eugene Sandulenko
eb92554db9 Fix bug #2791868: "GUI: Glitch when closing menu after hovering on option"
svn-id: r40702
2009-05-18 21:02:52 +00:00
Vicent Marti
108d4cfbd0 Reverted previous commit.
svn-id: r36226
2009-02-06 23:28:08 +00:00
Vicent Marti
30189f09d9 Removed special case when redrawing the dialog stack. Fixes bug #2555710 and several lesser graphical glitches with classic theme.
svn-id: r36225
2009-02-06 22:16:04 +00:00
Eugene Sandulenko
83972e2001 Merge in Virtual Keybpard & KeyMapper branch,
- Merge is perfromed in order to not let rotting the code
- Makefile modifications were avoided

Stuff to resolve:
- Circular dependency of common/vkeybd from graphics/
- Make it compilable (?)
- Add some keyboards
- Decide on the key bindings

svn-id: r35813
2009-01-11 00:20:27 +00:00
Johannes Schickel
95074af35c Fixed crash when returning to launcher from a 640x480 game running with a non 1x scaler.
svn-id: r35686
2009-01-02 22:10:00 +00:00
Johannes Schickel
690b88f982 Renamed gui/newgui.cpp -> gui/GuiManager.cpp and gui/newgui.h -> gui/GuiManager.h
svn-id: r35668
2009-01-02 03:21:40 +00:00
Johannes Schickel
4ec7876972 Reverted the handling of mouse move events, now the slider widget should be highlighted correctly again.
svn-id: r35667
2009-01-02 03:03:06 +00:00