From b9693bf88457ca9fff64d6d4dd9519a86b72cf49 Mon Sep 17 00:00:00 2001 From: Ralf Wisser Date: Wed, 26 Jun 2024 09:42:54 +0200 Subject: [PATCH] DarkLAF, further steps --- src/main/gui/net/sf/jailer/ui/Colors.java | 12 +++--------- .../gui/net/sf/jailer/ui/DataModelManagerDialog.form | 7 ++++++- .../gui/net/sf/jailer/ui/DataModelManagerDialog.java | 5 +++-- .../gui/net/sf/jailer/ui/DbConnectionSettings.java | 6 +----- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/main/gui/net/sf/jailer/ui/Colors.java b/src/main/gui/net/sf/jailer/ui/Colors.java index 07c4123d0..6cf45d0c6 100644 --- a/src/main/gui/net/sf/jailer/ui/Colors.java +++ b/src/main/gui/net/sf/jailer/ui/Colors.java @@ -21,7 +21,6 @@ import java.awt.RenderingHints; import java.awt.Window; import java.awt.color.ColorSpace; -import java.awt.event.ActionListener; import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; import java.awt.image.ColorModel; @@ -31,7 +30,6 @@ import java.util.ArrayList; import java.util.List; -import javax.swing.JMenuItem; import javax.swing.Timer; import net.sf.jailer.ui.UIUtil.PLAF; @@ -137,7 +135,8 @@ private static void initColors() { Color_ExportDialogModifiedPropertiesBackGround.init(new Color(255, 255, 180), new Color(90, 90, 0)); Color_255_255_205.init(new Color(255, 255, 205), new Color(80, 70, 0)); - + Color_255_230_230.init(new Color(255, 210, 210), new Color(85, 28, 28)); + // TODO check "tranparent" todos Color_0_0_1.init(new Color(0, 0, 1), Color_0_0_0.dark); @@ -236,7 +235,6 @@ private static void initColors() { Color_255_220_220.init(new Color(255, 220, 220)); Color_255_230_200.init(new Color(255, 230, 200)); Color_255_230_220.init(new Color(255, 230, 220)); - Color_255_230_230.init(new Color(255, 230, 230)); Color_255_236_236.init(new Color(255, 236, 236)); Color_255_240_240.init(new Color(255, 240, 240)); Color_255_242_240.init(new Color(255, 242, 240)); @@ -473,7 +471,7 @@ private static void initColors() { public static void init() { if (!timerIsInitialized) { - inDarkLAFMode = "true".equals(System.getProperty("darkLAF")); // TODO +// inDarkLAFMode = "true".equals(System.getProperty("darkLAF")); // TODO remove if (inDarkLAFMode) { Timer timer = new Timer(1000, e -> init()); timer.setInitialDelay(1000); @@ -715,7 +713,3 @@ public int getTransparency() { } } - -//TODO -//TODO connectiondialog: red-bg (empty mand.field) is ugly - diff --git a/src/main/gui/net/sf/jailer/ui/DataModelManagerDialog.form b/src/main/gui/net/sf/jailer/ui/DataModelManagerDialog.form index 172826d33..f850d8d41 100644 --- a/src/main/gui/net/sf/jailer/ui/DataModelManagerDialog.form +++ b/src/main/gui/net/sf/jailer/ui/DataModelManagerDialog.form @@ -1003,12 +1003,17 @@ + + + + + - + diff --git a/src/main/gui/net/sf/jailer/ui/DataModelManagerDialog.java b/src/main/gui/net/sf/jailer/ui/DataModelManagerDialog.java index 7dc26fdee..cabbfac45 100644 --- a/src/main/gui/net/sf/jailer/ui/DataModelManagerDialog.java +++ b/src/main/gui/net/sf/jailer/ui/DataModelManagerDialog.java @@ -209,7 +209,7 @@ public DataModelManagerDialog(String applicationName, boolean withLoadJMButton, "Select a layout."); UIUtil.replace(infoBarLabeRecUsedlBookmark, infoBarRecUsedBookmark); - restoreButton.setIcon(UIUtil.scaleIcon(restoreButton, histIcon)); + restoreButton.setIcon(UIUtil.scaleIcon(restoreButton, histIcon, 1.15)); okButton.setIcon(UIUtil.scaleIcon(jmOkButton, okIcon)); jmOkButton.setIcon(UIUtil.scaleIcon(okButton, okIcon)); jButton2.setIcon(UIUtil.scaleIcon(jButton2, cancelIcon)); @@ -2540,12 +2540,13 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { jPanel10.setBackground(/* Renaming also in *.form! */ Colors.Color_255_255_255); jPanel10.setLayout(new java.awt.GridBagLayout()); + restoreButton.setFont(restoreButton.getFont().deriveFont(restoreButton.getFont().getSize()+4f)); restoreButton.setText("Restore"); restoreButton.setFocusCycleRoot(true); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 2; - gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 4); + gridBagConstraints.insets = new java.awt.Insets(2, 4, 2, 4); jPanel10.add(restoreButton, gridBagConstraints); dummyLabel.setText(" "); diff --git a/src/main/gui/net/sf/jailer/ui/DbConnectionSettings.java b/src/main/gui/net/sf/jailer/ui/DbConnectionSettings.java index 471b6c16f..3335dedc4 100644 --- a/src/main/gui/net/sf/jailer/ui/DbConnectionSettings.java +++ b/src/main/gui/net/sf/jailer/ui/DbConnectionSettings.java @@ -462,11 +462,7 @@ private void updateDefaultAllButton() { boolean enabled = false; boolean selected = true; Color red; - if (pTextFieldBGColor != null && pTextFieldBGColor.getRed() + pTextFieldBGColor.getBlue() + pTextFieldBGColor.getGreen() < (256 * 3) / 2) { - red = Colors.Color_150_0_0; - } else { - red = DbConnectionDetailsEditor.RED; - } + red = DbConnectionDetailsEditor.RED; for (int i = 0; i < pTextField.length; ++i) { if (defaultButton[i].isVisible()) { enabled |= defaultButton[i].isEnabled();