|
8 | 8 | import de.doubleslash.keeptime.common.ConfigParser; |
9 | 9 | import de.doubleslash.keeptime.controller.Controller; |
10 | 10 | import de.doubleslash.keeptime.model.Model; |
11 | | -import javafx.event.ActionEvent; |
12 | | -import javafx.event.EventHandler; |
13 | 11 | import javafx.fxml.FXML; |
14 | 12 | import javafx.scene.control.Button; |
15 | 13 | import javafx.scene.control.CheckBox; |
16 | 14 | import javafx.scene.control.ColorPicker; |
| 15 | +import javafx.scene.paint.Color; |
17 | 16 | import javafx.stage.Stage; |
18 | 17 |
|
19 | 18 | public class SettingsController { |
@@ -64,9 +63,22 @@ public class SettingsController { |
64 | 63 |
|
65 | 64 | @FXML |
66 | 65 | private void initialize() { |
67 | | - |
68 | 66 | saveButton.setOnAction(ae -> { |
69 | 67 | LOG.info("Save clicked"); |
| 68 | + |
| 69 | + if (System.getProperty("os.name").contains("Linux")) { |
| 70 | + if (hoverBackgroundColor.getValue().getOpacity() < 0.5) { |
| 71 | + hoverBackgroundColor.setValue(Color.rgb((int) hoverBackgroundColor.getValue().getRed() * 255, |
| 72 | + (int) hoverBackgroundColor.getValue().getGreen() * 255, |
| 73 | + (int) hoverBackgroundColor.getValue().getBlue() * 255, 0.5)); |
| 74 | + } |
| 75 | + if (defaultBackgroundColor.getValue().getOpacity() < 0.5) { |
| 76 | + defaultBackgroundColor.setValue(Color.rgb((int) defaultBackgroundColor.getValue().getRed() * 255, |
| 77 | + (int) defaultBackgroundColor.getValue().getGreen() * 255, |
| 78 | + (int) defaultBackgroundColor.getValue().getBlue() * 255, 0.5)); |
| 79 | + } |
| 80 | + } |
| 81 | + |
70 | 82 | controller.updateSettings(hoverBackgroundColor.getValue(), hoverFontColor.getValue(), |
71 | 83 | defaultBackgroundColor.getValue(), defaultFontColor.getValue(), taskBarColor.getValue(), |
72 | 84 | useHotkeyCheckBox.isSelected(), displayProjectsRightCheckBox.isSelected()); |
@@ -94,13 +106,10 @@ private void initialize() { |
94 | 106 | taskBarColor.setValue(Model.originalTaskBarFontColor); |
95 | 107 | }); |
96 | 108 |
|
97 | | - parseConfigButton.setOnAction(new EventHandler<ActionEvent>() { |
98 | | - @Override |
99 | | - public void handle(final ActionEvent actionEvent) { |
100 | | - if (ConfigParser.hasConfigFile(INPUT_FILE)) { |
101 | | - final ConfigParser parser = new ConfigParser(model, controller); |
102 | | - parser.parserConfig(new File(INPUT_FILE)); |
103 | | - } |
| 109 | + parseConfigButton.setOnAction(ae -> { |
| 110 | + if (ConfigParser.hasConfigFile(INPUT_FILE)) { |
| 111 | + final ConfigParser parser = new ConfigParser(model, controller); |
| 112 | + parser.parserConfig(new File(INPUT_FILE)); |
104 | 113 | } |
105 | 114 | }); |
106 | 115 |
|
|
0 commit comments