-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Text wrapping is not working in dialogs #2602
Comments
I think this might be considered more of a bug than a feature, so I changed this to a bug instead. Also, I think this is related to #1001 as well. |
I'm not sure what For the broader subject of text wrapping not working - can we just add |
Probably a typo for
Simply inserting the scroll would cause it to collapse down, so we need to something extra to determine what a sensible size would be for content that could be scrolled. Either way making this change suffers the same bug that is demonstrated above - as in there is no defined and sensible minimum when you can wrap/scroll. In summary I think adding scroll does not help the reported problem. |
From testing I believe this does what I want: func ShowErrorLong(msg string, win *fyne.Window) {
label := widget.NewLabel(msg)
label.Wrapping = fyne.TextWrapBreak
scroll := container.NewVScroll(label)
errDialog := dialog.NewCustom("Error", "OK", container.NewMax(scroll), *win)
factor := float32(0.40)
winSize := (*win).Content().Size()
errDialog.Resize(fyne.NewSize(winSize.Width*factor, winSize.Height*factor))
errDialog.Show()
} Where factor sets the percentage of the window size to use for the error dialog. |
Setting a percentage of the window may make sense but why 40%? Won’t this get really tiny on an iPhone? Not sure the same factor applies to height and width as a portrait window will look super weird with this maths. |
Why not using a percentage, but just so the dialog will have the maximum possible size to cover the entire window and show the gradient border |
On larger screens this will look very strange. |
What is sure is that a dialog should never be wider/higher than the parent window. |
I agree. It also doesn’t, in my opinion, make sense to automatically pop out a dialog to a new window if the size is bigger than the parent. |
I forgot about this issue but just hit it again trying to use |
We need to get this resolved - some algorithm to wrap where required - and use "most?" of the screen width instead of just the height... |
Is your feature request related to a problem? Please describe:
When adding a label in dialog.CustomShow, if it's too long it'll go off the screen but if its wrapped it'll be a long vertical list
Normal
That same string wrapped with fyne.TextWrapWord
Describe the solution you'd like to see:
It would be nice to have it wrapped but not be constrained to a narrow vertical list, something like this
That image is photoshopped to show what it would look like
The text was updated successfully, but these errors were encountered: