Bug 181592 - [Widgets] Need a color constant for active and inactive hyperlink colors
Summary: [Widgets] Need a color constant for active and inactive hyperlink colors
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.3   Edit
Hardware: PC All
: P3 normal with 2 votes (vote)
Target Milestone: 4.2.2+   Edit
Assignee: Silenio Quarti CLA
QA Contact: Felipe Heidrich CLA
URL:
Whiteboard:
Keywords: accessibility
: 130444 (view as bug list)
Depends on:
Blocks: 163335 194098 297527 313396
  Show dependency tree
 
Reported: 2007-04-09 09:34 EDT by Tod Creasey CLA
Modified: 2013-09-07 12:44 EDT (History)
12 users (show)

See Also:
john.arthorne: pmc_approved+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tod Creasey CLA 2007-04-09 09:34:01 EDT
3.3 M6

There is currently no way to get at the active and inactive hyperlink colors used by the Link widget.

JFace has the concept of inactive and active hyperlink colours which were added before the Link widget was created. We would like to remove these entries from the theme and deprecate the methods in favour of an SWT solution that matched the Link widget.
Comment 1 Steve Northover CLA 2007-04-09 14:17:29 EDT
On Windows, there is no concept of active and inactive for the native link control.  We can return COLOR_HOTLIGHT (the color for a hyperlink or hot-tracked item).  Need to investigate the other platforms.

Fixing this would require new API for 3.3.
Comment 2 Steve Northover CLA 2007-05-09 15:43:07 EDT
We should not do this for 3.3.  There isn't obvious operating system support for both states (on Windows for sure).  There might be a hack we could do to somehow get the values but I'd be afraid of introducing API that we could not implement.
Comment 3 Mik Kersten CLA 2007-06-25 13:02:35 EDT
Mylyn needs this in order to get the nice OS-specific hyperlink color that appears on Preference page Links into other widgets (i.e. Task List active task switcher, bug 194098).  The JFace hyperlink color is way off from the lighter hyperlink color that matches the lighter widget color on Vista.  For now we are using the best lowest-common denominator shade that we could find.
Comment 4 Raji Akella CLA 2008-02-26 14:26:59 EST
Any plans to fix this in 3.4?
Comment 5 Mike Wilson CLA 2008-03-27 14:58:18 EDT
Steve?
Comment 6 Steve Northover CLA 2008-04-03 19:14:51 EDT
We could add API to get a single Link color (but not the color for active and inactive) but we are past the API freeze.  Is one color good enough?
Comment 7 Mike Wilson CLA 2008-04-07 08:44:25 EDT
I'm not sure. So presumably, this would mean that in high contrast mode (see bug 163335) the color that is returned would be visible (which would be better than the current situation), but in either case, we'd still have to compute some variation of that color to use as the inactive color. Yes?

Comment 8 Tod Creasey CLA 2008-04-07 09:00:12 EDT
I think it isn't that easy - I don't think we can ever say that the inactive color is based on the active one. Computing a variant would likely not be helpful for a low vision person as they may not be able to differentiate subtleties like that. I think computed colors are rarely if ever a good option for low vision.

Having said that there is no reason why we couldn't just make active and inactive the same for the reduced palette. The user could change one if they preferred. This is a much better solution than have Eclipse startup with unreadable text as it stands now.

I think Steves solution is a good compromise that we could work with.
Comment 9 Felipe Heidrich CLA 2008-04-07 15:49:12 EDT
In GTK we can use 
gtk_widget_style_get (GTK_WIDGET(link_button),"link-color", &link_color, NULL);

But that only works if "link-color" is defined in the RC file.
When "link-color" is not defined in the RC file (which is normal case), Gtk uses hardcode color values in GtkLinkButton.c

Gtk also defines "visited-link-color", it doesn't have a "disable-link-color".

One idea is to use to use the same color of disable text for disable/inactive link.
Comment 10 Mike Wilson CLA 2008-04-22 09:28:10 EDT
Is this targetted for 3.4?

Comment 11 Felipe Heidrich CLA 2008-04-22 11:31:54 EDT
(In reply to comment #10)
> Is this targetted for 3.4?
I don't think so.
We tried, but GTK and Carbon don't offered API for this.
Comment 12 Tod Creasey CLA 2008-04-29 14:36:30 EDT
Given that Windows is the OS most used by people with disabilities would a Windows only solution be an option? We could write our code to check for the platform.
Comment 13 Steve Northover CLA 2008-04-30 11:50:02 EDT
We won't fix this for 3.4.  It requires new API, we are past API freeze and there is still some question where we would get these colors from.
Comment 14 Dani Megert CLA 2008-11-17 10:51:19 EST
Any plans to fix this for M4?
Comment 15 Dani Megert CLA 2008-11-18 07:19:24 EST
>Any plans to fix this for M4?
No longer a must have for me at this time (see comment in bug 83408).
Comment 16 Felipe Heidrich CLA 2009-08-21 15:27:00 EDT
Your bug has been moved to triage, visit http://www.eclipse.org/swt/triage.php for more info.
Comment 17 Konstantin Komissarchik CLA 2010-09-07 17:04:40 EDT
Any plans to fix this for 3.7? The inconsistency between parts of Eclipse using SWT's Link widget (light blue on Windows 7) and other parts using Hyperlink and FormText (dark blue) has been flagged during a UI review.
Comment 18 Felipe Heidrich CLA 2010-09-09 15:34:04 EDT
(In reply to comment #17)
> Any plans to fix this for 3.7? 
Probably not, see comment 11
Comment 19 Konstantin Komissarchik CLA 2010-09-09 16:00:39 EDT
Isn't that a common theme in SWT? Some UI toolkit offer more capabilities than others, but you don't cater to the lowest common denominator. The API is either backed by native capabilities if available or simulated if not available.
Comment 20 Silenio Quarti CLA 2013-02-11 16:00:48 EST
We have added SWT.COLOR_LINK_FOREGROUND and implemented on all platforms (cocoa, win32 and gtk). Code has been release to master (4.3 branch).

Note that no platform has the concept of two colors for links (active and inactive). So only one color has been added.

There is still work to be done in Jface to start using this color.


http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=7c92d5ff0643958336782e2069edc7bbe8f71d49

http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=40f0666725aa9b62387fe88a595b4779150ca9e9

http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=6d3d38cb0da75c6fb82119f8ae008e1e6eae0d4f
Comment 21 Dani Megert CLA 2013-02-12 08:35:54 EST
Thanks!

I verified on Windows 7 that the color is the same as the one used for links in StyledText, IE and Windows dialogs (0, 102, 204).
Comment 22 Markus Keller CLA 2013-02-13 08:07:10 EST
Fixed @since tag as told by API tooling:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=114654733d23d3bfdbf0907418ef59037365ff3d
Comment 23 Carolyn MacLeod CLA 2013-03-05 11:48:06 EST
Marking as 4.2.2+ as part of flagged accessibility work. John A, need PMC approval for new API to be backported...
Comment 24 Carolyn MacLeod CLA 2013-03-21 16:53:37 EDT
All changes have been backported to 4.2.2+.
The @since needed to be 3.100.
Comment 25 Dani Megert CLA 2013-03-22 05:35:17 EDT
(In reply to comment #24)
> All changes have been backported to 4.2.2+.
> The @since needed to be 3.100.

No, that is wrong. When you backport an API to a + branch, then you should use the original version and add an API filter.
Comment 26 Paul Webster CLA 2013-03-22 07:08:49 EDT
If SWT in 4.2.2 is 3.100.2 and in 4.3 it is 3.102.0, what should it be in 4.2.2+?  3.100.3 with an API filter?

PW
Comment 27 Dani Megert CLA 2013-03-22 07:48:33 EDT
(In reply to comment #26)
> If SWT in 4.2.2 is 3.100.2 and in 4.3 it is 3.102.0, what should it be in
> 4.2.2+?  3.100.3 with an API filter?
> 
> PW

My comment was regarding the since tag only, where one should just copy/backport the code together with the same tags.

Now to the bundle version: Unfortunately, SWT forgot to update it for 4.2.2 and it is still 3.100.1 as in 4.2.1. Therefore, we can now use 3.100.2 for 4.2.2+. And for those who wonder why it is 3.102.0 in 4.3, see bug 401797.

The version in the pom.xml also needs to become 3.100.2.
Comment 29 Carolyn MacLeod CLA 2013-03-22 15:28:19 EDT
The 4.2.2+ code changes (forgot to list them in comment 24) were:
Win32:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=R4_2_maintenance&id=02c17f1c8d4074b0e087c0d57dfc9c89349ca556

Cocoa:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=R4_2_maintenance&id=dd8fe47b118a07ff4c152abde91668af6402b14b

GTK:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=R4_2_maintenance&id=eccb7e5f60fc58262d44b4aa3c5e8db2db1b2d08

Fixed @since in master (changed to 3.102 to match comment 28 bundle changes).

Fixed @since and added API filters in 4.2.2+:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=R4_2_maintenance&id=10ea7fc04dbbd7b17fe87ea708ebab916928535b
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=R4_2_maintenance&id=e083d14927cb0e072ee3b3a03078b7b525de8686

Backported code and fixed @since and API filters in 3.8.2+:
Win32:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=R3_8_maintenance&id=b2af863631ea604a1b66c934012588a42a887494

Fixed @since and filters:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=R3_8_maintenance&id=fe0d79b8ef1cf2840c6a674133367c6daf932a14
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=R3_8_maintenance&id=b55403b0a42ca5a7d4b33ebef7a385841f8466de

Cocoa:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=R3_8_maintenance&id=7dcdc397b40cfcf0534058d5dff81a8c594ddcec

Gtk:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=R3_8_maintenance&id=55d5d306b797562168d170020df67157cb631400
Comment 30 Markus Keller CLA 2013-09-07 12:44:51 EDT
*** Bug 130444 has been marked as a duplicate of this bug. ***