1
0
Fork 0
Commit Graph

612 Commits (c2d4098afa7be59cefc0b1e01c6f7b83e4a63c65)

Author SHA1 Message Date
Peter Nelson 984d864c72 Codechange: Add OnClick handler for dropdown items.
This allows each dropdown item to indicate if something different should happen depending on where in the item was clicked.
2025-05-25 09:13:05 +01:00
Peter Nelson 7344dfe651 Change: Reflow Textfile window content incrementally.
This avoids a stall when reflowing a long text file with some truetype fonts.
2025-05-23 07:42:10 +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 c037722cb5
Fix 51a7edd: NewGRF debug sprite picker was broken. (#14246) 2025-05-10 20:27:43 +02:00
frosch 51a7edd941 Codechange: Remove _input_events_this_tick. 2025-05-06 18:29:41 +02:00
frosch 0d5b3ebd7f Codechange: Declare all IntervalTimers const, which can be const. 2025-05-06 18:29:41 +02:00
Peter Nelson dabf2ede67 Change: Add methods to close child windows with a specific window number. 2025-05-04 19:36:46 +01:00
Peter Nelson 3e608b5fe4
Fix: Zoom-scroll extra viewports only if the mouse cursor is over the viewport. (#14209) 2025-05-04 14:16:05 +01:00
frosch 8571af9833 Codechange: Turn ZoomLevel into enum class. 2025-05-03 23:21:09 +02:00
Rubidium 7805c1c189 Codechange: use std::string_view for ini_key 2025-05-01 23:24:43 +02:00
frosch 66733e2a50 Codechange: Use std::string_view in IME input handling. 2025-04-30 19:33:56 +02:00
Rubidium ef71ce0a9d Codechange: return std::string_view for Textbuf::GetText() 2025-04-29 22:15:49 +02:00
Peter Nelson 7846f0f4ee
Fix a4dc7249ee: Changing language or interface scale could hang. (#14087)
A bit of hysteresis caused by OnResize calling ReInit calling OnResize calling ReInit calling OnResize calling ReInit ...
2025-04-24 00:29:54 +01:00
Peter Nelson 788845f731
Change: Allow Double-Ctrl+Click on default size box to clear saved size. (#14055) 2025-04-21 14:16:29 +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 2c59838acb
Codechange: (re)set multiple bitset flags in one call. (#14017) 2025-04-18 14:07:57 +01:00
Peter Nelson c982816c0e Codechange: Manage window viewport via unique_ptr. 2025-04-09 22:03:23 +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 2909a14374 Codechange: Include table/strings.h in files that use StringIDs.
Be consistent with how and where the file is incldued.
2025-03-21 12:53:40 +00:00
Peter Nelson de45f5418b
Fix 0de7fd3c24: widget_lookup may contain non-NWidgetCore widgets. (#13787) 2025-03-09 19:49:26 +00:00
Rubidium 0de7fd3c24 Codefix: check the result of dynamic_cast for nullptr 2025-03-09 19:35:14 +01:00
Peter Nelson 274b7a0195
Fix #13645: "Follow vehicle" button not raised when following stopped. (#13746) 2025-03-06 00:00:57 +00:00
Peter Nelson 27761ae431 Cleanup: Remove global string parameters.
Global parameters, and functions for dealing with them, are now gone.
2025-03-04 08:48:35 +00:00
Rubidium d94d421772 Codechange: prepare for replacement of SetStringParameter by GetWidgetString 2025-03-02 11:04:15 +01:00
Rubidium fd4adc55e3 Codechange: replace INVALID_X with XID::Invalid() for PoolIDs 2025-02-16 20:23:00 +01:00
Peter Nelson 2cb9f55183 Codechange: Store EncodedString for tooltip text.
This replaces capturing and storing string parameters.
2025-02-10 22:49:14 +00:00
Peter Nelson 693a5f42b9 Codechange: Use EnumBitSet for NWidgetDisplayFlags. 2025-02-06 19:43:35 +00:00
Peter Nelson d30e8dd1c1 Codechange: Use EnumBitSet for WindowDefaultFlags. 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 afc0745aa2
Codechange: Specify underlying type for all enums excluding those exposed to scripts. (#13383) 2025-01-28 22:17:34 +00:00
Peter Nelson b7a82819de Codechange: Remove ZeroedMemoryAllocator from WindowDesc.
All members which are not intended to be changed are now const to ensure they are set
2025-01-26 16:42:05 +00:00
Rubidium f7aaf8ea24 Codechange: use StrEmpty instead of number of bytes in string to check for empty 2025-01-23 10:11:22 +01:00
Rubidium bfc8ae6c52 Codechange: use accessor for (scrollbar_)index as they are read only 2025-01-04 20:51:47 +01:00
Rubidium 56d4d3cc7a Codechange: add and use GetToolTip instead of direct access 2025-01-03 11:10:05 +01:00
Eri the Switch 32dfb37b9d Change: Use floats for tracking 2D scrolling
This ensures the smoothest experience possible when dragging map
around with 2D scrolling.
2024-12-14 15:43:31 +00:00
Peter Nelson a3437df7b7
Fix #13121: Crash when clicking on scrollbar if contents don't need scrolling. (#13122) 2024-11-25 08:20:20 +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 3be0166801 Codechange: Use std::ranges::find where possible.
Replace `std::find(range.begin(), range.end(), ...)` with `std::ranges::find(range, ...)`.
2024-11-24 10:36:03 +00:00
Peter Nelson e1697a6ad1
Codechange: Don't use enums for non-enumerated values. (#13031)
In the past we have used enums to hold an arbitrary values. These values
are not enumerated types, so make them constants instead.
2024-10-27 18:02:49 +00:00
Peter Nelson 3bfd9de68d
Fix: Highscore/Endgame window can disappear offscreen if game window is resized. (#12951) 2024-09-19 09:18:25 +01:00
Jonathan G Rennison 1e3855c9c3
Fix: Crash when pressing arrow keys in bootstrap mode (#12948) 2024-09-18 16:41:54 -04:00
steve-goldman f5f488e778
Change: improve when to stops following vehicle (#12808)
- Changing zoom no longer stops following vehicle
- Key scrolling while following a vehicle stops following
- Autoscrolling while following a vehicle stops following
- Main viewport can begin following a vehicle at any zoom
2024-07-01 01:13:47 +02:00
Steve Goldman c53ed9fad6 Codechange: Creating enum for 'scrollwheel_scrolling' setting 2024-06-24 21:56:26 +02:00
Loïc Guilloux d7137651f2
Fix #12787: boostrap doesn't have main vindow (#12788) 2024-06-15 20:39:15 +00:00
Peter Nelson 55314513ce
Codechange: Pass NWidgetParts as span instead of begin/end pointers. (#12779) 2024-06-12 23:08:35 +01:00
Peter Nelson 4cf6d1dd79
Codechange: Pass WindowDesc by reference instead of pointer. (#12771)
WindowDesc as passed to Windows is not optional so don't allow to it to be nullptr.
2024-06-11 08:58:03 +01:00
Peter Nelson 7e12b5ff0f
Fix: Crash if interface scale or font size changes with chat box present. (#12705)
Caused by the chat box being undrawn with the new dimensions, leading to out-of-bounding memory access.
2024-05-22 18:06:34 +01:00
Peter Nelson cc6e4768a9
Fix: Out-of-order window set up due to deferred window resize. (#12592)
Deferred window resize was being applied to the initial window resize event, resulting in some window state (e.g. scroll bar capacity) not being initialised when expected.
2024-04-29 17:05:35 +01:00
Peter Nelson 3c94e81665 Codechange: Use ZOOM_LVL_MIN to refer to first zoom level.
Many uses of ZOOM_LVL_NORMAL actually just want the first zoom level slot, so use ZOOM_LVL_MIN to make this clearer.
2024-04-04 22:27:03 +01:00
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00