Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change: Minor widget changes. #10051

Merged
merged 3 commits into from Oct 16, 2022
Merged

Change: Minor widget changes. #10051

merged 3 commits into from Oct 16, 2022

Conversation

PeterN
Copy link
Member

@PeterN PeterN commented Sep 25, 2022

Motivation / Problem

  1. Default colour of widget text is blue (TC_FROMSTRING is the same value as TC_BLUE), but most windows use black text.
  2. Redundant SetDataTip() which set the default values again.
  3. Some windows have custom drawing code just to draw some text where the default widgets can handle this directly. This PR addresses a few of these.

Description

Resolved by...

  1. Default widget text colour is changed to TC_BLACK, to avoid needing explicit SetTextColour() calls. Most strings start with a colour code so are unaffected.
  2. SetDataTip removed where unnecessary.
  3. Custom drawing replaced with appropriate widget parameters.

Limitations

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR touches english.txt or translations? Check the guidelines
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

TC_FROMSTRING really means blue, and we almost never actually use
blue text.
WWT_PANEL defaults to 0x0 data and no tooltip, so no need to declare
the same in the widget tree.
Remove custom text drawing of some widgets in favour of standard text
widgets.
@michicc michicc merged commit dc1b84a into OpenTTD:master Oct 16, 2022
@PeterN PeterN deleted the use-text-widgets branch October 31, 2022 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants