Skip to content

Commit 618f7e9

Browse files
authored
Merge pull request #6015 from microsoft/fix-notification-layout
fix the layout of popup notification in eclipse
2 parents 1f3a707 + 3fca65d commit 618f7e9

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.core/src/com/microsoft/azure/toolkit/eclipse/common/component/AzureTextInput.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public AzureTextInput(Composite parent, int style) {
2929
}
3030

3131
public AzureTextInput(Composite parent) {
32-
this(parent, SWT.NONE);
32+
this(parent, SWT.BORDER);
3333
}
3434

3535
@Override

PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.core/src/com/microsoft/azure/toolkit/eclipse/common/messager/EclipseMessageNotification.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,15 @@ public void createContentArea(Composite parent) {
3838
container.setLayout(new GridLayout(1, false));
3939
final Rectangle clientArea = parent.getShell().getDisplay().getClientArea();
4040
Browser browser = new Browser(container, SWT.NO_SCROLL);
41+
browser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
4142
browser.setText(this.getMessage().getContent());
4243
browser.setBackgroundMode(SWT.INHERIT_FORCE);
43-
browser.setSize(clientArea.width / 9, clientArea.height / 10);
44-
browser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
45-
46-
Arrays.stream(this.getMessage().getActions()).forEach(a -> this.addActionButton(a, container));
44+
int height = clientArea.height / 15;
45+
browser.setSize((int) (height * 3.5), height);
46+
Composite buttonBar = new Composite(container, SWT.NONE);
47+
buttonBar.setLayoutData(new GridData(SWT.RIGHT, SWT.BOTTOM, false, false, 1, 1));
48+
buttonBar.setLayout(new GridLayout(2, false));
49+
Arrays.stream(this.getMessage().getActions()).forEach(a -> this.addActionButton(a, buttonBar));
4750
}
4851

4952
@Override

PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.core/src/com/microsoft/azure/toolkit/eclipse/common/messager/EclipseMessageView.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
public interface EclipseMessageView {
2323

2424
default void addActionButton(Action<?> action, Composite container) {
25-
final Button btn = new Button(container, SWT.PUSH);
25+
final Button btn = new Button(container, SWT.NONE);
26+
btn.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
2627
final String title = Optional.ofNullable(action.view(null)).map(IView.Label::getLabel).orElse(action.toString());
2728
btn.setText(title);
2829
btn.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));

0 commit comments

Comments
 (0)