214 Commits

Author SHA1 Message Date
Thierry Crozat
3213c426a5 GUI: Separate bevel and shadow effect when extending widget rect
When widget::draw() is called it asks the ThemeEngine to redraw the background
first and then the widget gets redrawn in drawWidget(). The ThemeEngine uses
an extended rect to restore the background to include bevel and shadow effects.
However if this extended rect overlaps with other widgets, since those other
widgets are not redrawn, a part of those will be missing. See for example
bug #6394: GUI: List View save page drawns over font.

In case we get overlap we might need to change the way widgets are drawn so
that all widgets intersecting the area where the backgroud is restored are
redrawn. This commit simply seperate the bevel and shadow effects, and uses
the shadow offset only to extend the bottom and right sides of the rectangle
(while the bevel offset is still used to extend all four sides). This
results in a smaller extended rectangle (if the shadow offset is bigger than
the bevel offset, which is the case of the list view) and thus decrease the
risk of the issue happening. The particular cases described in bug #6394
are all fixed with this change.
2017-06-20 19:36:56 +01:00
Joseph-Eugene Winzer
7ff4641d5d GUI: Restore settings if GUI cannot be rendered
PR#921 changes the behavior of the client that if the GUI fails to be
rendered the previously applied settings in the misc category are
restored. Error messages were altered according to the changes.

Bug: #9717 GUI: Indirectly changing 'GUI Language' can produce
                inconsistent behaviour when changing some options.
2017-04-06 23:08:28 +02:00
Joseph-Eugene Winzer
66c2ae244f GUI: Fix resolution of theme filename to id
getThemeId() returned "builtin" for valid filenames because FSNode only
searches for the theme filename, like "scummmodern.zip" in the current
directory. listUsableThemes() searches SearchMan default directories
for theme files.
2017-03-09 04:26:20 +01:00
Willem Jan Palenstijn
c64d91833f GUI: Check rect validity for popup/radio drawing 2017-02-28 15:55:52 +01:00
Willem Jan Palenstijn
5510640dbc GUI: Give each tab in TabWidget its own width
The width of each tab is now computed from its title, independently of
the other tabs. This increases the number of tabs that fit on the
screen.

This rewrite also fixes a bug where if the window size increased while
_firstVisibleTab > 0, some tabs would become inaccessible when the
scroll buttons were hidden.

The layout key Globals.TabWidget.Tab.Width is now treated as minimal
tab width. This is set so that the tabs fit reasonably well in lowres
layouts.

At the same time, this reduces the lowres scroll buttons heights to fit.

This patch makes the Nintento DS hacks in TabWidget obsolete.
(Hopefully! I'm not able to test.)
2017-02-28 15:55:52 +01:00
D G Turner
d5f0d1fdb2 GUI: Fix Unused Variable Compiler Warning when USE_PNG not set. 2017-01-12 10:00:17 +00:00
Alexander Tkachev
091ff83ed6 GUI: Add Storage providers logos
StorageWizardDialog now shows logo of the Storage being connected (in
modern highres theme).
2016-08-24 16:07:55 +06:00
Alexander Tkachev
c74ba4652d GUI: Add "Paste" button in StorageWizardDialog
It pastes clipboard contents as code into 8 fields of that dialog.
(Clipboard support works with SDL2 only.)

"Open URL" and "Paste" buttons are placed in the left column under the
picture (because there is no room for 4 buttons in the bottom row).

Commit also adds "dropbox.bmp", which is just a square 115x115 picture.
Such pictures are would be used as Storages logos in that dialog.

In lowres there is no left column, so all 4 buttons are in the same row.
None of them are visible, because they are overflowed. Container has to
be added to continue working on them.
2016-08-24 16:07:55 +06:00
Eugene Sandulenko
a65682a828 GUI: Fix warnings 2016-08-24 16:07:55 +06:00
Alexander Tkachev
c7fe842f9a GUI: Fix texts clipping
If it was completely clipped out (empty rectangle), it was drawing the
whole text ("empty means no clipping"), so I had to detect such cases
and change textArea to one small pixel.
2016-08-24 16:07:55 +06:00
Eugene Sandulenko
6524a8d103 GUI: Added transparency to PicWidgets 2016-08-24 16:07:55 +06:00
Eugene Sandulenko
1359255ea8 GUI: Added empty 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
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
f0c52096f3 GUI: Implemented possibility to use alphabitmaps in GraphicsWidget 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
0281b1eba8 GUI: Added support for PNG images 2016-08-24 16:07:55 +06:00
Alexander Tkachev
cea58cc61c JANITORIAL: Remove trailing spaces 2016-07-03 12:24:53 +02:00
Alexander Tkachev
3d636617d0 GUI: Use clipping everywhere 2016-07-03 12:24:46 +02:00
Alexander Tkachev
6fd6043391 GUI: Fix blitAlphaBitmapClip() 2016-07-03 12:24:11 +02:00
Alexander Tkachev
4b87563792 GUI: Add blipClip() 2016-07-03 12:23:57 +02:00
Alexander Tkachev
80412a4139 GUI: Add drawTabClip() 2016-07-03 12:22:10 +02:00
Alexander Tkachev
f22d11953d GUI: Add drawSquareClip() 2016-07-03 12:21:09 +02:00
Alexander Tkachev
559ca37daf GUI: Add VectorRendererSpec::drawTriangleClip() 2016-07-03 12:20:37 +02:00
Alexander Tkachev
425d963bd3 GUI: Fix ThemeItemTextData's dirty rectangle 2016-07-03 12:17:26 +02:00
Alexander Tkachev
fca0f0ed34 GUI: Make PopUpWidget clip 2016-07-03 12:16:43 +02:00
Alexander Tkachev
8f2d35b0b8 GUI: drawRoundedSquareClip() 2016-07-03 12:16:26 +02:00
Alexander Tkachev
3d2730a0dd GUI: clippingRect propagated deeper 2016-07-03 12:15:51 +02:00
Alexander Tkachev
d7278cc48b GUI: Prepare button to be clipped 2016-07-03 12:14:45 +02:00
Alexander Tkachev
49caaf77a1 GUI: Add ScrollContainer 2016-07-03 12:10:56 +02:00
Alexander Tkachev
08727857bc GUI: Use boss's x/y/w/h instead of clippingArea 2016-07-03 12:10:26 +02:00
Eugene Sandulenko
04bb80bc71 GUI: Fix regression 2016-06-06 18:43:36 +02:00
Eugene Sandulenko
8e4f892ef9 GUI: Fixed negative index check 2016-06-06 08:05:06 +02:00
Eugene Sandulenko
786780ccb9 GUI: Prevent potential negative index access 2016-06-05 23:10:20 +02:00
Eugene Sandulenko
61235e7f55 GUI: Fix possible negative index access 2016-06-05 23:10:20 +02:00
Eugene Sandulenko
a612b0a173 GRAPHICS: Restore layout debugging capabilities 2016-06-01 13:16:12 +02:00
Eugene Sandulenko
c7ad2155fc GUI: More object initialization cleanup 2016-06-01 13:16:12 +02:00
Ori Avtalion
ccc7506666 GUI: Fix constant names mentioned in comment 2016-03-23 18:01:13 +02:00
Johannes Schickel
a7dba17fec GUI: Fix pointer formatting in ThemeEngine.cpp. 2016-01-24 03:41:49 +01:00
Johannes Schickel
5a63ee5375 GUI: Use "button" instead of "btn" in variable names. 2016-01-24 03:41:29 +01:00
Bastien Bouclet
2d86f6da9c GRAPHICS: Introduce a size mode for TrueType fonts
Allows to match Windows font size selection by converting font heights
to point sizes using the TrueType tables.
2015-12-21 18:41:14 +01:00
Bertrand Augereau
91e6abd305 GUI: Use after free 2015-11-09 23:57:36 +01:00
Bertrand Augereau
06d83f148f GUI: strncat needs a destination C-string 2015-11-09 23:57:29 +01:00
Eugene Sandulenko
7d58a50c46 GUI: Removed 64k limit on built-in theme XML size 2015-11-07 13:26:56 +01:00
Johannes Schickel
5b03ba04d7 GRAPHICS: Allow client code to specify TTF render mode.
This allows clients to use the default FreeType2 render mode instead of light.
We really only use light as default because that's what looks best with the
font we use in our GUI right now (which is the same reason why formerly light
was always used in non-monochrome mode).
2014-06-09 01:04:47 +02:00
Matthew Hoops
740b6e8fbd IMAGE: Move all ImageDecoders to image/ 2014-02-28 00:27:28 -05:00
Joel Teichroeb
0ccc918940 GUI: Fix for potential bad cursor palette access in warning case.
Previously, if the colorsFound exceeded the maximum number of
cursor colors, a bad access to the cursor palette buffer could be
performed before the warning was emitted. This reordering avoids
that.
2013-11-14 15:11:16 +00:00
Eugene Sandulenko
8a340007ea Merge pull request #361 from rundfunk47/guiimprovements
GUI: Various GUI Improvements
2013-08-22 05:31:23 -07:00
Johannes Schickel
74a056e746 GUI: Clear dirty rects when initializing ThemeEngine.
This avoids nasty invalid writes to the overlay when the overlay is being
resized.
2013-08-19 00:06:46 +02:00