Browse Source

Paint selection background in the case of full row selection.

pull/97/head
weisj 5 years ago
parent
commit
8898390a89
  1. 5
      core/src/main/java/com/github/weisj/darklaf/ui/cell/DarkCellRendererToggleButton.java
  2. 4
      core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableCellEditorToggleButton.java
  3. 5
      core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableCellRenderer.java

5
core/src/main/java/com/github/weisj/darklaf/ui/cell/DarkCellRendererToggleButton.java

@ -61,9 +61,8 @@ public class DarkCellRendererToggleButton<T extends JToggleButton & CellEditorTo
toggleButton.setHorizontalAlignment(table.getComponentOrientation().isLeftToRight() ? LEFT : RIGHT);
toggleButton.setHasFocus(focus);
boolean isLeadSelectionCell = DarkUIUtil.hasFocus(table) && (focus
|| (table.getSelectionModel().getLeadSelectionIndex() == row
&& DarkTableCellFocusBorder.isRowFocusBorder(table)));
boolean isLeadSelectionCell = DarkUIUtil.hasFocus(table)
&& focus && !DarkTableCellFocusBorder.isRowFocusBorder(table);
boolean alternativeRow = Boolean.TRUE.equals(table.getClientProperty(DarkTableUI.KEY_ALTERNATE_ROW_COLOR));
Color alternativeRowColor = UIManager.getColor("Table.alternateRowBackground");

4
core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableCellEditorToggleButton.java

@ -57,8 +57,8 @@ public class DarkTableCellEditorToggleButton extends AbstractCellEditor implemen
boolean isLeadSelectionCell = DarkUIUtil.hasFocus(table)
&& table.getSelectionModel().getLeadSelectionIndex() == row
&& (table.getColumnModel().getSelectionModel().getLeadSelectionIndex() == column
|| DarkTableCellFocusBorder.isRowFocusBorder(table));
&& table.getColumnModel().getSelectionModel().getLeadSelectionIndex() == column
&& !DarkTableCellFocusBorder.isRowFocusBorder(table);
boolean alternativeRow = Boolean.TRUE.equals(table.getClientProperty(DarkTableUI.KEY_ALTERNATE_ROW_COLOR));
Color alternativeRowColor = UIManager.getColor("Table.alternateRowBackground");

5
core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableCellRenderer.java

@ -63,9 +63,8 @@ public class DarkTableCellRenderer extends DefaultTableCellRenderer {
this.setVerticalAlignment(SwingConstants.CENTER);
setHorizontalAlignment(table.getComponentOrientation().isLeftToRight() ? LEFT : RIGHT);
boolean isLeadSelectionCell = DarkUIUtil.hasFocus(table) && (hasFocus
|| (table.getSelectionModel().getLeadSelectionIndex() == row
&& DarkTableCellFocusBorder.isRowFocusBorder(table)));
boolean isLeadSelectionCell = DarkUIUtil.hasFocus(table)
&& hasFocus && !DarkTableCellFocusBorder.isRowFocusBorder(table);
if (DarkTableCellFocusBorder.isRowFocusBorder(table)
&& table.getSelectionModel().getLeadSelectionIndex() == row

Loading…
Cancel
Save