222 Commits

Author SHA1 Message Date
Bastien Bouclet
c8f2d8a1d3 GUI: Introduce OptionsContainerWidget, a container for settings widgets
OptionsContainerWidget is a GUI widgets container that is meant to be
used for configuration dialogs tabs. It provides an interface subclasses
can implement for loading and saving settings from a configuration domain.
2020-03-28 07:38:39 +01:00
Bastien Bouclet
8ae288c52f GUI: Allow defining layouts programmatically with a chaining syntax 2020-03-28 07:38:39 +01:00
Bastien Bouclet
9bd6d9ee08 GUI: Do not reflow layout attached widgets in the constructor
The parent widget they are attached to may not have been layed-out at the
moment of their construction.
2020-03-28 07:38:39 +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
eb28c5a092 GUI: Use a dialog theme layout for the unknown game dialog 2020-01-04 10:56:25 +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
2c812a6b7a GUI: Add DropdownButtonWidget and use it in the launcher for mass add
DropdownButtonWidget is a button split in two parts vertically. Clicking
the left part triggers a default action. Clicking the right part shows a
list of other actions the user can choose from.

Using this widget on the launcher lets 'Mass add' be a secondary action
of the 'Add' button, removing the necessity of pressing the shift key to
access the feature.
2019-11-24 14:06: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
Jaromir Wysoglad
8357e8e6bf TTS: Prepare for windows TTS
Add windows configuration in configure
Add basic skeleton to backends
Check if ttsMan is initialized in GUI
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
53e0f21adc TTS: Reformat tts volume setting for GUI 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
5ee30a1b73 TTS: Convert strings to UTF-8
Conversion happens only for languages, that might needed (not
for english)
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
7d72fc0d60 TTS: Restrict TTS on linux to only english
Unfortunatedly the encoding used by ScummVM breaks the
speech-dispatcher, so after trying to say non-ascii character
the connection has to be restarted. So for now I am restricting
the GUI TTS to english only.
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
b5cebcbeae TTS: Add text to speech to the GUI. 2019-09-01 22:47:55 +03:00
Thierry Crozat
f7a4b74130 GUI: Fix container widgets not receiving events 2018-07-24 00:27:11 +01:00
Bastien Bouclet
4d29ce21d0 GUI: Unify clip and non-clip draw calls 2018-04-19 19:18:39 +02:00
Bastien Bouclet
dcfac42bb3 GUI: Remove alpha bitmap support
It was never used since its introduction 4 years ago
It was not updated to work with the clipping rect
2018-04-19 19:13:12 +02: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
Thierry Crozat
91125bcbcd GUI: Add method to know if a widget contains a given widget 2017-04-06 21:55:28 +01:00
Colin Snover
94e2c67418 GUI: Fix crash when slider values are out-of-bounds
Out-of-bounds values are always indicative of a bug somewhere else,
but at least not crashing here allows the user to recover by
interacting with the slider control. The error will still be
obvious because the associated text field will display the
original weird value.
2016-12-01 13:04:55 -06:00
Eugene Sandulenko
58e38be05c GUI: Initialize the PicButtonWidget class properly 2016-09-04 12:41:05 +02:00
Eugene Sandulenko
a686049c46 GUI: Fix widget clipping 2016-08-24 16:07:55 +06:00
Eugene Sandulenko
6524a8d103 GUI: Added transparency to PicWidgets 2016-08-24 16:07:55 +06:00
Eugene Sandulenko
30f7556bee GUI: Added support for alphabitmaps in picbuttons 2016-08-24 16:07:55 +06:00
Eugene Sandulenko
75f9b099dc GUI: Added possibility to specify scale mode for AlphaBitmaps 2016-08-24 16:07:55 +06:00
Eugene Sandulenko
f0c52096f3 GUI: Implemented possibility to use alphabitmaps in GraphicsWidget 2016-08-24 16:07:55 +06:00
Eugene Sandulenko
762671ccd8 GUI: Added possibility to specify several state images for PicButtonWidget 2016-08-24 16:07:55 +06:00
Eugene Sandulenko
2a9cf65eeb GUI: Add mode to skip drawing of button for PicButton 2016-08-24 16:07:55 +06:00
Alexander Tkachev
64a79fd1ab GUI: Fix TabWidget height issues
Changes theme stx files to specify TabWidget's type. That fixes wrong TabWidget height.

Changes TabWidget's getHeight() to return not only "children" height, but also tabs height. That fixes wrong clipping area.

Changes Widget's findWidget to use getHeight(). That fixes bug when widgets in the bottom of TabWidget were not reacting to the mouse events.
2016-07-12 22:37:57 +06:00
Alexander Tkachev
846619fd42 GUI: Add checks in Widget::getBossClipRect()
Prints a warning if clipping area is invalid and fixes it.
2016-07-03 12:24:56 +02:00
Alexander Tkachev
cea58cc61c JANITORIAL: Remove trailing spaces 2016-07-03 12:24:53 +02:00
Alexander Tkachev
3d636617d0 GUI: Use clipping everywhere 2016-07-03 12:24:46 +02:00
Alexander Tkachev
6fd6043391 GUI: Fix blitAlphaBitmapClip() 2016-07-03 12:24:11 +02:00
Alexander Tkachev
fca0f0ed34 GUI: Make PopUpWidget clip 2016-07-03 12:16:43 +02:00
Alexander Tkachev
d7278cc48b GUI: Prepare button to be clipped 2016-07-03 12:14:45 +02:00
Alexander Tkachev
49caaf77a1 GUI: Add ScrollContainer 2016-07-03 12:10:56 +02:00
Alexander Tkachev
08727857bc GUI: Use boss's x/y/w/h instead of clippingArea 2016-07-03 12:10:26 +02:00
Eugene Sandulenko
b590cc2d8f GUI: Cleanup class initialization 2016-06-01 13:16:12 +02:00
Eugene Sandulenko
b46bb55444 Merge pull request #722 from Abde-/master
GUI: Redraw Widget when setAlign() called
2016-05-16 10:09:09 +02:00
Ori Avtalion
e30a94e6ff GUI: Remove 'sticky button' feature
This feature made pressed buttons wait a few moments before returning to
an unpressed state. It was half-implemented, and caused several visual
bugs. Fixes #7083.
2016-04-14 18:37:12 +03:00
Ori Avtalion
92b7a86e1f GUI: Remove highlighting when button widget is pressed
Without this, buttons would stay highlighted after being un-pressed.
Fixes #7094.
2016-04-13 13:21:27 +03:00
Eugene Sandulenko
3c4ccfc52c GUI: Enhanced StaticTextWidget with font style 2016-03-30 11:09:32 +02:00
Ori Avtalion
031e062252 GUI: Improve handling of button presses while moving the cursor
Keep track of where a mouse press started when deciding how mouse-over
and mouse-up should behave.

This handles the following situations:

1) If a mouse press starts outside a button (e.g. the UI background),
mouse-up inside the button has no effect. Previously, it triggered a
button click.
2) If a mouse press starts inside a button, the cursor moves outside of
its region, then back inside, the button will show as pressed.
Previously, it showed as highlighted instead of pressed.
2016-03-27 23:29:37 +03:00
Abdeselam El-Haman
e55ec6c6ca GUI: Widget: redraw when setAlign() called 2016-03-25 02:34:35 +01:00
Johannes Schickel
f5dfe6725a GUI: Make GPL headers consistent in themselves. 2014-02-18 02:39:35 +01:00
Thierry Crozat
f125dce608 GUI: Initialise _hotkey in ButtonWidget constructor
One of the two ButtonWidget constructor did not initialise _hotkey
when given a non-null value. This caused valgrind to report an
access to uninitialised variable in Dialog::handleKeyDown().
2013-08-10 23:26:53 +01:00
Johannes Schickel
b1bd9322a1 GUI: Take advantage of Surface::getPixels. 2013-08-03 04:02:50 +02:00
Johannes Schickel
103e926c07 GUI: Prefer getBasePtr instead of direct Surface::pixels access. 2013-08-03 04:02:48 +02:00
Torbjörn Andersson
85beaf6fed GUI: Change value by one on mouse wheel, not by one pixel
On file-grained sliders, changing the value by one pixel was
unpredictable because it wouldn't change by the same amount every
time. (And of course, some values were not possible to set.)

On course-grained sliders, changing the value by one pixel would
sometimes not change it at all, causing the slider to seem stuck.

Now the slider can be set to any value.
2012-12-27 10:13:48 +01:00