Bug 22782 - DCR - Need API to draw disabled text in native platform way
Summary: DCR - Need API to draw disabled text in native platform way
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 enhancement with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 72207 (view as bug list)
Depends on:
Blocks: 73012 117752 4732 4745
  Show dependency tree
 
Reported: 2002-08-23 12:10 EDT by Veronika Irvine CLA
Modified: 2019-09-06 16:06 EDT (History)
10 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Veronika Irvine CLA 2002-08-23 12:10:54 EDT
Need to be able to draw text that looks disabled.  This varies across 
platforms; some draw gray, some draw stippled etc.

Perhaps GC.drawText could support another flag such as DRAW_DISABLED and draw 
the native thing.

On Windows there is a system colour called COLOR_GRAYTEXT and there is also a 
function called GrayString which could be used.  Motif has a similar capability.
Comment 1 Steve Northover CLA 2002-08-23 12:18:42 EDT
I think this is a good idea but it can be low priority.  On Windows, we can use 
COLOR_GRAY text.  GrayString() is strictly correct but really only ever is 
needed on monochrome displays.  GrayString() doesn't do CR/LF etc.

There is a Motif call to do this but it's no an Xm call (it's in the widget 
writer helper library).
Comment 2 Steve Northover CLA 2006-05-09 10:44:28 EDT
*** Bug 72207 has been marked as a duplicate of this bug. ***
Comment 3 Lakshmi P Shanmugam CLA 2009-09-17 08:35:47 EDT
I checked to see if there is system color for disabled text on Carbon, Cocoa and gtk --
Cocoa: we already have OS.disabledControlTextColor 
Carbon: there is kThemeTextColorPopupLabelInactive system Color
gtk: may be we can use the color from the shell using 
OS.gtk_style_get_text (style, OS.GTK_STATE_INSENSITIVE, gdkColor)

Hence, I think we can get the system color for disabled text on these platforms too.
Comment 4 Felipe Heidrich CLA 2009-11-12 10:36:03 EST
I need this for Bug 4745 - [StyledText] StyledText does not provide a disabled look (1GG00JX).

In my case, GC support only is useless (as StyledText uses TextLayout).

New constants for display#getSystemColor() would work better, one for disabled text foreground, and (possibly) one for disabled text background. One problem with this approach is that some plaforms use embossed (3d) text when disabled.
Comment 5 Silenio Quarti CLA 2010-02-08 14:39:52 EST
Both solutions described here have problems:

1) DRAW_DISABLED flag for GC.drawText() would not solve the StyledText case.
2) COLOR_WIDGET_DISABLED_FOREGROUND/COLOR_WIDGET_DISABLED_BACKGROUND does not work for platforms that draw disabled text embossed (GTK, Windows Classic).

I also notice that on Windows Xp, the disable foreground color of the Button widget is different from the disable foreground of the Label widget. This issue affects both solutions above, since they do not take into consideration which type of widget is being drawn.

The theme drawing API (bug#37706) might be the only complete solution for this problem. That API should be able to draw text given the type and state of a widget. I do not think the theme drawing API can be implemented in the 3.6 cycle though.
Comment 6 Dean Roberts CLA 2010-10-18 14:51:52 EDT
I also need this fix for I need this for Bug 4745 - [StyledText] StyledText does not provide a disabled look (1GG00JX).

In my case the issue is particularly apparent since I have side by side text widgets and styled text widgets that get enabled and disabled in unison.  Their proximity highlights how problematic the issue is.
Comment 7 Thomas Schindl CLA 2010-11-25 10:11:55 EST
[...]
> The theme drawing API (bug#37706) might be the only complete solution for this
> problem. That API should be able to draw text given the type and state of a
> widget. I do not think the theme drawing API can be implemented in the 3.6
> cycle though.

Anything planned for 3.7?
Comment 8 Silenio Quarti CLA 2010-11-25 10:17:31 EST
Sorry, the theme drawing API is not plan for 3.7.
Comment 9 Eclipse Webmaster CLA 2019-09-06 16:06:43 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.