From: Yoonki Park Date: Fri, 19 Aug 2016 10:07:18 +0000 (+0900) Subject: ABOUTPAGE: Fix to show product name on about page dialog for ubuntu X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c9c15b783e4e106f14741a87649e9fa40a5002aa;p=sdk%2Fide%2Feclipse-platform-ui.git ABOUTPAGE: Fix to show product name on about page dialog for ubuntu - In case of ubuntu, text is not shown when using label text. Change-Id: I95209e49163cafc66ac8cd95dab5fb4cfa89cc5b Signed-off-by: Yoonki Park --- diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/AboutDialog.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/AboutDialog.java index c49843f..190931e 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/AboutDialog.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/AboutDialog.java @@ -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(); }}); /* ===== */