Browse Source

Updated scrollbar colors.

Fixed table/list/tree background rendering.
Table now sources the drop background from the first ancestor that
is not a ScrollPane.
pull/15/head
weisj 5 years ago
parent
commit
bf64b50dad
  1. 2
      src/main/java/com/weis/darklaf/ui/list/DarkListCellRenderer.java
  2. 2
      src/main/java/com/weis/darklaf/ui/list/DarkListUI.java
  3. 3
      src/main/java/com/weis/darklaf/ui/scrollpane/DarkScrollBarUI.java
  4. 2
      src/main/java/com/weis/darklaf/ui/table/DarkTableCellEditor.java
  5. 2
      src/main/java/com/weis/darklaf/ui/table/DarkTableCellEditorToggleButton.java
  6. 2
      src/main/java/com/weis/darklaf/ui/table/DarkTableCellRenderer.java
  7. 9
      src/main/java/com/weis/darklaf/ui/table/DarkTableUI.java
  8. 2
      src/main/resources/com/weis/darklaf/theme/darcula/darcula_defaults.properties
  9. 2
      src/main/resources/com/weis/darklaf/theme/intellij/intellij_defaults.properties

2
src/main/java/com/weis/darklaf/ui/list/DarkListCellRenderer.java

@ -65,7 +65,7 @@ public class DarkListCellRenderer extends DefaultListCellRenderer {
} }
} }
Color alternativeRowColor = UIManager.getColor("List.alternateRowBackground"); Color alternativeRowColor = UIManager.getColor("List.alternateRowBackground");
Color normalColor = UIManager.getColor("List.background"); Color normalColor = list.getBackground();
var background = alternativeRow ? alternativeRowColor : normalColor; var background = alternativeRow ? alternativeRowColor : normalColor;
if (!(isSelected)) { if (!(isSelected)) {
comp.setBackground(background); comp.setBackground(background);

2
src/main/java/com/weis/darklaf/ui/list/DarkListUI.java

@ -120,7 +120,7 @@ public class DarkListUI extends DarkListUIBridge {
if (empty) { if (empty) {
boolean alternativeRow = Boolean.TRUE.equals(list.getClientProperty("JList.alternateRowColor")); boolean alternativeRow = Boolean.TRUE.equals(list.getClientProperty("JList.alternateRowColor"));
Color alternativeRowColor = UIManager.getColor("List.alternateRowBackground"); Color alternativeRowColor = UIManager.getColor("List.alternateRowBackground");
Color normalColor = UIManager.getColor("List.background"); Color normalColor = list.getBackground();
var background = alternativeRow && row % 2 == 1 ? alternativeRowColor : normalColor; var background = alternativeRow && row % 2 == 1 ? alternativeRowColor : normalColor;
var c = g.getColor(); var c = g.getColor();
g.setColor(background); g.setColor(background);

3
src/main/java/com/weis/darklaf/ui/scrollpane/DarkScrollBarUI.java

@ -480,7 +480,8 @@ public class DarkScrollBarUI extends BasicScrollBarUI {
final var c = g.getComposite(); final var c = g.getComposite();
g.setComposite(COMPOSITE.derive(THUMB_ALPHA)); g.setComposite(COMPOSITE.derive(THUMB_ALPHA));
var thumbColor = getThumbColor(); var thumbColor = getThumbColor();
g.setColor(DarkUIUtil.blendColors(thumbBorderColor, thumbColor, 1 - ((thumbAlpha - THUMB_ALPHA)))); double percent = Math.min(1.0, Math.max(0.0, 1 - (thumbAlpha - THUMB_ALPHA)));
g.setColor(DarkUIUtil.blendColors(thumbBorderColor, thumbColor, percent));
DarkUIUtil.drawRect(g, rect.x, rect.y, rect.width, rect.height, 1); DarkUIUtil.drawRect(g, rect.x, rect.y, rect.width, rect.height, 1);
g.setColor(thumbColor); g.setColor(thumbColor);
g.fillRect(rect.x + 1, rect.y + 1, rect.width - 2, rect.height - 2); g.fillRect(rect.x + 1, rect.y + 1, rect.width - 2, rect.height - 2);

2
src/main/java/com/weis/darklaf/ui/table/DarkTableCellEditor.java

@ -214,7 +214,7 @@ public class DarkTableCellEditor extends DefaultCellEditor {
boolean alternativeRow = Boolean.TRUE.equals(table.getClientProperty("JTable.alternateRowColor")); boolean alternativeRow = Boolean.TRUE.equals(table.getClientProperty("JTable.alternateRowColor"));
Color alternativeRowColor = UIManager.getColor("Table.alternateRowBackground"); Color alternativeRowColor = UIManager.getColor("Table.alternateRowBackground");
Color normalColor = UIManager.getColor("Table.background"); Color normalColor = table.getBackground();
var background = alternativeRow && row % 2 == 1 ? alternativeRowColor : normalColor; var background = alternativeRow && row % 2 == 1 ? alternativeRowColor : normalColor;
var rendererComp = table.getCellRenderer(row, column) var rendererComp = table.getCellRenderer(row, column)

2
src/main/java/com/weis/darklaf/ui/table/DarkTableCellEditorToggleButton.java

@ -33,7 +33,7 @@ public class DarkTableCellEditorToggleButton extends AbstractCellEditor implemen
boolean alternativeRow = Boolean.TRUE.equals(table.getClientProperty("JTable.alternateRowColor")); boolean alternativeRow = Boolean.TRUE.equals(table.getClientProperty("JTable.alternateRowColor"));
Color alternativeRowColor = UIManager.getColor("Table.alternateRowBackground"); Color alternativeRowColor = UIManager.getColor("Table.alternateRowBackground");
Color normalColor = UIManager.getColor("Table.background"); Color normalColor = table.getBackground();
var background = alternativeRow && row % 2 == 1 ? alternativeRowColor : normalColor; var background = alternativeRow && row % 2 == 1 ? alternativeRowColor : normalColor;
if (!(isSelected) || table.isEditing()) { if (!(isSelected) || table.isEditing()) {
toggleButton.setBackground(background); toggleButton.setBackground(background);

2
src/main/java/com/weis/darklaf/ui/table/DarkTableCellRenderer.java

@ -60,7 +60,7 @@ public class DarkTableCellRenderer extends DefaultTableCellRenderer {
boolean alternativeRow = Boolean.TRUE.equals(table.getClientProperty("JTable.alternateRowColor")); boolean alternativeRow = Boolean.TRUE.equals(table.getClientProperty("JTable.alternateRowColor"));
Color alternativeRowColor = UIManager.getColor("Table.alternateRowBackground"); Color alternativeRowColor = UIManager.getColor("Table.alternateRowBackground");
Color normalColor = UIManager.getColor("Table.background"); Color normalColor = table.getBackground();
var background = alternativeRow && row % 2 == 1 ? alternativeRowColor : normalColor; var background = alternativeRow && row % 2 == 1 ? alternativeRowColor : normalColor;
if (!(isSelected) || table.isEditing()) { if (!(isSelected) || table.isEditing()) {
component.setBackground(background); component.setBackground(background);

9
src/main/java/com/weis/darklaf/ui/table/DarkTableUI.java

@ -185,7 +185,14 @@ public class DarkTableUI extends DarkTableUIBridge {
int dist = adjustDistance(distance, vacatedColumnRect, table); int dist = adjustDistance(distance, vacatedColumnRect, table);
// Paint a gray well in place of the moving column. // Paint a gray well in place of the moving column.
g.setColor(table.getParent().getBackground()); Container parent = table.getParent();
if (isInScrollPane()) {
var par = DarkUIUtil.getParentOfType(JScrollPane.class, table);
if (par != null && par.getParent() != null) {
parent = par.getParent();
}
}
g.setColor(parent.getBackground());
g.fillRect(vacatedColumnRect.x, vacatedColumnRect.y, g.fillRect(vacatedColumnRect.x, vacatedColumnRect.y,
vacatedColumnRect.width - 1, vacatedColumnRect.height); vacatedColumnRect.width - 1, vacatedColumnRect.height);

2
src/main/resources/com/weis/darklaf/theme/darcula/darcula_defaults.properties

@ -79,7 +79,7 @@
%controlBorderSelected = 6B6B6B %controlBorderSelected = 6B6B6B
%controlBorderFocus = 466D94 %controlBorderFocus = 466D94
%controlBorderFocusSelected = 466D94 %controlBorderFocusSelected = 466D94
%controlBorderSecondary = C8C8C8 %controlBorderSecondary = 424242
%controlFill = A0A0A0 %controlFill = A0A0A0
%controlFillFocus = A0A0A0 %controlFillFocus = A0A0A0
%controlFillSecondary = A0A0A0 %controlFillSecondary = A0A0A0

2
src/main/resources/com/weis/darklaf/theme/intellij/intellij_defaults.properties

@ -81,7 +81,7 @@
%controlBorderSelected = 4982CC %controlBorderSelected = 4982CC
%controlBorderFocus = 7B9FC7 %controlBorderFocus = 7B9FC7
%controlBorderFocusSelected = ACCFF7 %controlBorderFocusSelected = ACCFF7
%controlBorderSecondary = C8C8C8 %controlBorderSecondary = B4B4B4
%controlFill = FFFFFF %controlFill = FFFFFF
%controlFillSecondary = 808080 %controlFillSecondary = 808080
%controlTrack = ABABAB %controlTrack = ABABAB

Loading…
Cancel
Save