Community
Participate
Working Groups
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.
Created attachment 87940 [details] firefox renders non-focus selectios in gray
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.
*** This bug has been marked as a duplicate of bug 4745 ***
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.
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).
(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.
*** Bug 222880 has been marked as a duplicate of this bug. ***
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.
Felipe, the "black on black" bug is not SWT, right? Is it that Eclipse chooses the wrong colors in this case?
(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.
> 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).
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.
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.