Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#370 closed enhancement (fixed)

Add wordwrapping support to MUI_Request

Reported by: Andreas Falkenhahn Owned by: Thore Böckelmann
Priority: normal Milestone: 5.0-2018R1
Component: Text.mui Version: 5.0-2017R4
Severity: minor Keywords:
Cc: OS Platform: All
Blocked By: Blocking:
Release Notes:


On Windows, Linux (GTK) and OS X the text in the standard message boxes is automatically wordwrapped if it exceeds a certain length. It would be nice if there was such a feature in MUI. Currently, the message box opened by MUI_Request() will be as wide as the widest line in the text that should be shown. On the operating systems listed above message boxes will never exceed about a quarter of the screen's width which is a useful feature IMHO because you don't know the font and screen size so including lines of a hardcoded length in message boxes isn't really reasonable.

Change History (4)

comment:1 Changed 3 years ago by Thore Böckelmann

Component: muimaster.libraryText.mui
Milestone: future release5.0-2018R1
Owner: set to Thore Böckelmann
Priority: undecidednormal
Status: newassigned

This sounds quite reasonable. Shouldn't be too hard to implement since all the stuff to do the required calculations is already there.

What is even more important is the fact that far too long requester body texts can no longer lead to MUI's automatic font adaption to let the GUI shrink to a size which eventually fits on the screen.

comment:2 Changed 3 years ago by Thore Böckelmann

Resolution: fixed
Status: assignedclosed

In 6188:

  • masterreq.c: MUI_Request() will automatically wrap the body text at word boundaries. This allows to use arbitrary long single line body texts without having to fear that MUI will automatically adapt the font sizes to squeeze the GUI onto the screen, which eventually may fail if the strings are too long. Currently the text will be wrapped to take not more than half of the screen's width, but at least 400 pixels. This closes #370.

comment:3 Changed 3 years ago by Andreas Falkenhahn

Thanks, but I think making this active by default is not a good idea because it can break old apps which expect MUI_Request() to never wordwrap. I think there should be a new flag or something so that apps can explicitly tell MUI_Request() to enable wordwrapping.

comment:4 Changed 3 years ago by Thore Böckelmann

The 'worst' thing to happen would be a text wrapped at unwanted positions. But the text remains readable and is in no way distorted or malformed.

I'd say it is ok to leave everything as it is for the moment. If someone complains things can be fixed later again. Developers (hopefully) have always been aware of the possible problems with too long lines have should have added artifical line breaks already from the beginning.

Alternatively I can increase the maximum allow width of the body text to 70% or 80%, such that the chance of unwanted wrapping decreases.

Note: See TracTickets for help on using tickets.