Fix various Dark Mode issues

This commit is contained in:
Reinhard Pointner 2019-02-28 15:39:07 +07:00
parent 9dd8044097
commit a979dfdca5
13 changed files with 32 additions and 25 deletions

View File

@ -1,6 +1,7 @@
package net.filebot.ui;
import java.awt.Color;
import static net.filebot.ui.ThemeSupport.*;
import java.awt.Component;
import javax.swing.JLabel;
@ -47,7 +48,7 @@ public class LanguageComboBoxCellRenderer implements ListCellRenderer {
if (index == 0 || index == model.favorites().size()) {
// add separator border
c.setBorder(new CompoundBorder(new DashedSeparator(10, 4, Color.lightGray, list.getBackground()), c.getBorder()));
c.setBorder(new CompoundBorder(new DashedSeparator(10, 4, getPassiveColor(), list.getBackground()), c.getBorder()));
}
return c;

View File

@ -59,23 +59,27 @@ public class ThemeSupport {
}
public static Color getHelpPanelBackground() {
return getColor(0xFFFFE1);
return theme.isDark() ? new Color(0x313131) : new Color(0xFFFFE1);
}
public static Border getHelpPanelBorder() {
return createLineBorder(getColor(0xACA899));
}
public static Color getErrorColor() {
return Color.red;
}
public static Color getLinkColor() {
return theme.getLinkSelectionForeground();
}
public static Color getActiveColor() {
return new Color(0x6495ED);// CornflowerBlue
return new Color(0x6495ED);// Cornflower Blue
}
public static Color getPassiveColor() {
return Color.gray;
return Color.lightGray;
}
public static Color getVerificationColor() {

View File

@ -3,10 +3,10 @@ package net.filebot.ui.list;
import static java.util.stream.Collectors.*;
import static javax.swing.BorderFactory.*;
import static net.filebot.Settings.*;
import static net.filebot.ui.ThemeSupport.*;
import static net.filebot.util.ui.SwingUI.*;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Toolkit;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable;
@ -134,7 +134,7 @@ public class ListPanel extends JComponent {
Border defaultBorder = new JTextField().getBorder();
Border okBorder = createCompoundBorder(defaultBorder, createEmptyBorder(2, 2, 2, 2));
Border errorBorder = createCompoundBorder(createLineBorder(Color.RED, 1), createCompoundBorder(defaultBorder, createEmptyBorder(1, 1, 1, 1)));
Border errorBorder = createCompoundBorder(createLineBorder(getErrorColor(), 1), createCompoundBorder(defaultBorder, createEmptyBorder(1, 1, 1, 1)));
editorScrollPane.setBorder(okBorder);

View File

@ -13,7 +13,6 @@ import static net.filebot.util.ExceptionUtilities.*;
import static net.filebot.util.FileUtilities.*;
import static net.filebot.util.ui.SwingUI.*;
import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
@ -539,7 +538,7 @@ public class FormatDialog extends JDialog {
status.setVisible(true);
preview.setVisible(false);
editor.setForeground(Color.red);
editor.setForeground(getErrorColor());
}
}

View File

@ -1,11 +1,11 @@
package net.filebot.ui.sfv;
import static java.awt.Color.*;
import static java.awt.Cursor.*;
import static java.awt.Font.*;
import static java.awt.RenderingHints.*;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
@ -30,7 +30,7 @@ public class ChecksumButton extends JToggleButton {
setMinimumSize(getPreferredSize());
setMaximumSize(getPreferredSize());
setForeground(WHITE);
setForeground(Color.white);
setFont(new Font(DIALOG, PLAIN, 11));
// as image button

View File

@ -39,7 +39,7 @@ public class ChecksumCellRenderer extends DefaultTableCellRenderer {
// if row state is ERROR and if we are not selected use text color RED,
// else use default table colors
setForeground(isSelected ? table.getSelectionForeground() : isError ? Color.RED : isVerificationColumn(table, column) ? verificationForeground : table.getForeground());
setForeground(isSelected ? table.getSelectionForeground() : isError ? getErrorColor() : isVerificationColumn(table, column) ? verificationForeground : table.getForeground());
setBackground(isSelected ? table.getSelectionBackground() : table.getBackground());
// use BOLD font on ERROR

View File

@ -384,12 +384,12 @@ class SubtitleAutoMatchDialog extends JDialog {
// no subtitles found
setText("No subtitles found");
setIcon(null);
setForeground(Color.gray);
setForeground(getPassiveColor());
} else {
// no subtitles found
setText("No subtitles selected");
setIcon(null);
setForeground(Color.gray);
setForeground(getPassiveColor());
}
} else if (subtitleBean.getState() == StateValue.PENDING) {
// download in the queue
@ -429,7 +429,7 @@ class SubtitleAutoMatchDialog extends JDialog {
SubtitleDescriptorBean subtitleBean = (SubtitleDescriptorBean) value;
if (isEditor && index == list.getModel().getSize() - 2) {
setBorder(new CompoundBorder(new DashedSeparator(10, 4, Color.lightGray, list.getBackground()), getBorder())); // this element is always the last one
setBorder(new CompoundBorder(new DashedSeparator(10, 4, getPassiveColor(), list.getBackground()), getBorder())); // this element is always the last one
}
if (value == null) {

View File

@ -59,7 +59,7 @@ public class SubtitleViewer extends JFrame {
private final JTextField filterEditor = createFilterEditor();
private Color defaultFilterForeground = filterEditor.getForeground();
private Color disabledFilterForeground = Color.lightGray;
private Color disabledFilterForeground = getPassiveColor();
public SubtitleViewer(String title) {
super(title);

View File

@ -1,8 +1,8 @@
package net.filebot.ui.subtitle.upload;
import static net.filebot.MediaTypes.*;
import static net.filebot.ui.ThemeSupport.*;
import java.awt.Color;
import java.awt.Component;
import java.io.File;
@ -31,7 +31,7 @@ class FileRenderer extends DefaultTableCellRenderer {
setText("<Click to select video file>");
setToolTipText(null);
setIcon(null);
setForeground(Color.LIGHT_GRAY);
setForeground(getPassiveColor());
}
return this;

View File

@ -1,6 +1,7 @@
package net.filebot.ui.subtitle.upload;
import java.awt.Color;
import static net.filebot.ui.ThemeSupport.*;
import java.awt.Component;
import javax.swing.DefaultListCellRenderer;
@ -29,7 +30,7 @@ class LanguageRenderer implements TableCellRenderer, ListCellRenderer {
} else {
c.setText("<Click to select language>");
c.setIcon(null);
c.setForeground(Color.LIGHT_GRAY);
c.setForeground(getPassiveColor());
}
return c;
}

View File

@ -1,6 +1,7 @@
package net.filebot.ui.subtitle.upload;
import java.awt.Color;
import static net.filebot.ui.ThemeSupport.*;
import java.awt.Component;
import javax.swing.Icon;
@ -31,7 +32,7 @@ class MovieRenderer extends DefaultTableCellRenderer {
setText("<Click to select movie / series>");
setToolTipText(null);
setIcon(null);
setForeground(Color.LIGHT_GRAY);
setForeground(getPassiveColor());
}
return this;

View File

@ -1,6 +1,7 @@
package net.filebot.util.ui;
import java.awt.Color;
import static net.filebot.ui.ThemeSupport.*;
import java.awt.event.ActionListener;
import javax.swing.Action;
@ -33,7 +34,7 @@ public class ActionPopup extends JPopupMenu {
actionPanel.setOpaque(false);
statusLabel.setFont(statusLabel.getFont().deriveFont(10f));
statusLabel.setForeground(Color.GRAY);
statusLabel.setForeground(getPassiveColor());
setLayout(new MigLayout("nogrid, fill, insets 0"));

View File

@ -236,7 +236,7 @@ public class SelectButton<T> extends JButton {
icon.paintIcon(c, g2d, 4, 3);
}
g2d.setPaint(Color.BLACK);
g2d.setPaint(Color.black);
g2d.fill(arrow);
}