Skip to content

New widget SelectableLabel; use ScrollComponent in ScrollLabel, EditBox #520

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

Merged
merged 15 commits into from
Jul 17, 2025

Conversation

dhardy
Copy link
Collaborator

@dhardy dhardy commented Jul 17, 2025

Rework how ScrollLabel, ScrollText, EditBox handle scrolling: these now all use a ScrollComponent in the outer widget and do not support scrolling in the inner widget. SelectableLabel was added as the new inner widget of ScrollLabel. ScrollLabel and ScrollText were merged into a single widget. This also fixes the inaccurate usage of Role in #519.

TextInput component no longer handles kinetic scrolling and better tracks the current action "phase".

Fixes:

  • While kinetic scrolling is active, steal cursor/touch focus (preventing some weird interactions on moving targets).
  • fn Tile::translation now takes argument index, allowing per-child translation. This is required for the new ScrollLabel, EditBox but also allows translation to more accurately match AccessKit.
  • Remove hacky fn EditField::set_outer_rect
  • Disable line wrapping in single-line EditField. (We still don't replace explicit new-lines in the text when rendering though, like most single-line edit widgets do.)
  • Limited fix for height allocation of EditField: use the text height when available but also use Em size as a backup for empty fields or requesting excess size. The real fix is... well, there isn't really one considering we don't know what fonts might be used as a fallback and what glyph heights they might use.
  • Fix child_rect allocation in ScrollRegion. (Not properly tested but I'm pretty sure the old code was wrong.)

@dhardy dhardy merged commit f443885 into master Jul 17, 2025
5 checks passed
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.

1 participant