Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Furnadjiev2016-02-08 04:55:27 -0500
committerGerrit Code Review @ Eclipse.org2016-02-10 04:02:58 -0500
commita356ccc0c0e999ed560e19e69b9bf71f802881d1 (patch)
treede5524ecf87416a38bcb74fc74cfaa673adfdd24 /bundles
parent78a666232e4dbafbccdd9bc84baea9c2fb8e0f7a (diff)
downloadorg.eclipse.rap-a356ccc0c0e999ed560e19e69b9bf71f802881d1.tar.gz
org.eclipse.rap-a356ccc0c0e999ed560e19e69b9bf71f802881d1.tar.xz
org.eclipse.rap-a356ccc0c0e999ed560e19e69b9bf71f802881d1.zip
Fix layout calculation when font is changed on disabled Label
Label layout depends on its font. If font on disabled Label is different (set by the themeing) than the regular one, the layout code should respect the new font. Add missing "disabled" state to Control widget matcher in ControlThemeAdapterImpl. Note: Now all common themeable control properties (font, padding, foreground and background) will respect the disabled state. For forground property it's now different from SWT, where even though the disabled label is grayed out, getForeground() shows the original color. 487364: Font-change in css based on widget-state is not considered when relayouting https://bugs.eclipse.org/bugs/show_bug.cgi?id=487364 Change-Id: I90347c4fbfa787090b63be2cd0288ea885b7b636
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/theme/ThemeUtil.java12
-rw-r--r--bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/controlkit/ControlThemeAdapterImpl.java10
2 files changed, 15 insertions, 7 deletions
diff --git a/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/theme/ThemeUtil.java b/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/theme/ThemeUtil.java
index b5c0465b51..1cc9933cc1 100644
--- a/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/theme/ThemeUtil.java
+++ b/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/theme/ThemeUtil.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2015 Innoopract Informationssysteme GmbH and others.
+ * Copyright (c) 2007, 2016 Innoopract Informationssysteme GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -123,16 +123,16 @@ public final class ThemeUtil {
// Methods for accessing themed values
public static CssValue getCssValue( String cssElement,
- String cssProperty,
- SimpleSelector selector )
+ String cssProperty,
+ SimpleSelector selector )
{
return getCssValue( cssElement, cssProperty, selector, null );
}
public static CssValue getCssValue( String cssElement,
- String cssProperty,
- ValueSelector selector,
- Widget widget )
+ String cssProperty,
+ ValueSelector selector,
+ Widget widget )
{
return getCssValue( getCurrentThemeId(), cssElement, cssProperty, selector, widget );
}
diff --git a/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/controlkit/ControlThemeAdapterImpl.java b/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/controlkit/ControlThemeAdapterImpl.java
index 0bdbf4a955..49b0f606b3 100644
--- a/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/controlkit/ControlThemeAdapterImpl.java
+++ b/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/controlkit/ControlThemeAdapterImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2015 Innoopract Informationssysteme GmbH and others.
+ * Copyright (c) 2007, 2016 Innoopract Informationssysteme GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,12 +13,14 @@ package org.eclipse.swt.internal.widgets.controlkit;
import org.eclipse.rap.rwt.internal.theme.ThemeAdapter;
import org.eclipse.rap.rwt.internal.theme.WidgetMatcher;
+import org.eclipse.rap.rwt.internal.theme.WidgetMatcher.Constraint;
import org.eclipse.rap.rwt.theme.BoxDimensions;
import org.eclipse.rap.rwt.theme.ControlThemeAdapter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Widget;
public class ControlThemeAdapterImpl extends ThemeAdapter implements ControlThemeAdapter {
@@ -26,6 +28,12 @@ public class ControlThemeAdapterImpl extends ThemeAdapter implements ControlThem
@Override
protected void configureMatcher( WidgetMatcher matcher ) {
matcher.addStyle( "BORDER", SWT.BORDER );
+ matcher.addState( "disabled", new Constraint() {
+ @Override
+ public boolean matches( Widget widget ) {
+ return !( ( Control )widget ).getEnabled();
+ }
+ });
}
@Override

Back to the top