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

Bug 515192

Summary: [regression] Ctrl+F6/F7/F8 tables show non functional empty area and separator on top
Product: [Eclipse Project] Platform Reporter: Andrey Loskutov <loskutov>
Component: UIAssignee: Andrey Loskutov <loskutov>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, psuzzi
Version: 4.7   
Target Milestone: 4.7 M7   
Hardware: PC   
OS: Linux   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=515052
https://bugs.eclipse.org/bugs/show_bug.cgi?id=515060
https://git.eclipse.org/r/94970
https://bugs.eclipse.org/bugs/show_bug.cgi?id=368977
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=0fc86ce8ba5868aa1b01cd4e89edc79a50854e7b
https://git.eclipse.org/r/94982
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=e3da830e77410671ff27ecfaf728c2717b64b18f
https://git.eclipse.org/r/94991
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=2b1ce323d22a7852f6ef7912944e153baba6adb1
Whiteboard:
Attachments:
Description Flags
non functional area on top
none
image: area to insert the filter
none
still empty area on I20170412-2000
none
not empty in dark theme none

Description Andrey Loskutov CLA 2017-04-12 09:28:48 EDT
Created attachment 267773 [details]
non functional area on top

After discussions on bug 515052, bug 515060 etc I've first time noticed that all this "quick switch" tables have changed they appearance in a bad way between 4.6 and 4.7.

In 4.6 they had a title on top of the table with entries, like "Editors", "Views", "Perspectives". In 4.7 I20170409-2000 I see a non-functional empty white area and a separator on top instead of the title. 
??? 
Either this area should be entirely removed or the old title should be shown inside, but current state makes no sense for me.
Comment 1 Patrik Suzzi CLA 2017-04-12 09:37:04 EDT
Created attachment 267774 [details]
image: area to insert the filter

Andrey, the empty area is to insert a text to filter the entries.
I could add a text "type to filter", to make it clear.
Comment 2 Andrey Loskutov CLA 2017-04-12 09:46:17 EDT
(In reply to Patrik Suzzi from comment #1)
> Created attachment 267774 [details]
> image: area to insert the filter
> 
> Andrey, the empty area is to insert a text to filter the entries.
> I could add a text "type to filter", to make it clear.

Patrik, with "could" do you mean bug 515052 and bug 515060? Currently (in my build I20170409-2000) this area can't be used.

I have no problems if you plan to add some filtering later, but please don't show this non functional area *now*. From my experience, most of "I will do it later" tasks will never be implemented (we all have only 24 hours in the day), so better not to add things at all which rely on future promises.
Comment 3 Dani Megert CLA 2017-04-12 11:34:58 EDT
AFAIK Ctrl+F6 wasn't broken. I've reverted the other two no go changes already.
Comment 4 Andrey Loskutov CLA 2017-04-13 03:34:24 EDT
(In reply to Dani Megert from comment #3)
> AFAIK Ctrl+F6 wasn't broken. I've reverted the other two no go changes
> already.

Nope. I'm running now I20170412-2000 (with reverted code) and still see non-functional white area without title.
Comment 5 Andrey Loskutov CLA 2017-04-13 03:40:28 EDT
(In reply to Dani Megert from comment #3)
> AFAIK Ctrl+F6 wasn't broken.

Just confirmed that this one *also* has an empty white area without any function or title :-(
Comment 6 Dani Megert CLA 2017-04-13 03:50:18 EDT
(In reply to Andrey Loskutov from comment #4)
> (In reply to Dani Megert from comment #3)
> > AFAIK Ctrl+F6 wasn't broken. I've reverted the other two no go changes
> > already.
> 
> Nope. I'm running now I20170412-2000 (with reverted code) and still see
> non-functional white area without title.

It works for me:

1. Download http://download.eclipse.org/eclipse/downloads/drops4/I20170412-2000/download.php?dropFile=eclipse-SDK-I20170412-2000-win32-x86_64.zip

2. Start a new workspace

3. Paste "class A {}" into the Package Explorer

4 Use Ctrl+F6/F7/F8

==> works for me, i.e. no filter but a title for all three cases.


Maybe your update wrong? Please try my steps.
Comment 7 Andrey Loskutov CLA 2017-04-13 04:14:01 EDT
(In reply to Dani Megert from comment #6)
> (In reply to Andrey Loskutov from comment #4)
> > (In reply to Dani Megert from comment #3)
> > > AFAIK Ctrl+F6 wasn't broken. I've reverted the other two no go changes
> > > already.
> > 
> > Nope. I'm running now I20170412-2000 (with reverted code) and still see
> > non-functional white area without title.
> 
> It works for me:
> 
> 1. Download
> http://download.eclipse.org/eclipse/downloads/drops4/I20170412-2000/download.
> php?dropFile=eclipse-SDK-I20170412-2000-win32-x86_64.zip
> 
> 2. Start a new workspace
> 
> 3. Paste "class A {}" into the Package Explorer
> 
> 4 Use Ctrl+F6/F7/F8
> 
> ==> works for me, i.e. no filter but a title for all three cases.
> 
> 
> Maybe your update wrong? Please try my steps.

I'm on RHEL 7.2 and did exact same steps except that I'm using GTK3 build. 
I see empty white area in all 3 dialogs, no title and also no filtering.
Comment 8 Andrey Loskutov CLA 2017-04-13 04:19:25 EDT
Created attachment 267786 [details]
still empty area on I20170412-2000
Comment 9 Andrey Loskutov CLA 2017-04-13 04:25:51 EDT
Created attachment 267787 [details]
not empty in dark theme

OK, I've found where the problem is: the title is shown in *white* color on white background! The dark theme has no such issues, but "Light" and "Classic" themes seem to be broken on GTK (or the code of the dialog is using wrong foreground font color constant).
Comment 10 Eclipse Genie CLA 2017-04-13 04:39:24 EDT
New Gerrit change created: https://git.eclipse.org/r/94970
Comment 11 Dani Megert CLA 2017-04-13 05:03:58 EDT
(In reply to Andrey Loskutov from comment #9)
> Created attachment 267787 [details]
> not empty in dark theme
> 
> OK, I've found where the problem is: the title is shown in *white* color on
> white background! The dark theme has no such issues, but "Light" and
> "Classic" themes seem to be broken on GTK (or the code of the dialog is
> using wrong foreground font color constant).

Is this something new then, or did you only notice now? If the former, what bug introduced this?
Comment 12 Andrey Loskutov CLA 2017-04-13 05:29:32 EDT
(In reply to Dani Megert from comment #11)
> (In reply to Andrey Loskutov from comment #9)
> > Created attachment 267787 [details]
> > not empty in dark theme
> > 
> > OK, I've found where the problem is: the title is shown in *white* color on
> > white background! The dark theme has no such issues, but "Light" and
> > "Classic" themes seem to be broken on GTK (or the code of the dialog is
> > using wrong foreground font color constant).
> 
> Is this something new then, or did you only notice now? If the former, what
> bug introduced this?

I've just noticed this because there was this disccussion about filter line etc and I wondered that I neither have the filter nor the title :-)

Probably this was regression from bug 368977, where the code was introduced, but I didn't bisect this.
Comment 14 Andrey Loskutov CLA 2017-04-13 05:40:13 EDT
(In reply to Eclipse Genie from comment #13)
> Gerrit change https://git.eclipse.org/r/94970 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> ?id=0fc86ce8ba5868aa1b01cd4e89edc79a50854e7b

I've verified the fix works on Linux and Windows 7 in all themes, I assume this will also work on Mac (have no access to it).
Comment 15 Eclipse Genie CLA 2017-04-13 05:48:16 EDT
New Gerrit change created: https://git.eclipse.org/r/94982
Comment 17 Dani Megert CLA 2017-04-13 05:50:17 EDT
(In reply to Andrey Loskutov from comment #14)
> (In reply to Eclipse Genie from comment #13)
> > Gerrit change https://git.eclipse.org/r/94970 was merged to [master].
> > Commit:
> > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> > ?id=0fc86ce8ba5868aa1b01cd4e89edc79a50854e7b
> 
> I've verified the fix works on Linux and Windows 7 in all themes, I assume
> this will also work on Mac (have no access to it).

This is not good. There's always the possibility of a clash when we mix foreground and background colors from different elements.

The safest is to use

	protected Color getForeground(){
		return dialog.getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND);
	}
	protected Color getBackground() {
		return dialog.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
	}

because those already work at the OS level. Alternatively, it could be the foreground and background color of a theme element, but no mix.

Andrey, please check whether that works for you.
Comment 18 Eclipse Genie CLA 2017-04-13 07:08:35 EDT
New Gerrit change created: https://git.eclipse.org/r/94991
Comment 19 Andrey Loskutov CLA 2017-04-13 07:13:12 EDT
(In reply to Dani Megert from comment #17)
> (In reply to Andrey Loskutov from comment #14)
> > (In reply to Eclipse Genie from comment #13)
> > > Gerrit change https://git.eclipse.org/r/94970 was merged to [master].
> > > Commit:
> > > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> > > ?id=0fc86ce8ba5868aa1b01cd4e89edc79a50854e7b
> > 
> > I've verified the fix works on Linux and Windows 7 in all themes, I assume
> > this will also work on Mac (have no access to it).
> 
> This is not good. There's always the possibility of a clash when we mix
> foreground and background colors from different elements.

I see, thanks. 

> dialog.getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND);
> Andrey, please check whether that works for you.

Yes, this is OK on GTK3 / Win 7.