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

Bug 316885

Summary: [nebula gallery] Background not painted for GalleryItem when using ListItemRenderer
Product: z_Archived Reporter: Justin Dolezy <justin>
Component: NebulaAssignee: Laurent CARON <laurent.caron>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: laurent.caron
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://github.com/eclipse/nebula/pull/127
Whiteboard:
Attachments:
Description Flags
Snipped demonstrating the problem
none
Patch that fixes the problem none

Description Justin Dolezy CLA 2010-06-15 08:02:42 EDT
Build Identifier: I20100312-1448

Setting the background colour on a GalleryItem has no effect when the Gallery is using a ListItemRenderer.

Culprit appears to be on line 171 (in rev 1.21):

	if (selected
		|| RendererHelper.isColorsEquals(itemBackgroundColor, gallery
				.getBackground())) {
		if (selected) {
			gc.setBackground(selectionBackgroundColor);
			gc.setForeground(selectionBackgroundColor);
		} else if (itemBackgroundColor != null) {
			gc.setBackground(itemBackgroundColor);
		}

The test "RendererHelper.isColorsEquals(itemBackgroundColor, gallery.getBackground())" should be negated with a "!" at the start, I believe.

I can double check once I can check out the source rather than looking at the viewcvs webpage (can't checkout right now as on public WiFi which is blocking port 80...)


Reproducible: Always
Comment 1 Justin Dolezy CLA 2010-06-15 08:12:59 EDT
Created attachment 171917 [details]
Snipped demonstrating the problem

This is one of the standard snippets, with the addition of the following line which demonstrates the problem:

> item.setBackground(item.getDisplay().getSystemColor(i%2 == 0 ? SWT.COLOR_WHITE : SWT.COLOR_YELLOW));
Comment 2 Justin Dolezy CLA 2010-06-15 13:02:22 EDT
Created attachment 171963 [details]
Patch that fixes the problem

As expected, the fix was to negate the part of the if-statement as mentioned.
Comment 3 Laurent CARON CLA 2019-09-18 16:02:17 EDT
Bug fixed in Nebula V2.3.0

Thank you justin for the patch