Skip to content

Commit

Permalink
Find/replace overlay: correct heights and vertical centering eclipse-…
Browse files Browse the repository at this point in the history
…platform#1997 eclipse-platform#2092

This adapts the defined margins in the FindReplaceOverlay, such that
1. there is no vertical cutoff of the buttons
2. the search and replace input boxes are vertically centered

Fixes eclipse-platform#1997
Fixes eclipse-platform#2092
  • Loading branch information
HeikoKlare committed Jul 17, 2024
1 parent 7695ac0 commit 68d0be3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AccessibleToolBar extends Composite {

public AccessibleToolBar(Composite parent) {
super(parent, SWT.NONE);
this.layout = GridLayoutFactory.fillDefaults().numColumns(0).spacing(0, 0).margins(0, 0).create();
this.layout = GridLayoutFactory.fillDefaults().numColumns(0).spacing(0, 0).margins(1, 1).create();
this.setLayout(layout);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ private void createSearchBar() {
HistoryStore searchHistory = new HistoryStore(getDialogSettings(), "searchhistory", //$NON-NLS-1$
HISTORY_SIZE);
searchBar = new HistoryTextWrapper(searchHistory, searchBarContainer, SWT.SINGLE);
GridDataFactory.fillDefaults().grab(true, false).align(GridData.FILL, GridData.END).applyTo(searchBar);
GridDataFactory.fillDefaults().grab(true, true).align(GridData.FILL, GridData.FILL).applyTo(searchBar);
searchBar.forceFocus();
searchBar.selectAll();
searchBar.addModifyListener(e -> {
Expand Down Expand Up @@ -651,18 +651,18 @@ private void createReplaceBar() {
private void createFindContainer() {
searchContainer = new Composite(contentGroup, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, true).align(GridData.FILL, GridData.FILL).applyTo(searchContainer);
GridLayoutFactory.fillDefaults().numColumns(3).extendedMargins(4, 4, 2, 8).equalWidth(false)
GridLayoutFactory.fillDefaults().numColumns(3).extendedMargins(4, 4, 3, 3).equalWidth(false)
.applyTo(searchContainer);
searchContainer.setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));
searchBarContainer = new Composite(searchContainer, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, true).align(GridData.FILL, GridData.END).applyTo(searchBarContainer);
GridDataFactory.fillDefaults().grab(true, true).align(GridData.FILL, GridData.FILL).applyTo(searchBarContainer);
GridLayoutFactory.fillDefaults().numColumns(1).applyTo(searchBarContainer);
}

private void createReplaceContainer() {
replaceContainer = new Composite(contentGroup, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, true).align(GridData.FILL, GridData.FILL).applyTo(replaceContainer);
GridLayoutFactory.fillDefaults().margins(0, 1).numColumns(2).extendedMargins(4, 4, 2, 8).equalWidth(false)
GridLayoutFactory.fillDefaults().margins(0, 1).numColumns(2).extendedMargins(4, 4, 3, 3).equalWidth(false)
.applyTo(replaceContainer);
replaceContainer.setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));
replaceBarContainer = new Composite(replaceContainer, SWT.NONE);
Expand Down

0 comments on commit 68d0be3

Please sign in to comment.