ABOUTPAGE: Fix to show product name on about page dialog for ubuntu
authorYoonki Park <yoonki.park@samsung.com>
Fri, 19 Aug 2016 10:07:18 +0000 (19:07 +0900)
committerSangho Park <sangho.p@samsung.com>
Fri, 19 Aug 2016 10:30:10 +0000 (19:30 +0900)
- In case of ubuntu, text is not shown when using label text.

Change-Id: I95209e49163cafc66ac8cd95dab5fb4cfa89cc5b
Signed-off-by: Yoonki Park <yoonki.park@samsung.com>
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/AboutDialog.java

index c49843f..190931e 100644 (file)
@@ -52,10 +52,12 @@ import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.Font;
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.layout.RowLayout;
 import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Canvas;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Label;
@@ -290,7 +292,7 @@ public class AboutDialog extends TrayDialog {
 
         //image on left side of dialog
         if (aboutImage != null) {
-            Label imageLabel = new Label(topContainer, SWT.NONE);
+            final Canvas imageLabel = new Canvas(topContainer, SWT.NONE);
             imageLabel.setBackground(background);
             imageLabel.setForeground(foreground);
 
@@ -301,7 +303,7 @@ public class AboutDialog extends TrayDialog {
             /// Tizen
             data.horizontalSpan = 2;
             imageLabel.setLayoutData(data);
-            imageLabel.setImage(aboutImage);
+            imageLabel.setBackgroundImage(aboutImage);
             /// Tizen
             //topContainerHeightHint = Math.max(topContainerHeightHint, aboutImage.getBounds().height);
             topContainerHeightHint = aboutImage.getBounds().height;
@@ -315,7 +317,8 @@ public class AboutDialog extends TrayDialog {
                     Font font = new Font(event.display, fontName, fontSizeHeight, SWT.BOLD);
                     event.gc.setForeground(event.display.getSystemColor(SWT.COLOR_WHITE));
                     event.gc.setFont(font);
-                    event.gc.drawText(productName, 28, 32, true);
+                    Point textSize = event.gc.textExtent(productName);
+                    event.gc.drawText(productName, 28, (imageLabel.getSize().y - textSize.y) / 2, true);
                     font.dispose();
                 }});
             /* ===== */