Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchris.poon2015-09-03 21:23:57 -0400
committerGerrit Code Review @ Eclipse.org2015-09-04 14:50:42 -0400
commitec7145b34a4871436b7433acf5b0bbd56066caa9 (patch)
tree7ffe4e9e65f1fa2c59ab63a1799a097de0a12ed8 /org.eclipse.mylyn.reviews.ui/src
parent7f5fcc36fb950a46f02656b719ef199ee50c9836 (diff)
downloadorg.eclipse.mylyn.reviews-ec7145b34a4871436b7433acf5b0bbd56066caa9.tar.gz
org.eclipse.mylyn.reviews-ec7145b34a4871436b7433acf5b0bbd56066caa9.tar.xz
org.eclipse.mylyn.reviews-ec7145b34a4871436b7433acf5b0bbd56066caa9.zip
476588: on a small screen, the comment navigation buttons open the
comment popup with a scrollbar Change-Id: Ifa2d3f00239b52b69247a5ea569f5b9192905356 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=476588 Signed-off-by: chris.poon <chris.poon@tasktop.com>
Diffstat (limited to 'org.eclipse.mylyn.reviews.ui/src')
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/CommentPopupDialog.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/CommentPopupDialog.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/CommentPopupDialog.java
index f3194097..d6332f9b 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/CommentPopupDialog.java
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/CommentPopupDialog.java
@@ -283,6 +283,10 @@ public class CommentPopupDialog extends PopupDialog implements IReviewActionList
return getShell().getBounds();
}
+ public Rectangle getMonitorArea() {
+ return getShell().getMonitor().getClientArea();
+ }
+
public Rectangle computeTrim() {
return getShell().computeTrim(0, 0, 0, 0);
}
@@ -299,7 +303,7 @@ public class CommentPopupDialog extends PopupDialog implements IReviewActionList
*/
public void setLocation(Point location) {
Rectangle bounds = getShell().getBounds();
- Rectangle monitorBounds = getShell().getMonitor().getClientArea();
+ Rectangle monitorBounds = getMonitorArea();
// ensure the popup fits on the shell's monitor
bounds.x = constrain(location.x, monitorBounds.x, monitorBounds.x + monitorBounds.width - bounds.width);
bounds.y = constrain(location.y, monitorBounds.y, monitorBounds.y + monitorBounds.height - bounds.height);
@@ -319,7 +323,7 @@ public class CommentPopupDialog extends PopupDialog implements IReviewActionList
Point size = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
scrolledComposite.setMinSize(size);
- int height = constrain(size.y, MIN_HEIGHT, getShell().getMonitor().getClientArea().height);
+ int height = constrain(size.y, MIN_HEIGHT, getMonitorArea().height);
getShell().setSize(size.x, height);
scrolledComposite.setSize(size.x, height);
setLocation(new Point(bounds.x, bounds.y));
@@ -340,7 +344,7 @@ public class CommentPopupDialog extends PopupDialog implements IReviewActionList
}
public void setHeightBasedOnMouse(int mouseY) {
- int mouseYFromBottom = getShell().getMonitor().getClientArea().height - mouseY;
+ int mouseYFromBottom = getMonitorArea().height + getMonitorArea().y - mouseY; // Coordinates are based on the primary monitor
recomputeSize();
setSize(MAX_WIDTH, constrain(mouseYFromBottom - ICON_BUFFER, MIN_HEIGHT, getShell().getSize().y));
}

Back to the top