Skip to content

Fix clipped title in number_input_popup#86824

Open
dobbry-vechur wants to merge 1 commit intoCleverRaven:masterfrom
dobbry-vechur:fix/input-popup-title-clip
Open

Fix clipped title in number_input_popup#86824
dobbry-vechur wants to merge 1 commit intoCleverRaven:masterfrom
dobbry-vechur:fix/input-popup-title-clip

Conversation

@dobbry-vechur
Copy link
Copy Markdown
Contributor

@dobbry-vechur dobbry-vechur commented May 3, 2026

Summary

Bugfixes "Fix clipped title in number_input_popup"

Purpose of change

Closes #86800. Title bar got clipped by the close button on age/height/stat/skill popups during character creation.

Describe the solution

  • input_popup::get_bounds() sizes the popup to the wider of the title text or the longest description line, floored at 30 chars.
  • number_input_popup::set_value_range(min, max) records the range and fills the description with a "Range: X - Y" hint, so the title can stay short.
  • Number input width is driven by the existing max_input_length (no parallel knob); when set the input + buttons right-align inside the row.
  • Description renders inline with the input row so the popup stays compact.
  • Save / Cancel buttons row at the bottom, right-aligned, mirroring TEXT.CONFIRM / TEXT.QUIT.
  • Character creation popups switched to the new APIs and dropped "Enter ... Minimum X, maximum Y" boilerplate from titles.

Describe alternatives you've considered

N/A

Testing

Verified in-game.

image image

Additional context

N/A

@github-actions github-actions Bot added [C++] Changes (can be) made in C++. Previously named `Code` Character / World Generation Issues and enhancements concerning stages of creating a character or a world <Bugfix> This is a fix for a bug (or closes open issue) astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels May 3, 2026
Copy link
Copy Markdown
Contributor

@mqrause mqrause left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like sizing to title bar is the wrong approach here. The title bar simply is not meant to hold that much information. Extra text should be moved to the description or label. Although I'm aware that autosizing with a description actually screws up the height on the first frame.

Min and max values could be a property of the popup itself, with its own hint label or something. That should shorten the titles enough.

Comment thread src/input_popup.cpp
@dobbry-vechur dobbry-vechur force-pushed the fix/input-popup-title-clip branch from 400d6e9 to c35c0b9 Compare May 3, 2026 21:22
@dobbry-vechur dobbry-vechur requested a review from mqrause May 3, 2026 21:23
@github-actions github-actions Bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 3, 2026
- size popup to fit title or widest description line, floor 30 chars
- add set_value_range() that fills popup description
- size + right-align number input via max_input_length
- inline description on input row, drop trailing NewLine
- add Save / Cancel buttons row, right-aligned
- shorten character creation popup titles, move range to description
@dobbry-vechur dobbry-vechur force-pushed the fix/input-popup-title-clip branch from c35c0b9 to b8c0de4 Compare May 4, 2026 01:06
@github-actions github-actions Bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 4, 2026
@dobbry-vechur
Copy link
Copy Markdown
Contributor Author

/retry

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

@github-actions github-actions Bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 4, 2026
@mqrause
Copy link
Copy Markdown
Contributor

mqrause commented May 4, 2026

Tested with some other popups that break with the current state of this PR:

Filter in V menu, very long description with style elements (indentation, empty lines), no max input grafik
Filter in uilist (debug spawn items), arguably unnecessary max input of 256 (aka very large number), "123456" entered grafik

@dobbry-vechur
Copy link
Copy Markdown
Contributor Author

Tested with some other popups that break with the current state of this PR:
Filter in V menu, very long description with style elements (indentation, empty lines), no max input
Filter in uilist (debug spawn items), arguably unnecessary max input of 256 (aka very large number), "123456" entered

Thanks! will adjust.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Character / World Generation Issues and enhancements concerning stages of creating a character or a world json-styled JSON lint passed, label assigned by github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem with number_input_popup in character creation

2 participants