Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.ToolBar;


Expand Down Expand Up @@ -71,6 +72,7 @@ public ImageBasedFrame(Composite parent, Control toWrap, boolean vertical,
});

toWrap.addListener(SWT.ZoomChanged, event -> {
Shell shell = parent.getShell();
final AtomicReference<Listener> scaleOnParentResize = new AtomicReference<>();
scaleOnParentResize.set(e -> {
if (isDisposed()) {
Expand All @@ -79,9 +81,9 @@ public ImageBasedFrame(Composite parent, Control toWrap, boolean vertical,
toWrap.pack(true);
setFramedControlLocation();
parent.layout();
parent.removeListener(SWT.Resize, scaleOnParentResize.get());
shell.removeListener(SWT.Resize, scaleOnParentResize.get());
});
parent.addListener(SWT.Resize, scaleOnParentResize.get());
shell.addListener(SWT.Resize, scaleOnParentResize.get());
});

addMouseMoveListener(e -> {
Expand Down
Loading