Skip to content

Commit e37e158

Browse files
ghentschkemickaelistria
authored andcommitted
limit minimum composite size to calculated shell size
in case controls return irregular small values to prevent a 2x2 hover window
1 parent f40aa77 commit e37e158

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/CompositeInformationControl.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,12 @@ private Point computeCompositeSize(Function<AbstractInformationControl, Point> c
175175
Supplier<Point> getDefault) {
176176
return controls.values().stream().map(computeSize).reduce(
177177
(size1, size2) -> new Point(Math.max(size1.x, size2.x), size1.y + size2.y + layout.verticalSpacing))
178-
.orElseGet(getDefault);
178+
.map(size -> {
179+
var shellSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
180+
int width = Math.max(size.x, shellSize.x);
181+
int height = Math.max(size.y, shellSize.y);
182+
return new Point(width, height);
183+
}).orElseGet(getDefault);
179184
}
180185

181186
}

0 commit comments

Comments
 (0)