Commit Graph

139 Commits

Author SHA1 Message Date
Eugene Sandulenko
5665790bae
GUI: Avoid double scaling for Dialog insets 2021-04-17 20:09:08 +02:00
Eugene Sandulenko
2839715a45 GUI: Remove TransparentSurface remnants aka alphabitmaps from themes 2021-04-11 21:21:44 +02:00
Eugene Sandulenko
af17cb30f4 GUI: Remove duplicate methods 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
55ae2e4367 GUI: Added SVG support to theme parser 2021-04-11 21:21:44 +02:00
Eugene Sandulenko
a6afdd701a GUI: Fix scaling for clip values in theme
Fixes DropDownButton
2021-04-11 21:21:44 +02:00
Eugene Sandulenko
a5f6866d49 GUI: Scale spacing in themes 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
db88f4db05 GUI: Avoid double scaling of referenced variables 2021-04-11 21:21:44 +02:00
Eugene Sandulenko
982e500660 GUI: Added 'scalable' parameter to theme variables 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
Eugene Sandulenko
ba2013cb46 GUI: Properly parse the 'rtl' key's value in the themes 2021-03-25 23:14:10 +01:00
Eugene Sandulenko
b855b690e5 GUI: Fix memory overrun 2020-11-03 23:47:23 +01: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
fc075e29da GUI: Added sanity check to <font> key parser 2020-09-17 02:30:20 +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
51d95f8978 GRAPHICS: move start + end to Graphics::TextAlign 2020-06-22 00:03:02 +02:00
BLooperZ
4fc9c11bbe GUI: use start + end for static widgets 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
07ab77d065 GUI: RTL: Get internal widget RTL flag from theme 2020-06-22 00:03:02 +02:00
aryanrawlani28
08f5efd23e GUI: RTL: Add rtl flag and helper function to widget 2020-06-22 00:03:02 +02:00
Bastien Bouclet
8ae288c52f GUI: Allow defining layouts programmatically with a chaining syntax 2020-03-28 07:38:39 +01:00
Bastien Bouclet
94344ccf8e GUI: Allow providing an explicit size for screen_center dialogs
Without an explicit size the layout system does not have enough
constraints to produce nice looking dialogs. Up until now the workaround
was to set explicit an size for some of the widget. This worked well
enough except when resizing down the window up until the widget size
constraints could no longer be enforced. At that point, produced layouts
looked too squished.
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
346d53b034 GUI: Add finer control over cross-direction alignment for layout items
Previously it was only possible to specify whether items where aligned
to the start or centered in the cross direction of the layouts. It is
now additionally possible to align the items to the far end of the cross
direction or to resize them to match the size of the layout.

Terminology and behavior are loosely based on CSS's flexbox containers.
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
D G Turner
d78459f8bc GUI: Fix GCC Compiler Warnings in GUI Theme Parser Code
This removes the usage of memset to clear complex structures and replaces
them with constructor methods for the structures which will be executed
when these are instantiated.
2019-08-17 05:03:04 +01:00
Bastien Bouclet
a5d93d933a GUI: Use a truetype font for the debug console 2019-05-05 08:52:12 +02:00
Colin Snover
51329c0dc6 ALL: Fix misuse of comma operator 2017-11-10 09:57:03 -06:00
Eugene Sandulenko
94bc75ae46 GUI: Implemented centering of dialog background 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
38114eb760 GUI: Plug NinePatch bitmaps into parser 2016-08-24 16:07:55 +06:00
Eugene Sandulenko
ec7312ac13 GUI: Implemented more modes to autoscale 2016-08-24 16:07:55 +06:00
Eugene Sandulenko
4474ccf814 GUI: Implemented alphabitmap autoscale 2016-08-24 16:07:55 +06:00
Eugene Sandulenko
53a42ececf GUI: Added new alphabitmap image type 2016-08-24 16:07:55 +06:00
Eugene Sandulenko
c471a4120b GUI: Plug memory leak. CID 1003572 2013-04-24 01:19:03 +03:00
Eugene Sandulenko
d878779453 GUI: Fix previous commit 2013-04-21 16:49:48 +03:00
Eugene Sandulenko
b40430bc4b GUI: Add sanity check to config format. CID 1004153 2013-04-21 14:27:30 +03:00
Johannes Schickel
89abab97e3 JANITORIAL: Remove trailing whitespaces.
Powered by:
git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//'
2012-09-26 04:17:55 +02:00
Johannes Schickel
a401f0a19e ALL: Replace cursorTargetScale in OSystem API with a simple "do not scale" logic.
All uses of the old target scale API actually wanted to disallow scaling of
the mouse cursor. This commit adapts our API to this and thus simplifies
backend implementations.

Some backends, most notable the Wii and Android, did some implementation of
the cursor target scale, which I didn't adapt yet. I added a TODO for the
porters there.
2012-06-03 02:02:57 +02:00
Johannes Schickel
d21ae1aa40 GUI: Add support for loading TTF files with ISO-8859-1 charset. 2012-01-29 16:26:20 +01:00
MaximRussia
ad4471f70c GUI: Improved pop up and scrollbar arrows look
Previous triangle drawing was all wrong, rewrote it from the scratch.
Added padding to drawsteps in stx files
2011-12-07 14:04:10 +00:00
Willem Jan Palenstijn
052177d136 COMMON: Remove some double-underscore defines (reserved) 2011-11-14 14:59:58 +01:00
athrxx
825c889e33 GUI: fix uninitialized var
(caused rendering glitches when compiling with MSVC)
2011-06-17 20:33:40 +02:00
Max Horn
da3fff8ab3 COMMON: Make use of Common::parseBool 2011-06-17 10:38:16 +02:00
Max Horn
a6e5b97e9f COMMON: Remove vfprintf call from XML parser 2011-06-06 11:19:09 +02:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion
9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00