Skip to content

Commit

Permalink
Properly resize Launch configuration controls (#131)
Browse files Browse the repository at this point in the history
* properly resize Launch configuration controls

The text widget in both run and debug configurations follow
the sashing only partially - at some point, the filter text
overlays into the neighboring areas. this is because of the
conflicting layoutdata property defined for the text and the
label controls in the parent composite. if grabExcessHorizontalSpace
property is set to true for one and false for another child controls,
the layout gets convoluted, or follow only one of the request.

Fix is to force the same flag in both the cases leading to properly
laying out the children widgets in the composite.

Fixes: #130

* Fix up: Addressed review changes

* Fix up: Addressed changes are fixed.
  • Loading branch information
elsazac authored May 9, 2023
1 parent 43137c9 commit bfb5504
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,28 @@ public static Label createLabel(Composite parent, String text, Font font, int hs
return l;
}

/**
* Creates a new label widget
*
* @param parent the parent composite to add this label widget to
* @param text the text for the label
* @param hspan the horizontal span to take up in the parent composite
* @param grabHSpace specifies whether the width of the label changes depending
* on the size of the parent Composite
* @return the new label
* @since 3.18
*/
public static Label createLabel(Composite parent, String text, int hspan, boolean grabHSpace) {
Label l = new Label(parent, SWT.NONE);
l.setFont(parent.getFont());
l.setText(text);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = hspan;
gd.grabExcessHorizontalSpace = grabHSpace;
l.setLayoutData(gd);
return l;
}

/**
* Creates a wrapping label
* @param parent the parent composite to add this label to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ public void keyPressed(KeyEvent e) {
if (getViewer() instanceof StructuredViewer) {
((StructuredViewer)getViewer()).addDoubleClickListener(this);
}
fFilteredNotice = SWTFactory.createLabel(parent, IInternalDebugCoreConstants.EMPTY_STRING, 1);
fFilteredNotice = SWTFactory.createLabel(parent, IInternalDebugCoreConstants.EMPTY_STRING, 1, true);
fFilteredNotice.setBackground(parent.getBackground());
}

Expand Down

0 comments on commit bfb5504

Please sign in to comment.