Commit Graph

12 Commits

Author SHA1 Message Date
Peter Nelson d683ec0183
Codechange: Move dropdown and slider out of widgets directory. (#12403)
Also shuffle headers to place widget includes near end.

This leaves the widgets directory solely for defining Widget IDs.
2024-03-31 19:37:16 +01:00
Rubidium 86cb184eb4 Codechange: use std::source_location over __FILE__ and __LINE__ for WindowDesc 2024-03-10 10:14:20 +01:00
Peter Nelson fef0bfcfd3
Fix: TextfileWindow called virtual methods before constructor completed. (#11889)
SetStringParameters() was called during widget tree init in the constructor.

Calls within a constructor cannot call the derived classes methods. This would result in invalid data being passed to the string system, which could then crash.
2024-01-27 14:45:37 +00:00
Peter Nelson 7737aa6640 Codechange: Make all NWidgetPart arrays constexpr.
This ensures that the arrays are not created at runtime and prevents using non-constexpr values.
2024-01-16 21:57:05 +00:00
Peter Nelson 71aaed860b
Codechange: Missing some conversions to WidgetID. (#11773) 2024-01-14 16:47:10 +00:00
Peter Nelson a0dfb76e34 Codechange: Replace mishmash of types for widget index with WidgetID.
Indices were stored as int, but often passed around as uint/uint8_t and casts.

Now they should all use WidgetID.
2023-12-30 00:23:57 +00:00
Peter Nelson fd84f73323
Fix #11643: Empty area at top of survey preview. (#11647)
Empty area at the top of some textfile windows due to calling
SetDisplayedPlane() after calling FinishInitNested(), and/or changing
the displayed plane and not calling ReInit() after.

This was previously hidden by CheckForMissingGlyphs() reinitialising
all windows anyway.
2023-12-30 00:19:27 +00:00
rubidium42 27082f9efa Codechange: pass std::string references to OpenBrowser 2023-11-29 02:02:30 +01:00
Peter Nelson 90bd8e64d8 Change: Simplify help window widgets and use sparse padding. 2023-11-07 23:09:05 +00:00
Peter Nelson 18fb8e153f Codechange: Add __FILE__/__LINE__ of WindowDesc to WindowDesc.
This is to allow unit-tests to produce more useful output.
2023-11-02 22:25:01 +00:00
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Niels Martin Hansen 41de0d46f3 Feature: Help and manuals access window 2023-09-13 16:11:08 +02:00