Redesign Message Dialog#2934
Conversation
|
As the discussion on the bug reveals, there is no obvious consensus to find between aligned left vs centered; however, all OSs recommend to get the width fit the content (ie no extra space), so I think for a first iteration, we should focus on just saving the extra space (changing the min width to 0 or DEFAULT), and consider whether to center or not later; maybe if all OSs align on the same recommendation some day. |
cd6224c to
f549998
Compare
f549998 to
0100808
Compare
Made minor adjustment for these cases |
0100808 to
1db3a95
Compare
merks
left a comment
There was a problem hiding this comment.
I think changing the horizontalSpan is a bad idea. I'm not even sure why it's needed.
| layout.marginWidth = 0; | ||
| composite.setLayout(layout); | ||
| GridData data = new GridData(GridData.FILL_BOTH); | ||
| data.horizontalSpan = 2; |
There was a problem hiding this comment.
Sorry, I had only configured the platform UI code in my workspace, which caused me to overlook the impact on the subclasses. I've now reverted the change and adjusted the value to 1 to remove the extra space.
| if (message != null) { | ||
| messageLabel = new Label(composite, getMessageLabelStyle()); | ||
| messageLabel.setText(message); | ||
| int minWidthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH - 50); |
There was a problem hiding this comment.
It's odd to compute this in advance and then only use it conditionally later.
| convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), | ||
| SWT.DEFAULT).applyTo(messageLabel); | ||
| .indent(5, 0) | ||
| .hint(message.length() > 40 ? minWidthHint : SWT.DEFAULT, SWT.DEFAULT) |
There was a problem hiding this comment.
The number 40 is quite magic. I wonder how things like font size and scaling might affect what this number should be?
There was a problem hiding this comment.
I tested the implementation with few different font sizes and found the results to be satisfactory, which is why I proceeded with this approach.
4c05420 to
4045e5d
Compare
|
I asked our inhouse UX-Experts. This is what they say: We would not recommend the centered alignment of dialog content in Eclipse – even for short texts like "Save ‘NAME.filetype‘?" – for several reasons:
|
Thanks for checking ✨ |
|
@SougandhS So are you going to continue with some other ideas here or are you giving up on the idea (and the PR should be closed)? |
I have a small idea.. [ Not sure everyone agrees :) ] |
|
and how does this change look for other dialogs? |
4045e5d to
e8c7042
Compare
Removed unnecessary spacing in the message dialog to improve visual alignment and create a more compact, cleaner layout. Fixes : eclipse-platform#2929
e8c7042 to
21f7226
Compare
|
I don't see a clear benefit with this change. IMO, the desired format is #2934 (comment) and anything else is not worth being pursued. |
I tried modifying |














Removes unwanted space and aligns message content & buttons to center
Before

After
Fixes : #2929