Commit graph

184 commits

Author SHA1 Message Date
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
Eugene Sandulenko
eda31b9498
GUI: Initialized more variables 2021-05-01 01:49:47 +02:00
SupSuper
b3fd7c524d GUI: Recalculate tab variables consistently 2021-04-24 21:10:00 +01:00
Thierry Crozat
97f8a4e42e GUI: Fix getEditRect and implify rect handling in EditTextWidget
The same rect was hardcoded in three different places. Now it is
only in getEditRect and the other places use getEditRect.

There were actually differences between the rect width, but I put
that down to a bug in getEditRect. I see no reason to define the
right position of the rect as w - 2 - right_padding - left_padding.
Substracting the left padding would make sense if we were
specifying the rect width, but the Common:Rect constructor takes
the rect right location and not the width. There might have been
a confusion on that point by the developer who wrote that code
years ago. Also has the bottom right point is excluded, we should
only remove 1 and not 2.

This width that was smaller than it should be might have been the
reason why 6 additional pixels were arbitrarily added to the rect
passed to setTextDrawableArea later on.

There were actually
2021-04-22 01:40:12 +01:00
Thierry Crozat
ba0dabd5ca GUI: Fix position of character after caret
There was a discrepency in the vertical position of the text in
the drawText call on one hand, and in the getEditRect() and rect
passed to setTextDrawableArea() on the other. This discrepency
was introduced in commit c47b204ac. Since getEditRect() is used
in EditableWidget::drawCaret() to draw the character after the
caret (when erasing the caret) this caused this vertical shift.

This fixes bug #12336.
2021-04-22 01:40:12 +01:00
Eugene Sandulenko
9113f24120
GUI: Fix tab dimensions on resize 2021-04-13 02:13:20 +02:00
Eugene Sandulenko
5d6941f8b2 GUI: Move hardcoded tab title spacing to themes
This fixes HiDPI tabs rendering.
2021-04-11 21:21:44 +02:00
Eugene Sandulenko
493a343e6a GUI: Avoid double scaling for scrollbar and tab navbuttons 2021-04-11 21:21:44 +02:00
Cameron Cawley
a82b200ae7 GUI: Allow specifying a command for PopUp widgets 2021-01-10 09:53:43 +02:00
Torbjörn Andersson
20e09e6d56 GUI: Fix crash in setSelected() when the list index is empty
If the list is filtered, but _listIndex is empty, setSelected() would
trigger trigger an assertion because it tried to use the index value
from the unfiltered list. This would happen in the ScummVM launcher if
you filtered the list and then edited the game titles until nothing
matched your search condition any more.

Instead of checking if there is a filtered list, check if there is a
filter or not. That should hold true whether or not the filter actually
matched anything.
2020-12-29 23:31:07 +00:00
Cameron Cawley
c877097b49 ALL: Remove use of "" in Common::U32String constructors 2020-11-16 16:56:58 +00: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
Thierry Crozat
982ecb4f93 GUI: Fix use of uninitialized variable in ListWidget constructor
The _scrollBarWidth variable was used (to create the ScrollBarWidget)
before it was initialized.
2020-09-10 00:34:45 +01:00
aryanrawlani28
2ca907b4a2 GUI: U32: Use game-list filters with u32
- Add a contains utility function to ustr
- setFilter uses U32String and U32Tokenizers
- Make consequent changes in launcher to allow sending u32strings
2020-08-30 14:43:41 +02:00
aryanrawlani28
68d01321d6 GUI: U32: Downscale changes of U32, fix review issues
This commit addresses a range of changes, within scummvm subproject.

- Audio files, like mididrv, remove U32String based name and identifier, because ASCII only.
- mididrv.cpp had some wrong format for warning messages, fix those
- Message dialogs were modified to use default arguments more often, but reverting back to the orignal to minimize changes.
- SetTooltip has a fake constructor that takes in a string, and use it.
- U32Format had some break statements missing, add those.
- RemapWidget: Use fake constructor for setLabel and setTooltip, to make minimal changes
- SDL: setting text in clipboard no longer uses SDL_iconv_string
- TTS: Override base class "say" with strings, so tts->say can be used with normal strings too.
- About dialog: fix incorrect code for u32string variables
- Fix some extra brackets
- Some buttons were incorrectly removed from using translated labels, revert those
- Message Dialog: Pass default and alt buttons as const references
- Saveload Dialog: Use translations in missing places, use const-references. Also, use translations in a correct manner.
- Use const references for tooltip in GraphicsWidget, EditTextWidget, error.cpp
- DomainEditTextWidget: Use U32String for text
2020-08-30 14:43:41 +02: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
4506bcd9f3 GUI: U32: Fix compilation errors
After rebasing to get even with master, some compilation errors occured. This commit fixes that.
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
49c36c2b45 GUI: U32: Begin converting texts in clipboards to u32strings
With this commit the base class variables and the parts where getClipboard and setClipboard are used is changed accordingly.
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
96912f4adb GUI: U32: Rename some references of strings to use U32() & not helper method 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
5f2af6b93e GUI: U32: Add u32 support to Editables and Dialogs
- Editable widgets
- Lists
- SaveLoad Dialogs
- Browser Dialogs
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
2a239efa80 GUI: Always mark editable as dirty when press home or end
- Before, the implementation used to fetch this value based on setCaretPos.
- That would return true only if string needed scrolling.
- Thus, the small issue arised that 2 chars would be wobbled together. This commit fixes that.
2020-07-25 00:32:34 +02:00
D G Turner
fe30434a2e GUI: Fix Signed vs. Unsigned Compiler Warning in Tab Widget 2020-06-23 21:41:54 +01: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
1ae2de366b GUI: RTL: Improve tab drawing for rtl 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
9cd2ef1271 GUI: RTL: Cleanup tab drawing to make it simpler 2020-06-22 00:03:02 +02:00
aryanrawlani28
12a4af77bd GUI: Code cleanup 2020-06-22 00:03:02 +02:00
aryanrawlani28
6211747fd3 GUI: RTL: Fix missing backgrounds for tabs in hebrew when navbars present 2020-06-22 00:03:02 +02:00
aryanrawlani28
19aa7baba7 GUI: RTL: Wrapping a variable used for rtl 2020-06-22 00:03:02 +02:00
aryanrawlani28
48eb0d095c GUI: RTL: Remove hardcoded padding for RTL tabs layout 2020-06-22 00:03:02 +02:00
aryanrawlani28
6ecc90edf6 GUI: RTL: Implement RTL for lists and numbers 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
c2708e350f GUI: RTL: Change alignment of editable to right in RTL 2020-06-22 00:03:02 +02:00
aryanrawlani28
5c334d56ad GUI: RTL: Fix tabs for smallres and when removed 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
b8a9331138 GUI: RTL: Shift to a better way of positioning when dialogs are stacked 2020-06-22 00:03:02 +02:00
aryanrawlani28
312862b541 GUI: RTL: Correctly draw backgrounds of Tabs 2020-06-22 00:03:02 +02:00
aryanrawlani28
c83e57fc69 GUI: JANITORIAL: Code cleanup, add comments 2020-06-22 00:03:02 +02:00
aryanrawlani28
aa802df7aa GUI: RTL: Fix lists being overdrawn when tooltip focused 2020-06-22 00:03:02 +02:00
aryanrawlani28
cef4f20eec GUI: RTL: Support navigating in options dialog
GUI: RTL: Perfect drawing of tabs
2020-06-22 00:03:02 +02:00
aryanrawlani28
58704be218 GUI: RTL: Correctly draw tabs, consistent among screen sizes and different themes
GUI: RTL: Correctly draw theme-browser
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