summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Link.java
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2005-08-02 16:59:54 +0000
committerFelipe Heidrich <fheidric>2005-08-02 16:59:54 +0000
commit373d33c0988eacf60e4e6534fc2246189ebc5e44 (patch)
treed8f009066bb9e7e52bdc6b1d91f57028eb3a14c3 /bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Link.java
parentf0991d983291e4cf2498ec9815e84b0ca25631b6 (diff)
downloadeclipse.platform.swt-373d33c0988eacf60e4e6534fc2246189ebc5e44.tar.gz
eclipse.platform.swt-373d33c0988eacf60e4e6534fc2246189ebc5e44.tar.xz
eclipse.platform.swt-373d33c0988eacf60e4e6534fc2246189ebc5e44.zip
99145
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Link.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Link.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Link.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Link.java
index 1b5a08af48..a2fdfc17a6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Link.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Link.java
@@ -35,7 +35,7 @@ import org.eclipse.swt.events.*;
public class Link extends Control {
String text;
TextLayout layout;
- Color linkColor, linkDisabledColor;
+ Color linkColor, disabledColor;
Point [] offsets;
Point selection;
String [] ids;
@@ -149,7 +149,7 @@ void createHandle (int index) {
layout = new TextLayout (display);
linkColor = new Color (display, LINK_FOREGROUND);
- linkDisabledColor = new Color (display, LINK_DISABLED_FOREGROUND);
+ disabledColor = new Color (display, LINK_DISABLED_FOREGROUND);
offsets = new Point [0];
ids = new String [0];
mnemonics = new int [0];
@@ -179,6 +179,7 @@ void drawWidget(int widget, int damage) {
}
GC gc = GC.photon_new (this, data);
//set clipping on the GC?
+ if ((state & DISABLED) != 0) gc.setForeground (disabledColor);
layout.draw (gc, 0, 0, selStart, selEnd, null, null);
if (hasFocus () && focusIndex != -1) {
Rectangle [] rects = getRectangles (focusIndex);
@@ -242,7 +243,7 @@ public String getText () {
void enableWidget (boolean enabled) {
super.enableWidget (enabled);
- TextStyle linkStyle = new TextStyle (null, enabled ? linkColor : linkDisabledColor, null);
+ TextStyle linkStyle = new TextStyle (null, enabled ? linkColor : disabledColor, null);
linkStyle.underline = true;
for (int i = 0; i < offsets.length; i++) {
Point point = offsets [i];
@@ -531,8 +532,8 @@ void releaseWidget () {
layout = null;
if (linkColor != null) linkColor.dispose ();
linkColor = null;
- if (linkDisabledColor != null) linkDisabledColor.dispose ();
- linkDisabledColor = null;
+ if (disabledColor != null) disabledColor.dispose ();
+ disabledColor = null;
offsets = null;
ids = null;
mnemonics = null;
@@ -609,7 +610,7 @@ public void setText (String string) {
focusIndex = offsets.length > 0 ? 0 : -1;
selection.x = selection.y = -1;
boolean enabled = (state & DISABLED) == 0;
- TextStyle linkStyle = new TextStyle (null, enabled ? linkColor : linkDisabledColor, null);
+ TextStyle linkStyle = new TextStyle (null, enabled ? linkColor : disabledColor, null);
linkStyle.underline = true;
for (int i = 0; i < offsets.length; i++) {
Point point = offsets [i];