From b63caf6c7221fabb9f9becee8f667d1f74a58bc0 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Fri, 11 Dec 2015 16:17:33 -0500 Subject: [PATCH] launchbar: fixed some visual glitches in custom widget list - list background was not inherited creating spotty list - removed rectangle around list items which was very custom and non stylable - removed paint lister after lazy item initialization to prevent lag Change-Id: I4e458c816dcb96138871b906e43806b0cf2e72e8 --- .../ui/internal/controls/LaunchBarListViewer.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java index bc57b740c95..7f667d91989 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarListViewer.java @@ -46,7 +46,6 @@ import org.eclipse.swt.events.TraverseListener; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; @@ -184,19 +183,16 @@ public class LaunchBarListViewer extends StructuredViewer { this.index = index; this.labelProvider = labelProvider; setData(element); - setBackground(getParent().getBackground()); + setBackground(parent.getBackground()); addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { - Point size = getSize(); - GC gc = e.gc; - gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW)); - gc.drawLine(0, size.y - 1, size.x, size.y - 1); - if (label == null) + removePaintListener(this); + if (label == null) { lazyInit(); + } } }); - // lazyInit(); } // end ListItem(..) protected void lazyInit() { @@ -321,6 +317,7 @@ public class LaunchBarListViewer extends StructuredViewer { } }); } + icon.setBackground(parent.getBackground()); return icon; } @@ -332,6 +329,7 @@ public class LaunchBarListViewer extends StructuredViewer { if (labelProvider instanceof IFontProvider) { label.setFont(((IFontProvider) labelProvider).getFont(element)); } + label.setBackground(parent.getBackground()); return label; } } // end ListItem class