mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-04 07:35:24 +02:00
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
This commit is contained in:
parent
7b5cdff64f
commit
b63caf6c72
1 changed files with 6 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue