IDEA-69858 When creating a quicklist, the selected list items are blank (another fix, still has no selection bg in alloy, but should look better under GTK+ & Nimbis)

This commit is contained in:
Alexey Pegov
2011-05-29 17:31:09 +04:00
parent 260d5ca724
commit bddf95e9e2
@@ -147,13 +147,21 @@ public class TreeExpandableItemsHandler extends AbstractExpandableItemsHandler<I
final int height,
final Graphics2D g,
Integer key) {
if (myComponent.isRowSelected(key) && rComponent instanceof JComponent) {
if (myComponent.getUI() instanceof UIUtil.MacTreeUI && ((UIUtil.MacTreeUI)myComponent.getUI()).isWideSelection()) {
((JComponent)rComponent).setOpaque(true);
rComponent.setBackground(myComponent.hasFocus() ? UIUtil.getTreeSelectionBackground() : UIUtil.getListUnfocusedSelectionBackground());
}
final boolean opaque = rComponent.isOpaque();
if (rComponent instanceof JComponent) {
((JComponent)rComponent).setOpaque(true);
}
if (myComponent.isRowSelected(key)) {
rComponent.setBackground(myComponent.hasFocus() ? UIUtil.getTreeSelectionBackground() : UIUtil.getListUnfocusedSelectionBackground());
} else {
rComponent.setBackground(UIUtil.getTreeTextBackground());
}
super.doPaintTooltipImage(rComponent, cellBounds, height, g, key);
if (rComponent instanceof JComponent) {
((JComponent)rComponent).setOpaque(opaque);
}
}
}