268 Commits

Author SHA1 Message Date
Eugene Sandulenko
a0d4162a2b GUI: Compute base scale factor and set it for ThemeParser 2021-04-11 21:21:44 +02:00
Le Philousophe
577322f3fe GUI: Don't leak theme and TextDrawData when loading fails 2021-02-17 12:57:23 +00:00
Zvika Haramaty
606eeae46f COMMON: move convertBiDiString out of TranslationManager 2020-11-04 22:27:24 +00:00
athrxx
e7476495ab GUI: prevent unloading of extra font on refresh
When hitting pause in a CJK SCUMM game and then switching to fullscreen the call to ThemeEngine::refresh() would kill the required extra font.
2020-10-31 20:47:02 +01:00
Thierry Crozat
49a36e6828 GUI: Fix compilation with some compilers 2020-10-30 23:04:40 +00:00
Thierry Crozat
7a1b3983a2 GUI: Remove unused functions in ThemeEngine
They were leftovers from the transition to U32String.
2020-10-30 22:54:09 +00:00
athrxx
5b6ffeaa3d GUI: allow ingame CJK dialogs regardless of the launcher language
This allows a text widget to be expressly marked as Japanese, Korean or Chinese, so that the theme engine may use an appropriate font.
2020-10-30 21:36:23 +01:00
Eugene Sandulenko
76ec66bfa6 Revert "GUI: Properly load fonts when translations are disabled"
This reverts commit 62c4d6cc0a7c004565d0cc093b81e4813588ad60.

This broke non-Latin fonts loading.
2020-10-01 02:08:39 +02:00
Cameron Cawley
81f989be63 GUI: Use RGB cursors on supported platforms 2020-09-17 22:21:23 +02:00
Eugene Sandulenko
62c4d6cc0a GUI: Properly load fonts when translations are disabled 2020-09-17 16:14:01 +02:00
Eugene Sandulenko
65e38680dd GUI: Added XML theme setting for overriding the fonts depending on the selected language.
- Added Japanese, Korean and Traditional Chinese fonts to fonts.dat
- Bumped fonts.dat file version to 1.4
- Bumped theme version to 0.8.39
- Regenerated built-in theme
2020-09-17 02:00:33 +02:00
aryanrawlani28
d12c6c4338 GUI: U32: Code cleanup
- Remove extra parantheses leftover from temp code
- SaveLoadDialog - do not encode when setting labels
- Remove mapping variable from ThemeEngine::loadScalableFont (and use default 0)
- Remove incorrect u32 constructor wrapper from confman.set in eventrecorder.cpp
2020-08-30 14:43:41 +02:00
aryanrawlani28
3d97be2559 GUI: U32: Remove redundant code
Because po files now (should) use UTF-8, a bunch of code in ScummVM is redundant. This commit addresses that.

- Remove charsetMapping and related variables.
- Remove the code that used these functions.
- Remove cp_parser.cpp. This is removed because the use of codepages is no longer needed.
- Remove iso-8859-x codepages (see above message)
- Always set mapping as 0 in ThemeEngine::loadScalableFont
- Check if ascii or not by getting charset in about dialog.
2020-08-30 14:43:41 +02:00
aryanrawlani28
a1a4e0c2d7 GUI: U32: Overload getStringWidth to accept U32 strings as params 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
51d95f8978 GRAPHICS: move start + end to Graphics::TextAlign 2020-06-22 00:03:02 +02:00
BLooperZ
e6e32aeb75 GUI: use start + end for horizontal align 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
12a4af77bd GUI: Code cleanup 2020-06-22 00:03:02 +02:00
aryanrawlani28
e50463f11f GUI: JANITORIAL: Improve readability - remove nested ternary op 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
4699880c99 GUI: RTL: Support internal flipping of Sliders 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
f55654f1bc GUI: RTL: Popup RTL Layout and Correctly draw them
GUI: RTL: Correctly draw popups
2020-06-22 00:03:02 +02:00
aryanrawlani28
143b9fb13c GUI: RTL: Radiobuttons and Checkboxes RTL layout 2020-06-22 00:03:02 +02:00
aryanrawlani28
a587624cb3 GUI: RTL: Internal flipping for DropDownButton 2020-06-22 00:03:02 +02:00
aryanrawlani28
d6a340d3b4 GUI: Cleanup hacky function for internal flip and fix review issues 2020-06-22 00:03:02 +02:00
aryanrawlani28
b8f51ce33a GUI: RTL: Base support for radiobuttons and checkboxes 2020-06-22 00:03:02 +02:00
Zvika Haramaty
1b8f471c69 GUI: Added (partial) BiDI support
Added GNU FriBidi, thus allowing Hebrew (or other future RTL languages)
to be displayed correctly.
It's been implemented for all ScummVM GUI (as far as I have noticed),
and can be further used by the engines as needed.

This work is only partial, because for complete BiDI support we'll need
to mirror the widgets, and support input text areas (which currently
don't even support Hebrew text input at all).

Some changes are required in order to use this:
- Visual Studio:
  -- add FriBidi lib from https://github.com/ShiftMediaProject/fribidi
     (and place the files in the other libs location)
  -- add fribidi.dll to the current directory
  -- add fribidi.lib to VS library list
     (in GUI it's: Project -> scummvm Properties -> Linker ->
                   input -> Additional Dependencies)
  -- Add USE_FRIBIDI define
     either to:
         dists/msvc/ScummVM_Global.props   <PreprocessorDefinitions>
     or in GUI:
         Project -> scummvm Properties ->
         C/C++ -> Preprocessor -> Preprocessor Definitions
- GCC:
  -- install FriBidi
     e.g.,
        Ubuntu: `apt-get install libfribidi-dev`
        CentOS: `yum install fribidi-devel`
  -- rerun `configure`
2020-04-30 10:32:18 +02:00
lolbot-iichan
73f1da2773 GUI: View checked inactive checkbox as grey, not invisible 2020-04-29 10:31:36 +02:00
Eugene Sandulenko
47a0ab346a GRAPHICS: Fix potential sign extension 2020-04-27 14:54:44 +02:00
Eugene Sandulenko
20334118b9 GUI: Added sanity check to ThemeEngine 2020-04-27 14:51:53 +02:00
Bastien Bouclet
aaa71d53b2 GUI: Don't try drawing widgets with an empty bounding rectangle
Fixes the dropdown buttons being incorrectly drawn in the keymaps
dialog with the classic theme when scrolled down.
2020-02-22 13:14:04 +02:00
Bastien Bouclet
6e1abf064a GUI: Use nullptr instead of 0 or NULL where appropriate 2020-01-19 15:08:37 +01:00
Bastien Bouclet
f7770f821d GUI: Don't draw the checkbox widget text when there is not enough room
Fixes a crash in the edit game dialog volume tab with the Greek
translation.
2020-01-12 12:29: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
ce64528129 TTS: Make sure that TTS lang matches transMan lang 2019-09-01 22:47:55 +03:00
Alexander Tkachev
c91bcbfb94 GUI: Fix scrollbars
- removed +1px in ListWidget, added in lordhoto's 2007 commit 68eb28a
(aka r29971 in svn) `Fix for bug #1670082 "GUI: Modern theme gfx glitch
in launcher".`, because it made clip this last line of scrollbar in all
themes, which doesn't look good. In 2007 theme was written in .ini,
which is not the case now. I don't see any glitches after removing this
"fix";

- fixed how scrollbar top and bottom scroll buttons are drawn in
ThemeEngine::drawScrollbar: there were these weird magic numbers, but in
reality extra space that buttons should occupy is hardcoded in
scrollbar.cpp (ScrollBarWidget) and is just +1px.
2019-08-03 04:35:48 -04:00
Alexander Tkachev
99c2418d1a GUI: Rewrite Cloud tab
- StorageWizardDialog is removed, along with bmps it was using;
- EditTextWidget now accepts custom font in constructor;
- ScrollContainer scrollbar now jumps to top when content height changes
so it's "overscrolled";
- IndexPageHandler now does not awaits for `code` GET-parameter, as
local webserver is no longer used to connect Storages;
- CloudManager and all corresponding Storages are updated to support
disconnecting and to notify about successful connection.
2019-07-30 14:51:41 -04:00
Matan Bareket
69cecebdbc BUILD: Update default theme to use remastered 2019-04-02 10:55:57 -04:00
Thanasis Antoniou
672d216d11 GUI: Fix loading new (not already cached) localized fonts 2019-03-12 00:42:58 +02:00
Bastien Bouclet
c59dd85ebc GUI: Don't try loading TTF fonts for themes that don't request one 2019-01-22 13:07:15 +01:00
Cameron Cawley
364f78e99f GUI: Attempt to load fonts from fonts.dat if they aren't present in the theme archive 2018-12-25 12:47:42 +01:00
Thierry Crozat
7b0402fbb0 GUI: Fix scrollbar bottom arrow being displayed as up arrow after mouse up 2018-07-24 00:27:11 +01:00
Thierry Crozat
0b6ef93b85 GUI: Use consistent capitalization for options
As discussed on the mailing list we should use title capitalization
only for push buttons and tabs and use sentence capitalization for
everything else.
2018-07-22 21:28:12 +01:00
Bastien Bouclet
4d29ce21d0 GUI: Unify clip and non-clip draw calls 2018-04-19 19:18:39 +02:00