Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 332540

Summary: [preferences] Errors/Warnings page: selected option not (well) visible
Product: [Eclipse Project] JDT Reporter: Dani Megert <daniel_megert>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: amj87.iitr, deepakazad, markus.kell.r
Version: 3.7   
Target Milestone: 3.8 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch none

Description Dani Megert CLA 2010-12-14 11:25:18 EST
3.6.

The selected option on the Errors/Warnings page is not (well) visible. This is especially true under Windows 7 with disabled mnemonic indication in which case the focus grid isn't shown either unless one presses 'Tab' or 'Alt'.
Comment 1 Markus Keller CLA 2010-12-14 12:06:18 EST
Even if the focus ring is visible in the Combo, it's still hard to see. And especially if the option label is short, it's also hard to follow the row backwards to find and read the right label.

A solution that would solve these problems would be something similar to what a native table does: Draw a selection background on the current row (and maybe another row background for the row under the mouse).
Comment 2 Deepak Azad CLA 2010-12-15 02:54:42 EST
Created attachment 185206 [details]
patch

Something like this ?

(In reply to comment #1)
> A solution that would solve these problems would be something similar to what a
> native table does: Draw a selection background on the current row 
Do we need the selection background on both the label and the control ? It is doable but more work.

> (and maybe
> another row background for the row under the mouse).
The label is not clickable, only the combo control is. Hence I think a background for the row under the mouse would be misleading/wrong.
Comment 3 Markus Keller CLA 2010-12-15 05:47:11 EST
Yes, something like this, but it shouldn't look like a hack. The whole grid row should be colored (both cells, and not only the widget in the cell). And when you reset the default color, use the default (null).
Comment 4 Markus Keller CLA 2010-12-15 05:54:35 EST
Note that the hard part here is not to implement something, but to find a good solution that solves the UI problems and looks good on all platforms.

The highlighting should also work for checkbox controls.

(In reply to comment #2)
> > (and maybe another row background for the row under the mouse).
> The label is not clickable, only the combo control is. Hence I think a
> background for the row under the mouse would be misleading/wrong.

In itself, probably yes. But we could also make the label clickable. E.g. checkboxes are already clickable.
Comment 5 Deepak Azad CLA 2010-12-15 10:11:23 EST
(In reply to comment #4)
> (In reply to comment #2)
> > > (and maybe another row background for the row under the mouse).
> > The label is not clickable, only the combo control is. Hence I think a
> > background for the row under the mouse would be misleading/wrong.
> 
> In itself, probably yes. But we could also make the label clickable. E.g.
> checkboxes are already clickable.
This looks like an overkill to me. 

Plus what happens if we add a textbox (or some other control) to this page in future ? E.g. see 'Java > Compiler > Building' page. Will a background for row/control under mouse look good in this case
Comment 7 Markus Keller CLA 2012-02-27 12:19:07 EST
The light background makes the label look too similar to a text field. Pushed a better fix that draws an arrow. Verified that it also works with -dir rtl.

http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=90cfce2a1e9acf40f23ee534cd585a41debf276b
Comment 8 Deepak Azad CLA 2012-02-27 22:23:50 EST
The arrows are a bit unconventional, but they seem to work well :-)

However, preferences with combo boxes get an arrow, but the ones with checkboxes get a highlight. Is this intentional? Looks odd to me.
Comment 9 Dani Megert CLA 2012-02-28 02:20:09 EST
I prefer the arrow over the white "text field" look. There's just one small remaining issue:

1. open the page
2. start to change a combo
3. move the mouse over some other option
==> two arrows visible and one doesn't know which preference will change when pressing the Up/Down Arrow key (see also bug 371067)
Comment 10 Deepak Azad CLA 2012-02-28 03:42:58 EST
(In reply to comment #8)
> However, preferences with combo boxes get an arrow, but the ones with
> checkboxes get a highlight. Is this intentional? Looks odd to me.
Just to be 100% clear, I am referring to different highlighting mechanisms being used for different controls.
Comment 11 Markus Keller CLA 2012-02-28 08:52:21 EST
Fixed the "two arrows" issue by making the arrow for the focused item darker.
Clicking on the label or the arrow now sets focus to the combo.

http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=fe22bcaf942dfc2a696a8ec1ca53cb504567ad28


The highlighting of checkboxes with a brighter background color on hover is a platform-specific behavior on certain GTK versions/themes. Unfortunately, there's no portable "highlight a row in a GridLayout" feature, so anything we do can cause a slight mismatch on some platforms. I think that's acceptable.
Comment 12 Deepak Azad CLA 2012-02-28 09:07:53 EST
(In reply to comment #11)
> The highlighting of checkboxes with a brighter background color on hover is a
> platform-specific behavior on certain GTK versions/themes. Unfortunately,
> there's no portable "highlight a row in a GridLayout" feature, so anything we
> do can cause a slight mismatch on some platforms. I think that's acceptable.

Ha! I see now that on Windows only the check box is highlighted, and not the label. But this is an old behavior, right? And you have not done anything special for highlighting checkbox preferences as part of this bug, or did you?
Comment 13 Markus Keller CLA 2012-02-28 12:33:37 EST
> And you have not done anything
> special for highlighting checkbox preferences as part of this bug?

Correct. The only changes were:
- show an arrow for the focused combo and the combo option under the mouse to bridge the gap between the left-aligned label and the right-aligned combo
- give focus to the combo when label or arrow is clicked
Comment 14 Ayushman Jain CLA 2012-03-06 14:12:12 EST
Quick question - currently I see arrows on even those options that are disabled (eg. when the "enable annotation-based analysis" is uncheked, I see the arrow for the greyed out options too). Is that really needed? I've usually seen in other applications that greyed out options don't react in any way until they're un-greyed out. :)
Comment 16 Dani Megert CLA 2012-03-15 05:01:42 EDT
Verified in I20120314-1800.