Skip to content

Commit

Permalink
DarkLAF, further steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf Wisser committed Jun 26, 2024
1 parent ac346b5 commit b9693bf
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
12 changes: 3 additions & 9 deletions src/main/gui/net/sf/jailer/ui/Colors.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -715,7 +713,3 @@ public int getTransparency() {
}
}


//TODO
//TODO connectiondialog: red-bg (empty mand.field) is ugly

7 changes: 6 additions & 1 deletion src/main/gui/net/sf/jailer/ui/DataModelManagerDialog.form
Original file line number Diff line number Diff line change
Expand Up @@ -1003,12 +1003,17 @@
<SubComponents>
<Component class="javax.swing.JButton" name="restoreButton">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor">
<FontInfo relative="true">
<Font component="restoreButton" property="font" relativeSize="true" size="4"/>
</FontInfo>
</Property>
<Property name="text" type="java.lang.String" value="Restore"/>
<Property name="focusCycleRoot" type="boolean" value="true"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="3" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="2" insetsLeft="2" insetsBottom="2" insetsRight="4" anchor="10" weightX="0.0" weightY="0.0"/>
<GridBagConstraints gridX="3" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="2" insetsLeft="4" insetsBottom="2" insetsRight="4" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
Expand Down
5 changes: 3 additions & 2 deletions src/main/gui/net/sf/jailer/ui/DataModelManagerDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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(" ");
Expand Down
6 changes: 1 addition & 5 deletions src/main/gui/net/sf/jailer/ui/DbConnectionSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit b9693bf

Please sign in to comment.