EVALUATION
Commit to mustang and 1.5.0_02.
###@###.### 2004-09-16
Note: The difference between b63 of tiger and mustang is a non-issue. It's an intended change to selection logic. The only issue here is in regards to the lead not showing the focus border.
###@###.### 2004-09-16
The problem is in GTKPainter.ListTableFocusBorder.paintBorder(). It calls engine.paintFocus() and the state is always SELECTED. This is not always true: a focused cell may or may not be selected, and we should use different colors for these two cases. Now we're painting the unselected cell with foreground color of a selected one, which makes it white on white.
Unfortunately it's not easy to determine state of the component. All we have in paintBorder() is the renderer component which does not carry this information.
###@###.### 2005-2-01 14:25:42 GMT
So passing into paintBorder() information about whether an item is selected is difficult. We could for example set a client property on the renderer. Or we could compare renderer background color with list.getSelectionBackground() and decide based on this. These are hacks that may not even always work correctly.
So i suggest we assume that the item is always unselected (currently we assume the opposite). This way, a selected item will have focus border painted using the correct foreground color. An unselected item will still be distinguishable because it will have different background. There may still be problems when several items are selected and one of them focused. However, i've checked all the themes installed on my JDS system, and the focus indication never turned invisible. This problematic scenario is also less frequent because it never occurs with single selection lists.
I believe the 'reversed' assumption is a safer one, though this is not exactly what GTK does.
###@###.### 2005-2-02 14:46:59 GMT
A better solution was implemented: we install different focus borders on cell renderers dependent on whether cells are selected or not. The change was made to DefaultListCellRenderer and DefaultTableCellRenderer since it was backward compatible, so LAFs other than GTK may take advantage too.
There're two LAF properties now:
- focusSelectedCellHighlightBorder is used for selected cells.
- focusCellHighlightBorder is used for unselected cells. For compatibility, it is also used for selected cells if the first one is undefined.
###@###.### 2005-03-02 13:47:19 GMT
|