Skip to content

Commit

Permalink
Find/replace overlay: replace shell with integrated composite eclipse…
Browse files Browse the repository at this point in the history
…-platform#2099

The FindReplaceOverlay is currently realized as a separate shell (more
precisely, a JFace Dialog), which is placed at a proper position on top
of the workbench shell. This has some drawback:
- It has to manually adapt to movements of the parent shell or the
target part/widget
- It has to manually hide and show depending on visibility changes of
the target part/widget
- It does not follow events of the target immediately, i.e., movements
are always some milliseconds behind, minimize/maximize
operations/animations are not synchronous etc.
- It does not locate properly when the platform uses Wayland, as manual
shell positioning is not possible there

This change replaces the dialog-based implementation of the
FindReplaceOverlay with an in-place composite-based implementation. A
composite is created in the target widget and placed relative to this
composite. In consequence, the overlay automatically follows all move,
resize, hide/show operations of the target widget.

Fixes eclipse-platform/eclipse.platform.swt#1447

Fixes eclipse-platform#2099
  • Loading branch information
HeikoKlare committed Oct 3, 2024
1 parent 71dc338 commit 7632f14
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.swt.widgets.Widget;

import org.eclipse.core.runtime.Platform.OS;
import org.eclipse.core.runtime.Status;

import org.eclipse.jface.bindings.keys.KeyStroke;
Expand Down Expand Up @@ -341,9 +340,6 @@ private void retrieveBackgroundColor() {
}

private Color retrieveDefaultCompositeBackground() {
if (OS.isLinux()) {
return widgetBackgroundColor;
}
AtomicReference<Color> colorReference = new AtomicReference<>();
Dialog dummyDialogForColorRetrieval = new Dialog(targetControl.getShell()) {
@Override
Expand Down

0 comments on commit 7632f14

Please sign in to comment.