else
OwlUI.codDrawGradient(event, fGradientFgColor, fGradientBgColor, fGradientEndColor);
}
private void eraseNews(Event event, INews news) {
Scrollable scrollable = (Scrollable) event.widget;
GC gc = event.gc;
/* Handle selected News (Linux: Note Bug 444) */
if ((event.detail & SWT.SELECTED) != 0 && (Application.IS_WINDOWS || !news.isFlagged())) {
/* Do not override selection color if not focus control */
if (!scrollable.isFocusControl())
return;
/* Load Labels */
Set<ILabel> labels = CoreUtils.getSortedLabels(news);
if (labels.isEmpty())
return;
ILabel label = labels.iterator().next();
if (isInvalidColor(label))
return;
Rectangle clArea = scrollable.getClientArea();
Rectangle itemRect = event.getBounds();
/* Paint the selection beyond the end of last column */
OwlUI.codExpandRegion(event, scrollable, gc, clArea);
/* Draw Rectangle */
Color oldBackground = gc.getBackground();
gc.setBackground(OwlUI.getColor(fResources, label));
gc.fillRectangle(0, itemRect.y, clArea.width, itemRect.height);
gc.setBackground(oldBackground);
gc.setForeground(scrollable.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
/* Mark as Selected being handled */
event.detail &= ~SWT.SELECTED;
}
/* Handle Non-Selected flagged News */
else if (news.isFlagged()) {
Rectangle clArea = scrollable.getClientArea();
Rectangle itemRect = event.getBounds();
/* Paint the selection beyond the end of last column */
OwlUI.codExpandRegion(event, scrollable, gc, clArea);