diff options
| author | Ed Merks | 2019-11-04 08:24:06 +0000 |
|---|---|---|
| committer | Ed Merks | 2019-11-04 08:24:06 +0000 |
| commit | b2af65709af068ac2bbdf363838ccb1587e9985a (patch) | |
| tree | 2e553a23692cd7f7acbac6a019eb0e5146da6b93 | |
| parent | bd2be37721b722004819bf709d7469081247106e (diff) | |
| download | org.eclipse.oomph-b2af65709af068ac2bbdf363838ccb1587e9985a.tar.gz org.eclipse.oomph-b2af65709af068ac2bbdf363838ccb1587e9985a.tar.xz org.eclipse.oomph-b2af65709af068ac2bbdf363838ccb1587e9985a.zip | |
[552649] The resize hot zone is painfully small for the simple installer
https://bugs.eclipse.org/bugs/show_bug.cgi?id=552649
2 files changed, 49 insertions, 1 deletions
diff --git a/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/AbstractSimpleDialog.java b/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/AbstractSimpleDialog.java index a89aaa11c..6c85ae454 100644 --- a/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/AbstractSimpleDialog.java +++ b/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/AbstractSimpleDialog.java @@ -27,6 +27,7 @@ import org.eclipse.swt.events.TraverseEvent; import org.eclipse.swt.events.TraverseListener; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; @@ -145,6 +146,44 @@ public abstract class AbstractSimpleDialog extends Shell { return super.shouldHookControl(control) || control instanceof SimpleInstallerPage; } + + protected Point getMainPoint(Control control, int x, int y) + { + if (control != AbstractSimpleDialog.this) + { + Point mainPoint = AbstractSimpleDialog.this.toControl(control.toDisplay(x, y)); + return mainPoint; + } + + return new Point(x, y); + } + + @Override + protected Point getStart(Control control, int x, int y) + { + return getMainPoint(control, x, y); + } + + @Override + protected void beforeStart(Control control, int x, int y) + { + Point mainPoint = getMainPoint(control, x, y); + super.beforeStart(AbstractSimpleDialog.this, mainPoint.x, mainPoint.y); + } + + @Override + protected void afterStart(Control control, Point start, int x, int y) + { + Point mainPoint = getMainPoint(control, x, y); + super.afterStart(AbstractSimpleDialog.this, start, mainPoint.x, mainPoint.y); + } + + @Override + protected void afterEnd(Control control, Point start, int x, int y) + { + Point mainPoint = getMainPoint(control, x, y); + super.afterEnd(AbstractSimpleDialog.this, start, mainPoint.x, mainPoint.y); + } }; open(); diff --git a/plugins/org.eclipse.oomph.ui/src/org/eclipse/oomph/ui/MouseHandler.java b/plugins/org.eclipse.oomph.ui/src/org/eclipse/oomph/ui/MouseHandler.java index 9ce9b7091..8b17c43db 100644 --- a/plugins/org.eclipse.oomph.ui/src/org/eclipse/oomph/ui/MouseHandler.java +++ b/plugins/org.eclipse.oomph.ui/src/org/eclipse/oomph/ui/MouseHandler.java @@ -68,7 +68,11 @@ public abstract class MouseHandler { if (e.button == 1) { - start = new Point(e.x, e.y); + if (e.widget instanceof Control) + { + Control control = (Control)e.widget; + start = getStart(control, e.x, e.y); + } } } @@ -117,6 +121,11 @@ public abstract class MouseHandler return c == Composite.class || c == StackComposite.class || control instanceof Shell || c == Label.class || c == Link.class; } + protected Point getStart(Control control, int x, int y) + { + return new Point(x, y); + } + protected void beforeStart(Control control, int x, int y) { } |
