1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-08-13 17:03:45 -04:00

Fix various Dark Mode issues

This commit is contained in:
Reinhard Pointner 2019-02-27 22:58:09 +07:00
parent 2cade64f44
commit 7836249b1a
4 changed files with 20 additions and 6 deletions

View File

@ -62,6 +62,10 @@ public class ThemeSupport {
return createLineBorder(getColor(0xACA899));
}
public static Color getLinkColor() {
return theme.getLinkSelectionForeground();
}
public static LinearGradientPaint getPanelBackgroundGradient(int x, int y, int w, int h) {
float[] gradientFractions = { 0.0f, 0.5f, 1.0f };
Color[] gradientColors = { getColor(0xF6F6F6), getColor(0xF8F8F8), getColor(0xF3F3F3) };
@ -120,6 +124,11 @@ public class ThemeSupport {
public boolean isDark() {
return true;
}
@Override
public Color getLinkSelectionForeground() {
return new Color(0x5195C4);
}
},
Nimbus {
@ -146,6 +155,10 @@ public class ThemeSupport {
return false;
}
public Color getLinkSelectionForeground() {
return new Color(0x3399FF);
}
public abstract void setLookAndFeel() throws Exception;
public static Theme forName(String name) {

View File

@ -223,9 +223,9 @@ public class FormatDialog extends JDialog {
editor.setBackground(template.getBackground());
content.add(editorScrollPane, "w 120px:min(pref, 420px), h pref, growx, wrap 4px, id editor");
content.add(createImageButton(changeSampleAction), "sg action, w 25!, h 19!, pos n editor.y2+2 editor.x2 n");
content.add(createImageButton(selectFolderAction), "sg action, w 25!, h 19!, pos n editor.y2+2 editor.x2-(27*1) n");
content.add(createImageButton(showRecentAction), "sg action, w 25!, h 19!, pos n editor.y2+2 editor.x2-(27*2) n");
content.add(createImageButton(changeSampleAction), "sg action, w 27!, h 24!, pos n editor.y2+2 editor.x2 n");
content.add(createImageButton(selectFolderAction), "sg action, w 27!, h 24!, pos n editor.y2+2 editor.x2-(27*1) n");
content.add(createImageButton(showRecentAction), "sg action, w 27!, h 24!, pos n editor.y2+2 editor.x2-(27*2) n");
content.add(help, "growx, wrap 25px:push");

View File

@ -1,6 +1,7 @@
package net.filebot.util.ui;
import static net.filebot.Logging.*;
import static net.filebot.ui.ThemeSupport.*;
import java.awt.Color;
import java.awt.Cursor;
@ -20,7 +21,7 @@ import javax.swing.JButton;
public class LinkButton extends JButton {
private Color color = getForeground();
private Color rolloverColor = new Color(0x3399FF);
private Color rolloverColor = getLinkColor();
public LinkButton(String text, String tooltip, Icon icon, URI uri) {
this(new OpenUriAction(text, tooltip, icon, uri));

View File

@ -3,6 +3,7 @@ package net.filebot.util.ui;
import static java.util.Collections.*;
import static javax.swing.JOptionPane.*;
import static net.filebot.Logging.*;
import static net.filebot.Settings.*;
import java.awt.Color;
import java.awt.Component;
@ -62,7 +63,6 @@ import javax.swing.undo.UndoManager;
import javafx.application.Platform;
import javafx.embed.swing.JFXPanel;
import net.filebot.Settings;
public final class SwingUI {
@ -156,7 +156,7 @@ public final class SwingUI {
// fix Windows 10 button padding
button.setMaximumSize(new Dimension(36, 36));
if (Settings.isMacApp()) {
if (isMacApp()) {
button.setPreferredSize(new Dimension(28, 27));
} else {
button.setPreferredSize(new Dimension(26, 26));