Skip to content

Conversation

@UnnaturalTwilight
Copy link
Contributor

Description

Adds wordchar to the options of :wrap-mode of labels. This allows text to wrap on word boundaries in most cases but will fall back to wrapping between characters if necessary to fit.

Usage

(label
  :text "This is some label text with verrrrrrrrrrrrrrrrrrrrrrrrrrrry loooooooooooooooooooooooooong words"
  :wrap true
  :width 150
  :wrap-mode "wordchar" ; prefers wrapping on words, wraps on chars if necessary
)

Showcase

image

Additional Notes

I'm not sure wordchar is the best name for this mode. I based the name off of the GTK name of the mode but am open to better suggestions.
It may also be worth considering if this should be the default wrap mode.

Checklist

Please make sure you can check all the boxes that apply to this PR.

  • All widgets I've added are correctly documented.
  • I added my changes to CHANGELOG.md, if appropriate.
  • The documentation in the docs/content/main directory has been adjusted to reflect my changes.
  • I used cargo fmt to automatically format all code before committing

@elkowar elkowar merged commit 15315a0 into elkowar:master May 13, 2025
1 check 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.

2 participants