Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Furnadjiev2016-11-10 12:21:18 +0000
committerGerrit Code Review @ Eclipse.org2016-11-11 11:26:39 +0000
commit98a0e4ce3dc7624ceafa620943596abe142bc6d4 (patch)
treedcec73a5fb81948c00926da5e3efed0b06abfc0b /bundles
parent8caebc22c337a2c4766ccbf1fb742275334f7c94 (diff)
downloadorg.eclipse.rap-98a0e4ce3dc7624ceafa620943596abe142bc6d4.tar.gz
org.eclipse.rap-98a0e4ce3dc7624ceafa620943596abe142bc6d4.tar.xz
org.eclipse.rap-98a0e4ce3dc7624ceafa620943596abe142bc6d4.zip
Make Link padding themeable
430607: [theming] [Label] [Link] missing padding property https://bugs.eclipse.org/bugs/show_bug.cgi?id=430607 Change-Id: I5ad65560fa5e48d66335643eb21d85b8e91a31a4
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.rap.rwt/resources/resource/theme/default.css1
-rw-r--r--bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Link.java12
-rw-r--r--bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/linkkit/Link.appearances.js6
-rw-r--r--bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/linkkit/Link.default.css3
-rw-r--r--bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/linkkit/Link.theme.xml5
5 files changed, 15 insertions, 12 deletions
diff --git a/bundles/org.eclipse.rap.rwt/resources/resource/theme/default.css b/bundles/org.eclipse.rap.rwt/resources/resource/theme/default.css
index 53ddde97da..4c869de57c 100644
--- a/bundles/org.eclipse.rap.rwt/resources/resource/theme/default.css
+++ b/bundles/org.eclipse.rap.rwt/resources/resource/theme/default.css
@@ -574,6 +574,7 @@ Link {
background-repeat: repeat;
background-position: left top;
text-shadow: none;
+ padding: 2px;
}
Link[BORDER] {
diff --git a/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Link.java b/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Link.java
index 7433ccb227..10729fc043 100644
--- a/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Link.java
+++ b/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Link.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2015 Innoopract Informationssysteme GmbH and others.
+ * Copyright (c) 2002, 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
@@ -42,9 +42,6 @@ import org.eclipse.swt.internal.widgets.linkkit.LinkLCA;
*/
public class Link extends Control {
- // Must be kept in sync with appearance value in AppearancesBase.js
- private final static int PADDING = 2;
-
private String text;
private String displayText;
private Point[] offsets;
@@ -208,7 +205,6 @@ public class Link extends Control {
checkWidget();
int width = 0;
int height = 0;
- BoxDimensions border = getBorder();
if( ( displayText.length() > 0 ) ) {
// Replace '&' with '&&' to ensure proper size calculation with one '&',
// because the other will be escaped in
@@ -224,8 +220,10 @@ public class Link extends Control {
if( hHint != SWT.DEFAULT ) {
height = hHint;
}
- width += border.left + border.right + PADDING * 2;
- height += border.top + border.bottom + PADDING * 2;
+ BoxDimensions border = getBorder();
+ BoxDimensions padding = getPadding();
+ width += border.left + border.right + padding.left + padding.right;
+ height += border.top + border.bottom + padding.top + padding.bottom;
return new Point( width, height );
}
diff --git a/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/linkkit/Link.appearances.js b/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/linkkit/Link.appearances.js
index f8bf376996..7304316ef4 100644
--- a/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/linkkit/Link.appearances.js
+++ b/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/linkkit/Link.appearances.js
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2014 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
@@ -17,8 +17,8 @@ var appearances = {
style : function( states ) {
var tv = new rwt.theme.ThemeValues( states );
return {
- cursor: "default",
- padding : 2,
+ cursor : "default",
+ padding : tv.getCssBoxDimensions( "Link", "padding" ),
font : tv.getCssFont( "Link", "font" ),
border : tv.getCssBorder( "Link", "border" ),
textColor : tv.getCssColor( "Link", "color" ),
diff --git a/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/linkkit/Link.default.css b/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/linkkit/Link.default.css
index 40f2e29c3a..ea488418d9 100644
--- a/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/linkkit/Link.default.css
+++ b/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/linkkit/Link.default.css
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 Innoopract Informationssysteme GmbH and others.
+ * Copyright (c) 2008, 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
@@ -20,6 +20,7 @@ Link {
background-repeat: repeat;
background-position: left top;
text-shadow: none;
+ padding: 2px;
}
Link[BORDER] {
diff --git a/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/linkkit/Link.theme.xml b/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/linkkit/Link.theme.xml
index 6756b3f454..b33bc98915 100644
--- a/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/linkkit/Link.theme.xml
+++ b/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/linkkit/Link.theme.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
- Copyright (c) 2008, 2014 Innoopract Informationssysteme GmbH and others.
+ Copyright (c) 2008, 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
@@ -37,6 +37,9 @@
<property name="text-shadow"
description="Shadow for text." />
+ <property name="padding"
+ description="Padding (inner distance) for links." />
+
<property name="color"
description="Text color for links." />

Back to the top