diff options
author | Michael Keppler | 2018-08-13 11:14:23 +0000 |
---|---|---|
committer | Michael Keppler | 2018-08-13 11:29:09 +0000 |
commit | 686ab086206683c574518cefc90ab2167c03d762 (patch) | |
tree | c1bd297cef3e0d042dfcb971465b0c7cb55e9be2 | |
parent | 4de5582eae451488e45c60f05c0c3dceaf7b1818 (diff) | |
download | eclipse.platform.ua-686ab086206683c574518cefc90ab2167c03d762.tar.gz eclipse.platform.ua-686ab086206683c574518cefc90ab2167c03d762.tar.xz eclipse.platform.ua-686ab086206683c574518cefc90ab2167c03d762.zip |
Bug 537898 - [Tips] Draw circles for single digit bubblesY20180815-2200I20180816-2000I20180815-2000I20180815-1250I20180814-2000I20180814-0910I20180814-0900I20180813-2000
Change the drawing code slightly such that single digit bubbles create a
real circle, and not a "near circle" ellipsis.
See screenshot in bugzilla for the visual difference.
Change-Id: Iced0906e4a1d462feea99a0a62c4ca91a12da4c5
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
-rw-r--r-- | org.eclipse.tips.ui/src/org/eclipse/tips/ui/internal/Slider.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/org.eclipse.tips.ui/src/org/eclipse/tips/ui/internal/Slider.java b/org.eclipse.tips.ui/src/org/eclipse/tips/ui/internal/Slider.java index d6b605eb5..8f8be216d 100644 --- a/org.eclipse.tips.ui/src/org/eclipse/tips/ui/internal/Slider.java +++ b/org.eclipse.tips.ui/src/org/eclipse/tips/ui/internal/Slider.java @@ -407,10 +407,11 @@ public class Slider extends Composite { Point textExtent = getTipCountTextSize(providerButton, tipCount); Image image = null; + int imageHeight = textExtent.y + 5; if (tipCount > 9) { - image = new Image(getDisplay(), textExtent.x + 8, textExtent.y + 5); + image = new Image(getDisplay(), textExtent.x + 8, imageHeight); } else { - image = new Image(getDisplay(), textExtent.x + 15, textExtent.y + 5); + image = new Image(getDisplay(), imageHeight, imageHeight); } ImageData data = image.getImageData(); data.transparentPixel = data.getPixel(0, 0); @@ -428,11 +429,11 @@ public class Slider extends Composite { gc.setAlpha(200); gc.setTextAntialias(SWT.ON); if (tipCount > 9) { - gc.fillOval(0, 0, textExtent.x + 8, textExtent.y + 5); + gc.fillOval(0, 0, textExtent.x + 8, imageHeight); gc.drawText(tipCount + "", 4, 2, true); //$NON-NLS-1$ } else { - gc.fillOval(0, 0, textExtent.x + 15, textExtent.y + 5); - gc.drawText(tipCount + "", 8, 2, true); //$NON-NLS-1$ + gc.fillOval(0, 0, imageHeight, imageHeight); + gc.drawText(tipCount + "", (imageHeight - textExtent.x + 1) / 2, 2, true); //$NON-NLS-1$ } Image result = ResourceManager.decorateImage(getProviderImage(provider, selectProviderImage(provider)), image, SWTResourceManager.TOP_RIGHT); |