328 Commits

Author SHA1 Message Date
Eugene Sandulenko
bd083c7fa7 GUI: Switch GUI to ManagedSurface 2021-04-11 21:21:44 +02:00
Eugene Sandulenko
3021f34060 GUI: Add support for specified dimensions for bitmaps in theme file
When we are using SVG, there is no reliable way to get the proper
dimensions. The original code was relying on the dimensions of
the BMP file, and then was using those for understanding the
rendering positions e.g. for PicButtons.
2021-04-11 21:21:44 +02:00
Eugene Sandulenko
09f11bd37e GRAPHICS: Fix transparency in ManagedSurface bitmaps 2021-04-11 21:21:44 +02:00
Eugene Sandulenko
7fe0073823 GUI: Render ManagedSurface widget with transparency 2021-04-11 21:21:44 +02:00
Eugene Sandulenko
5f80a79871 GUI: Fix crash when requested 0 x 0 SVG rendering 2021-04-11 21:21:44 +02:00
Eugene Sandulenko
4a58f08a37 GUI: Load SVGs from theme 2021-04-11 21:21:44 +02:00
Eugene Sandulenko
04f040afce GUI: Reload all bitmaps on theme reload
Since now we are scaling them, it is essential to scale the originals,
otherwise we have double scaling
2021-04-11 21:21:44 +02:00
Eugene Sandulenko
9e746e04f2 GUI: Always scale padding 2021-04-11 21:21:44 +02:00
Eugene Sandulenko
fad56e39d1 GUI: Scale theme images 2021-04-11 21:21:44 +02:00
Eugene Sandulenko
b29f457548 GUI: Scale theme on loading 2021-04-11 21:21:44 +02:00
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