Repository navigation
Show dialog messages with a wrapping label - #2007
Merged
jecisc merged 3 commits intoNov 30, 2026
Merged
Conversation
Inform, alert and confirm dialogs show their message with a wrapping label instead of a read-only text. Request and select dialogs keep the text for now: their layout estimates the message height. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In a vertical box, a nested layout added with expand: false shrink-wraps instead of keeping the height it had when built, and a wrapping label reports its height as its minimum. Request and select dialogs then show their whole message with a wrapping label, without the font-metric height estimate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
repository_commit rewrote it in 382574a although nothing in it changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
Contributor
|
Looks good to me. |
Contributor
|
Seb did you check with topple? @tinchodias |
Contributor
Author
I will! |
Contributor
|
For the record, this project must be loaded on a Pharo 15: https://github.com/pharo-graphics/Spec-Toplo This way: then try: app := StPharoApplication new.
app useBackend: #Toplo.
presenter := SpLabelPresenter newApplication: app.
presenter beWrap.
presenter label: 'Multi
Line'.
presenter open.the adapter implements it |
Contributor
Contributor
Author
|
Great, I will open an issue in Spec Toplo to not forget! |
Contributor
Author
|
Actually I see that you have already opened a PR |
jecisc
pushed a commit
to pharo-vcs/iceberg
that referenced
this pull request
Dec 1, 2026
The warning row is added with expand: false, so it takes only the height of its text. Needs pharo-spec/Spec#2007 to fit the wrapped text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
For the record: pharo-graphics/Spec-Toplo#167 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Message dialogs now show their message with a wrapping label instead of a read-only text, and request dialogs no longer cut it off.
This PR fixes two things. First, dialogs now use multiline labels (wrapping labels), so they no longer need to calculate the height of the label. It simplifies the dialogs' code.
For this, a fix in the box layout was needed. Now, the box adapter lets a nested layout added with
expand: falseto a vertical box take the height of its content. Before, it kept the height it had when it was built: a wrapping label in such a row (the dialog's icon and message) was first laid out at about one word per line, and the row kept that height, pushing the rest of the dialog out of the window.Goal
Spec labels can wrap (
SpLabelPresenter>>#beWrap, #1993). A dialog message is text to read, not to edit, but message dialogs showed it in a read-onlySpTextPresenterwithout scroll bars, and request and select dialogs estimated its height from font metrics, one line short.Main changes
SpAbstractMessageDialog>>#newDialogLabelanswers a wrapping label, for inform, alert, confirm, request and select dialogs.expand: falseinstead of a height estimated from font metrics (calculateLabelHeight, removed withlabelMargin). The estimate was one line short: a three-line message in a request dialog lost its last line behind the text input.expand: falsenow takes the height of its content (vResizing: #shrinkWrap) instead of keeping the height it had when it was built (#rigid).SpMorphicBoxAdapter>>#basicAdd:constraints:to:makes the switch; horizontal boxes keep#rigid.SpWrappingLabelMorph>>#minExtentanswers at least its height, so a row that shrink-wraps keeps all its lines.🤖 Generated with Claude Code but reviewed thoroughly by jordanmontt ❤️