1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-18 09:52:44 +01:00
Commit Graph

424 Commits

Author SHA1 Message Date
Cyprian Klimaszewski
99f04f27de Doc: Update information for receiving a copy of GPL. (#14869) 2025-12-07 11:25:08 +00:00
Cyprian Klimaszewski
abf8438a1b Fix #14756: Invalidate nested focus before widget container is cleared. (#14809) 2025-12-06 12:52:44 -05:00
Peter Nelson
ff674829f5 Codechange: Replace Rect CentreTo with CentreToHeight. (#14675)
So far all callers only need to centre vertically, so not having to provide the existing width simplifies calls.
2025-09-28 13:09:36 +00:00
Peter Nelson
31eec7106b Codechange: Use Rect WithX/WithY in some places. 2025-09-28 00:31:23 +01:00
Peter Nelson
1229a498b7 Codechange: Add constant for INVALID_WIDGET. (#14649)
Replaces direct use of -1, making it easier to find.
2025-09-21 21:47:04 +00:00
Peter Nelson
1278f62e2e Codechange: Call shorter variant of DrawFrameRect and GfxFillRect. (#14647)
Pass rect instead of breaking it up when possible.
2025-09-21 20:30:59 +01:00
Peter Nelson
71eba489bc Codechange: Deduplicate DrawButtonDropdown. (#14646)
Use Rect methods to position components.
2025-09-21 20:26:06 +01:00
Peter Nelson
a7b06fc9f5 Codechange: Don't use Point for non-2D coordinate. (#14645)
`HandleScrollbarHittest` returns min and max coordinates, not x and y.
Also avoid referring to the min and max coordinates as top and bottom, as these functions are used for both vertical and horizontal scrollbars.
2025-09-21 14:57:53 +01:00
Rubidium
7c0f69a8fe Codefix: typos in comments and strings 2025-08-31 10:30:37 +02:00
Peter Nelson
8e2df7809b Codechange: Add distinct type to hold pixel drawing colour. (#14457)
This is used for individual pixels as well as line drawing.
2025-07-20 22:57:55 +01:00
Peter Nelson
d2ee2add28 Codechange: Remove ZOOM_LVL_GUI macro. (#14423) 2025-07-09 11:05:06 +01:00
Peter Nelson
7ec78e94db Fix: Don't include height of blank text in frame and inset widgets. 2025-06-17 08:54:08 +01:00
Peter Nelson
82f5af7ecd Codechange: Allow all widget types to have a WidgetID index. 2025-06-05 17:55:24 +01:00
Peter Nelson
780c26237f Codechange: Add OnScrollbarScroll window event, called when a scrollbar position changes. 2025-05-23 07:42:10 +01:00
frosch
4111ce2698 Add: WWT_IMGTEXTBTN, WWT_PUSHIMGTEXTBTN 2025-05-07 18:41:48 +02:00
frosch
8571af9833 Codechange: Turn ZoomLevel into enum class. 2025-05-03 23:21:09 +02:00
Peter Nelson
17e7dafa2a Change: Add alternate_colour widget data for boolean button.
Allows boolean button to have different background and button colours.
2025-04-23 19:07:52 +01:00
Peter Nelson
d89753b88d Codechange: Add dedicated widget for boolean toggle buttons. 2025-04-21 16:23:11 +01:00
Peter Nelson
e9a92b8795 Fix: Odd drawing and crash if scrollbar is not tall enough. (#14052)
Under certain conditions the scrollbar "tab" could be too large for the scrollbar, and cause issues.

Caused by an off-by-one in height calculation.
2025-04-20 23:23:52 +01:00
Peter Nelson
5008568dfc Codechange: Rename CenterBounds to CentreBounds and move to geometry header. (#14002) 2025-04-14 23:55:40 +01:00
Peter Nelson
8275bbfb87 Codechange: Pass Viewport by reference.
This means we do not have to care what type of pointer is used.
2025-04-09 22:03:23 +01:00
Peter Nelson
2a47afad89 Fix d94d421772: Frame widget with label had incorrect spacing. (#13967)
Caused by the frame widget not testing GetStringForWidget properly.
2025-04-05 19:12:42 +01:00
Rubidium
d94d421772 Codechange: prepare for replacement of SetStringParameter by GetWidgetString 2025-03-02 11:04:15 +01:00
Rubidium
5cee804f98 Codechange: remove ZeroedMemoryAllocator from NWidgetBase 2025-02-22 14:38:33 +01:00
Peter Nelson
693a5f42b9 Codechange: Use EnumBitSet for NWidgetDisplayFlags. 2025-02-06 19:43:35 +00:00
Peter Nelson
28eb5e05c8 Codechange: Use EnumBitSet for NWidContainerFlags. 2025-02-06 19:43:35 +00:00
Peter Nelson
56b1e9df1f Codechange: Use EnumBitSet for FrameFlags. 2025-01-30 08:40:42 +00:00
Peter Nelson
efb05396a7 Codechange: Use EnumBitSet for WindowFlags. 2025-01-30 08:40:42 +00:00
Peter Nelson
cea62a8399 Codechange: Use EnumBitSet for AspectFlags. 2025-01-29 21:46:39 +00:00
Rubidium
532f7de1f8 Codechange: make direct access to tooltip/widget_data protected 2025-01-04 21:55:43 +01:00
Rubidium
bfc8ae6c52 Codechange: use accessor for (scrollbar_)index as they are read only 2025-01-04 20:51:47 +01:00
Rubidium
6d9f30c343 Codefix: prevent matrix overflows on high resolution monitors 2025-01-04 12:18:37 +01:00
Rubidium
99d790c4bb Codechange: split widget_data into its actual components 2025-01-04 11:33:24 +01:00
Rubidium
60b9eb5cc6 Codechange: replace last usage of SetDataTip with specific variant 2025-01-03 23:25:07 +01:00
Rubidium
c972a9ae1f Codechange: remove (unused) tooltip from function to set matrix dimensions 2025-01-03 15:05:10 +01:00
Rubidium
7c1ddd74d5 Codefix: use SetToolTip(..) instead of SetStringTip(STR_NULL, ..) 2025-01-03 14:18:59 +01:00
Rubidium
b60101853c Codechange: add and use SetString over directly accessing widget_data 2025-01-03 12:14:55 +01:00
Rubidium
fb06ddafba Codechange: add and use SetSprite over directly accessing widget_data 2025-01-03 11:13:16 +01:00
Rubidium
9ac1bad480 Codechange: add and use GetString over directly accessing widget_data 2025-01-03 11:11:01 +01:00
Rubidium
56d4d3cc7a Codechange: add and use GetToolTip instead of direct access 2025-01-03 11:10:05 +01:00
Rubidium
f0a74fcabb Codechange: use SetToolTip instead of accessing tool_tip directly 2025-01-03 11:09:49 +01:00
Rubidium
3196e0709d Codechange: replace internal SetDataTips with appropriate variants 2025-01-03 11:09:49 +01:00
Rubidium
7c2668d10f Codechange: replace SetDataTip(0x0, with SetTooltip( 2025-01-02 23:28:43 +01:00
Rubidium
4bf36e3fa6 Codechange: replace SetDataTip(STR_ with SetStringTip(STR_ 2025-01-02 23:28:43 +01:00
Peter Nelson
98e980c478 Codechange: WWT_TEXT, WWT_LABEL and WWT_EMPTY don't use colour. (#13218)
Set colour for these widget types to INVALID_COLOUR to avoid giving the impression that the colour has a purpose.

A runtime exception is added to catch this the existing widget unit test.
2025-01-01 15:38:19 +00:00
Peter Nelson
aa461fca68 Codechange: A transparent FrameRect doesn't care about colours. (#13162) 2024-12-10 05:00:46 +00:00
Peter Nelson
60f1618cc7 Add: Widget layer container widget type, NWID_LAYER.
This widget allows child widgets to be overlaid on top of each other.

Very similar to NWID_SELECTION except all layers are always visible.
2024-12-01 09:44:11 +00:00
Peter Nelson
30bda88e97 Codefix: NWidgetStacked::AdjustPaddingForZoom duplicates inherited method. (#13135) 2024-11-30 23:15:17 +00:00
Peter Nelson
0c04966dc3 Fix #13022: Ensure minimum size of scrollbar slider. (#13119)
When there are many more items than fit in a list, the scrollbar slider scales to fit but there is no minimum size. It becomes too small to click on and use.

Ensure scrollbar slider is at least the same size as the buttons either end.
2024-11-24 11:50:04 +00:00
Peter Nelson
3cd1200668 Fix #12976: Incorrect widget rect scrolling for RTL languages. (#12978)
Industry directory, AS/GS and Textfile window did not consider RTL when applying horizontal scrolling.
2024-10-05 08:02:59 +01:00