Bug 216666 - Text selection should be grayed out when the widget does not have the focus
Summary: Text selection should be grayed out when the widget does not have the focus
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 222880 (view as bug list)
Depends on: 152955
Blocks:
  Show dependency tree
 
Reported: 2008-01-25 23:55 EST by Michael Scharf CLA
Modified: 2019-09-06 16:09 EDT (History)
3 users (show)

See Also:


Attachments
Which of the two editors has the focus???? (19.71 KB, image/gif)
2008-01-25 23:55 EST, Michael Scharf CLA
no flags Details
firefox renders non-focus selectios in gray (3.80 KB, image/gif)
2008-01-25 23:57 EST, Michael Scharf CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Scharf CLA 2008-01-25 23:55:51 EST
Created attachment 87939 [details]
Which of the two editors has the focus????

If a text is selected and the text does not the focus, the text should be grayed out or the selection should not be shown.

- Internet explorer hides the selection when the widget does not have the focus.
- Firefox grays it out.
Comment 1 Michael Scharf CLA 2008-01-25 23:57:04 EST
Created attachment 87940 [details]
firefox renders non-focus selectios in gray
Comment 2 Steve Northover CLA 2008-02-11 16:13:36 EST
We could do something for StyledText but the native text control draws correctly for the platform.

NOTE:  Choosing a color is generally dangerous.  For exmaple, choosing gray will hide the selection when the background is gray or hide the text when the text is gray.
Comment 3 Felipe Heidrich CLA 2008-02-11 17:15:21 EST

*** This bug has been marked as a duplicate of bug 4745 ***
Comment 4 Steve Northover CLA 2008-02-12 12:01:26 EST
Drawing the selection "grayed" is not the same as being disabled.  For example, on Windows, the tree and the table draw the selection "blue" when they have focus, and "gray" when they do not.  This bug is a request for the same sort of behavior for StyledText.
Comment 5 Felipe Heidrich CLA 2008-02-12 13:16:29 EST
StyledText has API to set the selection foreground and background color. The client can call this API during focus out to implemented this behaviour.

Steve, if we implement this behaviour in StyledText we will have to added API to allow the user to customize it.

The best we can do is change StyledText to follow the native platform behaviour, on windows the code is right (remain blue is the right behaviour, test write.exe and notepad.exe).
Comment 6 Michael Scharf CLA 2008-02-12 14:32:45 EST
(In reply to comment #5)
> The best we can do is change StyledText to follow the native platform
> behaviour, on windows the code is right (remain blue is the right behaviour,
> test write.exe and notepad.exe).

Neither write nor notepad have other panes. Outlook for example totally hides the text selection if another pane has the focus. Visual Studio 6 (ok that is really old) shows no selection in the editor if another pane or editor has the focus....

Show me an microsoft application where multiple panes, views, editors (etc) within the same window show a text-focus in "blue"....

Taking a single text-pane is not a good comparison.
Comment 7 Felipe Heidrich CLA 2008-03-18 18:22:40 EDT
*** Bug 222880 has been marked as a duplicate of this bug. ***
Comment 8 Thomas Dybdahl Ahle CLA 2008-03-23 17:35:46 EDT
I think this is a general problem, that the code/text widget doesn't take on desktop colors.
If I choose a gtk theme with black background and white text, the code text is still black - and therefore invisible.
Comment 9 Steve Northover CLA 2008-03-24 13:58:36 EDT
Felipe, the "black on black" bug is not SWT, right?  Is it that Eclipse chooses the wrong colors in this case?
Comment 10 Felipe Heidrich CLA 2008-03-24 18:05:58 EDT
(In reply to comment #9)
> Felipe, the "black on black" bug is not SWT, right?  Is it that Eclipse chooses
> the wrong colors in this case?

Works for me with HighContrastInverse (black background, white foreground).
CustomControlExample, StyledText tab, works fine.
If fails on Eclipse, but that is because the worksbench forces black foreground on the editor.
Comment 11 Steve Northover CLA 2008-03-24 18:18:56 EDT
> If I choose a gtk theme

Confusion.  This bug says XP but Thomas talks about GTK.  In any case, we don't choose the colors, the Eclipse editor does.  Please move the bug over there (after making sure the default colors are good on GTK).
Comment 12 Dani Megert CLA 2008-03-25 03:11:13 EDT
The black on black thing is unrelated to this bug. This bug is about selection fg/bg color when the widget doesn't have focus and which is out of the clients control (there's no API to set this).

Please file a separate bug report against Platform Text with all the details, e.g. what is black and what is invisible (normal text or selection or both) and of course in which editor do you see this.
Comment 13 Eclipse Webmaster CLA 2019-09-06 16:09:03 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.