Commit Graph

477 Commits

Author SHA1 Message Date
Peter Nelson f5f035a22b Codechange: Make use of Rect Width/Height helpers. 2022-11-12 18:28:39 +00:00
PeterN f24286a1ae Fix: Ensure 31-bit shifts are unsigned. (#10128)
Shifting a signed 32-bit integer by 31 bits is undefined behaviour.
A few more than necessary are switched to unsigned for consistentency.
2022-11-04 07:15:59 +00:00
Peter Nelson ba94efba87 Change: Add flag to apply resize to largest resize step first.
Resize step is normally allocated equally amongst all resizable widgets.
With this flag, we allocate as much as possible from the largest
resize step first.
2022-10-16 14:56:34 +02:00
Peter Nelson 296af146fb Change: Default widget text colour to black.
TC_FROMSTRING really means blue, and we almost never actually use
blue text.
2022-10-16 14:24:51 +02:00
dP a38dc30bf6 Merge remote-tracking branch 'upstream/master' 2021-08-16 01:58:47 +03:00
dP 9df4f2c4fc Update to 12.0-beta1 2021-08-15 14:57:29 +03:00
Patric Stout 28e90769f7 Codechange: use "[[maybe_unused]]" instead of a wide variety of other ways we had
While at it, replace OTTD_ASSERT with WITH_ASSERT, as this
is always set if assert() is valid. No matter if NDEBUG is set
or not.
2021-06-03 17:30:00 +02:00
PeterN 330a305c99 Fix: Apply unscaled padding to Viewport inside WWT_INSET. (#9219)
Since pixel dimensions in SetPadding() are scaled by GUI size, padding for inset viewports was excessive.

Instead, automatically apply padding for WWT_INSET at widget level. This applies to all widgets inside a WWT_INSET, which in all instances is a NWID_VIEWPORT.
2021-05-08 21:01:16 +01:00
Peter Nelson d8e06e590a Codechange: Make GetCurrentRect() conform to usual Rect bounds, and reuse it.
Similar code is already repeated in other locations.
2021-05-08 09:53:55 +01:00
Peter Nelson 52b16237ad Codechange: Don't update window contents if scrollbar position has not moved. 2021-05-08 09:52:54 +01:00
dP d7c46e1477 Merge remote-tracking branch 'upstream/1.11' into 1.11 2021-05-03 22:21:59 +03:00
dP ac7d3eba75 Update to 1.11.2 2021-05-03 22:10:57 +03:00
PeterN 256dbee255 Fix: Crash when extra viewport height is zero with sign in view. (#9175)
If a viewport sign straddles the top of a viewport, a crash will occur if the viewport height is zero. This is resolved by simply not attempting to draw the viewport in this situation, consistent with other widgets.
2021-05-02 10:21:27 +01:00
Peter Nelson 4791ff2862 Fix: Recalculate padding and minimum sizes when GUI or Font zoom is changed. 2021-04-30 17:08:15 +01:00
Peter Nelson 6fe5353da2 Cleanup: Set unchanging scrollbar properties in constructor. 2021-04-30 17:08:15 +01:00
Peter Nelson 03a43b8247 Cleanup: Call SetMinimalSize instead of setting min_y directly. 2021-04-30 17:08:15 +01:00
Peter Nelson f5569763c9 Fix: Specify width when width is required instead of top. 2021-04-30 17:08:15 +01:00
Peter Nelson 4c6cca459a Cleanup: Remove fairly redundant DrawDropdown() function. 2021-04-30 17:08:15 +01:00
Peter Nelson 5153e1b6e3 Cleanup: Horizontal widget size is commonly width rather than length. 2021-04-30 17:08:15 +01:00
Peter Nelson 51b4bd6c38 Codechange: Add widget text colour override property. 2021-04-22 16:42:04 +01:00
Peter Nelson 636e37d183 Codechange: Add internal widget alignment property, along with widget part. 2021-04-22 16:42:04 +01:00
Peter Nelson 2a0365b3d9 Cleanup: Remove unnecessary parameter of GetScrolledRowFromWidget()
Line height defaults to the resize height of the relevant widget, which is
set in all cases. Therefore it is not necessary to specify this value every time.

Additionally fixes scrolled padding for the framerate window.
2021-04-21 23:12:10 +02:00
Rubidium bf4fe19a66 Codechange: merge duplicated logic to scroll in lists by key into a single function 2021-04-21 21:12:08 +02:00
dP 33f4c4996a Merge remote-tracking branch 'upstream/1.11' into 1.11 2021-04-19 01:20:03 +03:00
dP 5881c752f5 Update to 1.11.1 2021-04-19 00:52:41 +03:00
Charles Pigott dd798d688b Fix #8919: Release builds with asserts enabled (#8925) 2021-04-01 23:57:49 +01:00
dP 93d8111960 Merge remote-tracking branch 'upstream/1.11' into 1.11 2021-04-01 17:33:31 +03:00
dP 5253131d44 Update to 1.11.0 2021-04-01 17:02:53 +03:00
Patric Stout fece1c57ca Codechange: Suppress warnings when asserts are disabled (#8917) 2021-04-01 11:16:19 +02:00
dP c36ef2b3f3 Merge remote-tracking branch 'upstream/1.11' into 1.11 2021-03-15 20:11:52 +03:00
dP 595606287d Update to 1.11.0-RC1 2021-03-15 12:57:26 +03:00
Tyler Trahan de891238d6 Change: Recolour graph windows to brown (#8700) 2021-03-11 15:30:29 +01:00
PeterN 9fdc881005 Fix: Scale PIP-padding the same as regular padding. (#8829) 2021-03-09 10:43:04 +01:00
dP c47930887b Merge remote-tracking branch 'upstream/1.11' into 1.11 2021-01-25 22:53:44 +03:00
dP 5e4506f493 Update to 1.11.0-beta1 2021-01-23 17:31:11 +03:00
Patric Stout af22a4f2cd Add: show in the tooltip of disabled toolbar buttons why they are disabled 2021-01-08 16:43:51 +01:00
Charles Pigott 9b800a96ed Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
TechGeekNZ a10013dd00 Codechange: Spell 'Viewport' consistently
Some places in the codebase misspell 'Viewport' as 'ViewPort' or 'view_port'.
This patch makes everything consistent.
2020-07-27 17:31:29 +01:00
TechGeekNZ 8652a4db76 Cleanup: Give SetDirtyBlocks a more descriptive name. 2020-06-09 13:15:47 +01:00
dP 1492a22027 Update to 1.10.0-beta2 2020-01-06 19:06:51 +03:00
dP c7c3966eec Update to 1.10.0-beta2 2020-01-06 18:49:34 +03:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
dP ceea4c88be Merge 1.10.0-beta1 2019-11-01 16:08:44 +03:00
dP 599ccf0c2b Update to 1.10.0-beta1 2019-10-31 22:24:28 +03:00
dP b84a475e14 Initialize with OpenTTD 1.9.3 2019-10-31 21:58:04 +03:00
glx 1f418555a1 Fix #7742, 66dd7c3: widget position can be negative 2019-09-17 20:11:34 +02:00
Pavel Stupnikov 4934dc1083 Update to 1.9.2 2019-07-12 02:46:41 +03:00
Pavel Stupnikov 383c7fcc21 Update to 1.9.2
--HG--
branch : openttd
2019-07-09 19:35:53 +03:00
Niels Martin Hansen 62dec9f174 Fix: Scale all min size and padding by UI scale 2019-04-24 23:04:55 +02:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00