-
Notifications
You must be signed in to change notification settings - Fork 209
Redesign Message Dialog #2934
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
base: master
Are you sure you want to change the base?
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think changing the horizontalSpan is a bad idea. I'm not even sure why it's needed.
@@ -328,7 +328,6 @@ protected Control createDialogArea(Composite parent) { | |||
layout.marginWidth = 0; | |||
composite.setLayout(layout); | |||
GridData data = new GridData(GridData.FILL_BOTH); | |||
data.horizontalSpan = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -100,13 +100,14 @@ protected Control createMessageArea(Composite composite) { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's odd to compute this in advance and then only use it conditionally later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed now
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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