Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316885 - [nebula gallery] Background not painted for GalleryItem when using ListItemRenderer
Summary: [nebula gallery] Background not painted for GalleryItem when using ListItemRe...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Nebula (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Laurent CARON CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-15 08:02 EDT by Justin Dolezy CLA
Modified: 2021-07-05 11:40 EDT (History)
1 user (show)

See Also:


Attachments
Snipped demonstrating the problem (3.48 KB, application/octet-stream)
2010-06-15 08:12 EDT, Justin Dolezy CLA
no flags Details
Patch that fixes the problem (1.28 KB, patch)
2010-06-15 13:02 EDT, Justin Dolezy CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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