57 Commits

Author SHA1 Message Date
Le Philousophe 7203d1078f GUI: Let drawDialog not reset the clipping rectangle
This will allow for optimized redrawing of select parts of the dialog.
2026-04-26 21:06:07 +10:00
Michael 4d8b7b109d JANITORIAL: GUI: add extra cast to resolve signed/unsigned conflict 2026-03-15 21:20:50 +02:00
tunnelsociety 2460f39cb3 GUI: Refactor PopUpDialog::findItem
Simplify the code (the formula is identical), but also return -1 instead
of 0 when the list is empty.
2026-03-12 02:22:11 +01:00
Le Philousophe 110a7773bf GUI: Handle safe area in popup dialogs 2025-07-13 17:26:37 +02:00
Le Philousophe bbf0d1f9da GUI: Remove RTL hack
The hack was here because the RTL aware code was incomplete.
Fix everything and remove useless code.
2025-06-03 12:55:47 +02:00
sluicebox 4f1ae736e5 GUI: Fix clicking on PopUpDialog separator
Clicking on a separator caused an empty selection.

Introduced in: 41f2ef9745
2024-09-23 23:00:22 +03:00
Cameron Cawley 9728584687 GUI: Automatically extend the width of single column pop-up dialogs 2022-12-25 16:26:26 +01:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Eugene Sandulenko 109beb4f86 GUI: Explicitely use Common:: namespace 2021-11-12 14:46:34 +01:00
Martin Gerhardy 9d82fa51df COMMON: removed USE_TTS check from engines
OSystem now just returns a nullptr if there is no text to speech manager instance
(because none is compiled into the binary, or the system doesn't provide support
for it). This removed the need for the engine authors to add scummvm osystem compile
time options checks into their engine code
2021-05-03 14:13:41 +03:00
Cameron Cawley a82b200ae7 GUI: Allow specifying a command for PopUp widgets 2021-01-10 09:53:43 +02:00
Vladimir Serbinenko 29cfa7bb0f COMMON: Merge code for str.cpp and ustr.cpp
Most of the code in str.cpp and ustr.cpp is actually the same. Do some
template magic to merge them.
2020-10-31 14:05:30 +01:00
aryanrawlani28 4b6976c558 GUI: U32: Reduce number of files changed and fixes
Up until last commit, everything was working fine but the amount of files changed was too large. This commit tries to reduce the changes.

- Add a fake constructor to Keymap, text-to-speech, setDescription (save-state)
- Redirecting functions for PopUpWidget::appendEntry, ButtonWidget::setLabel, GUIErrorMessage
- Use the above functions and constructors to reduce changes in Engines
- Fix warnings being in unicode. Only output english text in - Warnings, Errors, etc.
- Mark some strings as "translation" strings. (Not yet added to POTFILES)
- Remove some CP related things from po/modules.mk
- Previously used some Common::convertToU32 where it was not necessary, replace this with u32constructor
2020-08-30 14:43:41 +02:00
aryanrawlani28 d3e64b2df4 GUI: U32: Use const-references for tooltips 2020-08-30 14:43:41 +02:00
aryanrawlani28 ef7ec444d3 GUI: U32: Enable u32 for tts (Windows)
They always take in U32 strings now.

- Revert tts descriptions to string, they don't use translations, so better to keep it as strings.
- Make read() take in const U32 references.
2020-08-30 14:43:41 +02:00
aryanrawlani28 d4d5b8906e GUI: U32: Begin making TTS take in U32Strings for saying
Only for strings without an explicit action. The first level takes in a u32 string, encodes it, and passes it along further with the default action

- For gui widgets, the strings are passed in as native u32 strings.
- For everything else, they are being converted to u32 by Common::convertToU32... and then being passed along
2020-08-30 14:43:41 +02:00
aryanrawlani28 160a1320cc GUI: U32: Rename more temp code and fix issues
- Remove convertFromU32.. where necessary
- Replace convertFromU32 to .encode() for better readability
- Fix spacing issues in tabs
- Fix spacing issues in popups
- Fix weird font rendering in certain menus.
- Fix dialog changing sizes by huge amount when changing languages
- Some minor changes from String::format to U32String::Format
2020-08-30 14:43:41 +02:00
aryanrawlani28 f800ca4ada GUI: U32: Convert majority of code to use U32
This commit also includes some additional major changes.

- Return U32String from TransMan getTranslation()
- Change tooltips to be U32Strings
- Remove temporary code of convertToU32String
- U32 Support various dialogs (Browser, FileBrowser, Messages, Chooser, etc)
- U32 for music plugins
- U32 for OSD messages
- Add some helper functions to ustr.cpp
- Change default tooltips from nullptr & 0 -> ""
- Some runtime exceptions may occur when changing languages due to incorrect String::Format
2020-08-30 14:43:41 +02:00
aryanrawlani28 aafade4507 GUI: U32: Shift most widgets to draw with u32
- ButtonWidgets (Button, Radio, Checkbox, dropdown)
- StaticTextWidgets
- PopUpWidgets
- Tabs
- Add a temporary overloaded drawDDText function to make other widgets draw normally
2020-08-30 14:43:41 +02:00
aryanrawlani28 e3db189f0b GUI: RTL: Fix small issues
- Remove unused variable in tab.cpp
- Remove wrong check for alignment in popups. For rtl, set align to right.
2020-06-22 00:03:02 +02:00
aryanrawlani28 5a093e4e95 GUI: RTL: Improve right align text drawing
- Fix last chars being eaten
- Add support for input in right-align mode editables
- Fix issue with dirtyness of editables after clicking
- Improve spacing for lists and popup
- Make numbers reversed in lists
2020-06-22 00:03:02 +02:00
aryanrawlani28 17193319b9 GUI: RTL: Fix alignment for DropDownButtonWidget 2020-06-22 00:03:02 +02:00
aryanrawlani28 5d040e804f GUI: RTL: Correctly draw popups with text and fix mouse events 2020-06-22 00:03:02 +02:00
aryanrawlani28 50aa421bf3 GUI: RTL: Fix display issues with some widgets
- Fix missing DD for disabled dropdownbutton
- Fix scrollbar drawing issue
- Fix eating last chars in popup
- Fix tooltip alignment
2020-06-22 00:03:02 +02:00
aryanrawlani28 7e27af8148 GUI: Code cleanup 2020-06-22 00:03:02 +02:00
aryanrawlani28 f3e4e3e009 GUI: Code & comment cleanup, fix review issues 2020-06-22 00:03:02 +02:00
aryanrawlani28 f55654f1bc GUI: RTL: Popup RTL Layout and Correctly draw them
GUI: RTL: Correctly draw popups
2020-06-22 00:03:02 +02:00
aryanrawlani28 f09d15d610 GUI: RTL: Perfect drawing of popups and right align text 2020-06-22 00:03:02 +02:00
aryanrawlani28 28c70dd196 GUI: RTL: Correctly draw for stacked dialogs 2020-06-22 00:03:02 +02:00
aryanrawlani28 e4352391c2 GUI: RTL: Fix popup open location 2020-06-22 00:03:02 +02:00
Cameron Cawley cc5abf5ebb TTS: Fix crash when TextToSpeechManager is unavailable, clean up formatting 2020-05-27 12:43:49 +02: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 41f2ef9745 GUI: Use the item at the click position in PopUpDialog
Fixes the having the drag in the dialog to change the selection on
platforms with a touch screen.
2019-11-24 14:06: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
Jaromir Wysoglad c2c4458253 JANITORIAL: Remove some trailing whitespaces 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad 33f8aadfeb TTS: Add age to TTSVoice 2019-09-01 22:47:55 +03: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 b5cebcbeae TTS: Add text to speech to the GUI. 2019-09-01 22:47:55 +03:00
Bastien Bouclet 4d29ce21d0 GUI: Unify clip and non-clip draw calls 2018-04-19 19:18:39 +02:00
Eugene Sandulenko b0affe5bf2 GUI: Added override specifiers 2018-03-28 12:47:23 +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 0496ede62f GUI: Implement dirty-checking for widget redraws 2018-01-27 18:12:34 +01:00
Bastien Bouclet f5b335af10 GUI: Mark some fall-through cases as intentional
Comments explain how the num lock handling works before the
fall-through cases.
2017-08-06 17:55:33 +02:00
Eugene Sandulenko 499e5ab3ea GUI: Fix regression in multicolumn PopUp widget 2016-07-22 14:36:00 +03:00
Alexander Tkachev dc9b32e620 GUI: Fix PopUpDialog 2016-07-03 12:24:28 +02:00
Alexander Tkachev fca0f0ed34 GUI: Make PopUpWidget clip 2016-07-03 12:16:43 +02:00
Eugene Sandulenko b590cc2d8f GUI: Cleanup class initialization 2016-06-01 13:16:12 +02:00
Eugene Sandulenko bf06b3bc18 GUI: Initialize widget padding 2016-05-02 15:19:07 +02:00
Eugene Sandulenko 35a44edca1 GUI: Implement immediate coordinate mode for PopUp widget 2016-03-30 19:02:02 +02:00
Johannes Schickel f5dfe6725a GUI: Make GPL headers consistent in themselves. 2014-02-18 02:39:35 +01:00