Commit Graph

37 Commits

Author SHA1 Message Date
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
aryanrawlani28
dde4200d35 GUI: RTL: Overload and simplify getWidgetData for getting rtl flag 2020-06-22 00:03:02 +02:00
aryanrawlani28
0f40989633 GUI: Code cleanup, add comments about RTL 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
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
a7fe8ad7d8 GUI: Rename some variable and fix review issues 2020-06-22 00:03:02 +02:00
aryanrawlani28
e5fc39bb98 GUI: RTL: Support stacked dialogs and fix mouse events for them
GUI: RTL: Add helpers for overlay dialogs
2020-06-22 00:03:02 +02:00
aryanrawlani28
5be57e5394 JANITORIAL: Replace my todos with "GUI TODO:" 2020-06-22 00:03:02 +02:00
aryanrawlani28
8966d9dfd9 GUI: RTL: Correctly draw dialogs 2020-06-22 00:03:02 +02:00
Eugene Sandulenko
6aacdb1938 GUI: Normalize width/height parameters
The fact that ThemeLayout had them int, and GuiObject as uint, was
leading to number of unexpected overflows.
2020-05-09 21:59:07 +02: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
f7a934b687 GUI: Use a default size for dialogs when the overlayed dialog has not been sized
Some dialogs overlay the launcher's game list. However, the launcher is
not always shown and as such is not always layed out. Laying out the
dependent dialogs would fail. This problem was indroduced with the
dynamic layout system. Previously the dialogs were layed out eagerly on
theme initialization. Which is no longer possible as dialogs now need to
be initialized to be layed out.
2020-01-30 07:34:27 +01:00
Bastien Bouclet
cf1c092617 GUI: Prevent layouts from giving negative dimensions to widgets
When there is not enough room to layout the widgets, dimensions are now
clipped to zero intead of going negative.
2020-01-12 12:29:37 +01:00
Bastien Bouclet
0aa3d6deb0 GUI: Ignore the padding of imported layouts
Fixes the widgets in the volume tab in the edit game dialog having
inconsistent spacing with the other tabs.
2020-01-12 12:29:37 +01:00
D G Turner
1dc24d06fd GUI: Fix Missing Default Switch Cases in Theme Layout Class 2020-01-08 19:16:21 +00: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
287a4a12e2 GUI: Fix crash when opening the save name dialog
The changes in 1dce33dd9f introduced a
case where the width of widgets would not be set. This commit reverts
the offending changes and introduces a different fix for the original
issue.

Only recompute the width/height of a stack if it is not explicitly set.

Fixes #11214.
2019-10-19 10:50:56 +02:00
Bastien Bouclet
1dce33dd9f GUI: Fix launcher layout for small widths
* Testing if a widget can be centered was ignoring the padding.
* Only resize a layout based on its content if it was not explicitely
   sized by its parent. Fixes the logo causing incorrect layout
   computations when the window width is lower than the image width.
2019-10-17 19:33:50 +02:00
Eugene Sandulenko
a612b0a173 GRAPHICS: Restore layout debugging capabilities 2016-06-01 13:16:12 +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
Eugene Sandulenko
b0db1b5ed0 Implement FR#2507667: "GUI: Improve PopupWidget rendering / theme layouting".
- Split out label from PopUp widget
- Aligned every widget on all layouts so GUI becomes to look nice again
- Moved textHAlign to layout properties

svn-id: r41266
2009-06-06 17:52:44 +00:00
Johannes Schickel
b3c6751b9b Strip trailing whitespaces in the whole code base.
svn-id: r40867
2009-05-24 15:17:42 +00:00
Max Horn
7d3c94a9ca Added some comments to ThemeLayoutStacked::reflowLayoutH/V
svn-id: r35868
2009-01-14 21:16:21 +00:00
Max Horn
d34a952e5b Renamed various ThemeLayout methods for clarity; removed unused setSpacing method, and moved _spacing to class ThemeLayoutStacked
svn-id: r35867
2009-01-14 20:58:41 +00:00
Max Horn
69f4b7a383 Got rid of ThemeLayout::getDialogData; added some comments, asserts; moved getParentW & getParentH to class ThemeLayoutStacked
svn-id: r35571
2008-12-27 14:30:30 +00:00
Max Horn
751df013e1 If more than 8 items have to be resized in a stacked theme layout, abort with an error (instead of silently trashing the stack)
svn-id: r35549
2008-12-26 01:13:08 +00:00
Max Horn
131cb5a05a Merged ThemeLayoutHorizontal and ThemeLayoutVertical into a new class ThemeLayoutStacked (suggestions for a better name are welcome); stored padding data in a Common::Rect
svn-id: r35548
2008-12-26 01:08:49 +00:00
Max Horn
c59f5919a2 ThemeLayout::getParentW was calling getHeight instead of getWidth by mistake (though this didn't seem to cause any problems anywhere... ?)
svn-id: r35547
2008-12-26 00:57:30 +00:00
Max Horn
c9105aa58f Fix for bug #2210082: GUI: Crash in GMM when changing scale factor
svn-id: r35546
2008-12-26 00:43:52 +00:00
Max Horn
c3aec16033 Some 'cleanup' of Gui::ThemeLayout
svn-id: r35545
2008-12-26 00:26:34 +00:00
Jordi Vilalta Prat
b1999a2a16 Fixed indentation and removed whitespaces at the end of line
svn-id: r35481
2008-12-22 11:22:15 +00:00
Max Horn
55da1fdd29 Renamed ThemeLayout::buildCopy to buildCopy::makeClone
svn-id: r34881
2008-11-03 16:38:47 +00:00
Max Horn
6893418942 Fixing some compiler warnings
svn-id: r34341
2008-09-05 11:32:23 +00:00
Vicent Marti
dcc72fe29e Massive refactoring/cleanup on the theme engine/parser.
svn-id: r34285
2008-09-02 17:51:08 +00:00