Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeronika Irvine2005-01-26 20:41:27 +0000
committerVeronika Irvine2005-01-26 20:41:27 +0000
commit617caa16607996fc0c177bb61875b51fc5b46c90 (patch)
tree6d9d909495c85360f15daf4acb11a90188de46a6
parent45ead7e02d1b860c56546f26ef3ba779e562e49e (diff)
downloadeclipse.platform.swt-617caa16607996fc0c177bb61875b51fc5b46c90.tar.gz
eclipse.platform.swt-617caa16607996fc0c177bb61875b51fc5b46c90.tar.xz
eclipse.platform.swt-617caa16607996fc0c177bb61875b51fc5b46c90.zip
bug 82346 SWT.CENTER conflicts with SWT.EMBEDDED
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java
index 2fc020bee9..75de1a136a 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java
@@ -102,7 +102,7 @@ public class CLabel extends Canvas {
*/
public CLabel(Composite parent, int style) {
super(parent, checkStyle(style));
-
+ if ((style & (SWT.CENTER | SWT.RIGHT)) == 0) style |= SWT.LEFT;
if ((style & SWT.CENTER) != 0) align = SWT.CENTER;
if ((style & SWT.RIGHT) != 0) align = SWT.RIGHT;
if ((style & SWT.LEFT) != 0) align = SWT.LEFT;
@@ -135,10 +135,9 @@ public CLabel(Composite parent, int style) {
*/
private static int checkStyle (int style) {
if ((style & SWT.BORDER) != 0) style |= SWT.SHADOW_IN;
- int mask = SWT.SHADOW_IN | SWT.SHADOW_OUT | SWT.SHADOW_NONE | SWT.LEFT | SWT.RIGHT | SWT.CENTER | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+ int mask = SWT.SHADOW_IN | SWT.SHADOW_OUT | SWT.SHADOW_NONE | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
style = style & mask;
style |= SWT.NO_FOCUS;
- if ((style & (SWT.CENTER | SWT.RIGHT)) == 0) style |= SWT.LEFT;
//TEMPORARY CODE
/*
* The default background on carbon and some GTK themes is not a solid color
@@ -247,7 +246,6 @@ private Point getTotalSize(Image image, String text) {
}
public int getStyle () {
int style = super.getStyle();
- style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER);
switch (align) {
case SWT.RIGHT: style |= SWT.RIGHT; break;
case SWT.CENTER: style |= SWT.CENTER; break;

Back to the top