1
0
mirror of https://github.com/mitb-archive/filebot synced 2025-01-09 12:58:08 -05:00

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; package net.filebot.ui;
import java.awt.Color; import static net.filebot.ui.ThemeSupport.*;
import java.awt.Component; import java.awt.Component;
import javax.swing.JLabel; import javax.swing.JLabel;
@ -47,7 +48,7 @@ public class LanguageComboBoxCellRenderer implements ListCellRenderer {
if (index == 0 || index == model.favorites().size()) { if (index == 0 || index == model.favorites().size()) {
// add separator border // 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; return c;

View File

@ -59,13 +59,17 @@ public class ThemeSupport {
} }
public static Color getHelpPanelBackground() { public static Color getHelpPanelBackground() {
return getColor(0xFFFFE1); return theme.isDark() ? new Color(0x313131) : new Color(0xFFFFE1);
} }
public static Border getHelpPanelBorder() { public static Border getHelpPanelBorder() {
return createLineBorder(getColor(0xACA899)); return createLineBorder(getColor(0xACA899));
} }
public static Color getErrorColor() {
return Color.red;
}
public static Color getLinkColor() { public static Color getLinkColor() {
return theme.getLinkSelectionForeground(); return theme.getLinkSelectionForeground();
} }
@ -75,7 +79,7 @@ public class ThemeSupport {
} }
public static Color getPassiveColor() { public static Color getPassiveColor() {
return Color.gray; return Color.lightGray;
} }
public static Color getVerificationColor() { public static Color getVerificationColor() {

View File

@ -3,10 +3,10 @@ package net.filebot.ui.list;
import static java.util.stream.Collectors.*; import static java.util.stream.Collectors.*;
import static javax.swing.BorderFactory.*; import static javax.swing.BorderFactory.*;
import static net.filebot.Settings.*; import static net.filebot.Settings.*;
import static net.filebot.ui.ThemeSupport.*;
import static net.filebot.util.ui.SwingUI.*; import static net.filebot.util.ui.SwingUI.*;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Toolkit; import java.awt.Toolkit;
import java.awt.datatransfer.StringSelection; import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable; import java.awt.datatransfer.Transferable;
@ -134,7 +134,7 @@ public class ListPanel extends JComponent {
Border defaultBorder = new JTextField().getBorder(); Border defaultBorder = new JTextField().getBorder();
Border okBorder = createCompoundBorder(defaultBorder, createEmptyBorder(2, 2, 2, 2)); 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); 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.FileUtilities.*;
import static net.filebot.util.ui.SwingUI.*; import static net.filebot.util.ui.SwingUI.*;
import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Cursor; import java.awt.Cursor;
import java.awt.Dimension; import java.awt.Dimension;
@ -539,7 +538,7 @@ public class FormatDialog extends JDialog {
status.setVisible(true); status.setVisible(true);
preview.setVisible(false); preview.setVisible(false);
editor.setForeground(Color.red); editor.setForeground(getErrorColor());
} }
} }

View File

@ -1,11 +1,11 @@
package net.filebot.ui.sfv; package net.filebot.ui.sfv;
import static java.awt.Color.*;
import static java.awt.Cursor.*; import static java.awt.Cursor.*;
import static java.awt.Font.*; import static java.awt.Font.*;
import static java.awt.RenderingHints.*; import static java.awt.RenderingHints.*;
import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Font; import java.awt.Font;
import java.awt.Graphics; import java.awt.Graphics;
@ -30,7 +30,7 @@ public class ChecksumButton extends JToggleButton {
setMinimumSize(getPreferredSize()); setMinimumSize(getPreferredSize());
setMaximumSize(getPreferredSize()); setMaximumSize(getPreferredSize());
setForeground(WHITE); setForeground(Color.white);
setFont(new Font(DIALOG, PLAIN, 11)); setFont(new Font(DIALOG, PLAIN, 11));
// as image button // 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, // if row state is ERROR and if we are not selected use text color RED,
// else use default table colors // 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()); setBackground(isSelected ? table.getSelectionBackground() : table.getBackground());
// use BOLD font on ERROR // use BOLD font on ERROR

View File

@ -384,12 +384,12 @@ class SubtitleAutoMatchDialog extends JDialog {
// no subtitles found // no subtitles found
setText("No subtitles found"); setText("No subtitles found");
setIcon(null); setIcon(null);
setForeground(Color.gray); setForeground(getPassiveColor());
} else { } else {
// no subtitles found // no subtitles found
setText("No subtitles selected"); setText("No subtitles selected");
setIcon(null); setIcon(null);
setForeground(Color.gray); setForeground(getPassiveColor());
} }
} else if (subtitleBean.getState() == StateValue.PENDING) { } else if (subtitleBean.getState() == StateValue.PENDING) {
// download in the queue // download in the queue
@ -429,7 +429,7 @@ class SubtitleAutoMatchDialog extends JDialog {
SubtitleDescriptorBean subtitleBean = (SubtitleDescriptorBean) value; SubtitleDescriptorBean subtitleBean = (SubtitleDescriptorBean) value;
if (isEditor && index == list.getModel().getSize() - 2) { 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) { if (value == null) {

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,7 @@
package net.filebot.util.ui; package net.filebot.util.ui;
import java.awt.Color; import static net.filebot.ui.ThemeSupport.*;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import javax.swing.Action; import javax.swing.Action;
@ -33,7 +34,7 @@ public class ActionPopup extends JPopupMenu {
actionPanel.setOpaque(false); actionPanel.setOpaque(false);
statusLabel.setFont(statusLabel.getFont().deriveFont(10f)); statusLabel.setFont(statusLabel.getFont().deriveFont(10f));
statusLabel.setForeground(Color.GRAY); statusLabel.setForeground(getPassiveColor());
setLayout(new MigLayout("nogrid, fill, insets 0")); 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); icon.paintIcon(c, g2d, 4, 3);
} }
g2d.setPaint(Color.BLACK); g2d.setPaint(Color.black);
g2d.fill(arrow); g2d.fill(arrow);
} }