Skip to content

Commit 2738f3d

Browse files
authored
Merge pull request #15 from doubleSlashde/revert-14-feature/#13_hideProjectsSetting
Revert "Feature/#13 hide projects setting"
2 parents 4359f5f + 882c567 commit 2738f3d

File tree

10 files changed

+107
-185
lines changed

10 files changed

+107
-185
lines changed

src/main/java/de/doubleslash/keeptime/Main.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ public void start(final Stage primaryStage) throws Exception {
7878
settings.setHoverFontColor(model.hoverFontColor.get());
7979
settings.setUseHotkey(false);
8080
settings.setDisplayProjectsRight(false);
81-
settings.setHideProjectsOnMouseExit(true);
8281
model.settingsRepository.save(settings);
8382
} else {
8483
settings = settingsList.get(0);
@@ -91,7 +90,6 @@ public void start(final Stage primaryStage) throws Exception {
9190
model.taskBarColor.set(settings.getTaskBarColor());
9291
model.useHotkey.set(settings.isUseHotkey());
9392
model.displayProjectsRight.set(settings.isDisplayProjectsRight());
94-
model.hideProjectsOnMouseExit.set(settings.isHideProjectsOnMouseExit());
9593

9694
final List<Work> todaysWorkItems = model.workRepository.findByCreationDate(LocalDate.now());
9795
LOG.info("Found {} past work items", todaysWorkItems.size());

src/main/java/de/doubleslash/keeptime/controller/Controller.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void addNewProject(final String projectName, final boolean isWork, final
9191

9292
public void updateSettings(final Color hoverBackgroundColor, final Color hoverFontColor,
9393
final Color defaultBackgroundColor, final Color defaultFontColor, final Color taskBarColor,
94-
final boolean useHotkey, final boolean displayProjectsRight, final boolean hideProjectsOnMouseExit) {
94+
final boolean useHotkey, final boolean displayProjectsRight) {
9595
// TODO create holder for all the properties (or reuse Settings.class?)
9696
final Settings settings = model.settingsRepository.findAll().get(0);
9797
settings.setTaskBarColor(taskBarColor);
@@ -103,7 +103,6 @@ public void updateSettings(final Color hoverBackgroundColor, final Color hoverFo
103103
settings.setHoverFontColor(hoverFontColor);
104104
settings.setUseHotkey(useHotkey);
105105
settings.setDisplayProjectsRight(displayProjectsRight);
106-
settings.setHideProjectsOnMouseExit(hideProjectsOnMouseExit);
107106

108107
model.settingsRepository.save(settings);
109108

@@ -114,7 +113,6 @@ public void updateSettings(final Color hoverBackgroundColor, final Color hoverFo
114113
model.taskBarColor.set(settings.getTaskBarColor());
115114
model.useHotkey.set(settings.isUseHotkey());
116115
model.displayProjectsRight.set(settings.isDisplayProjectsRight());
117-
model.hideProjectsOnMouseExit.set(settings.isHideProjectsOnMouseExit());
118116
}
119117

120118
@PreDestroy
@@ -163,13 +161,13 @@ public void editProject(final Project p, final String newName, final Color newCo
163161
* Changes the indexes of the originalList parameter to have a consistent order.
164162
*
165163
* @param originalList
166-
* list of all projects to adapt the indexes for
164+
* list of all projects to adapt the indexes for
167165
* @param changedProject
168-
* the project which has changed which already has the new index
166+
* the project which has changed which already has the new index
169167
* @param oldIndex
170-
* the old index of the changed project
168+
* the old index of the changed project
171169
* @param newIndex
172-
* the new index of the changed project (which the projects also already has)
170+
* the new index of the changed project (which the projects also already has)
173171
* @return all projects whose index has been adapted
174172
*/
175173
List<Project> resortProjectIndexes(final List<Project> originalList, final Project changedProject,
@@ -211,9 +209,9 @@ List<Project> resortProjectIndexes(final List<Project> originalList, final Proje
211209
* Decreases all indexes by one, after the removed index
212210
*
213211
* @param originalList
214-
* list of all projects to adapt the indexes for
212+
* list of all projects to adapt the indexes for
215213
* @param removedIndex
216-
* the index which has been removed
214+
* the index which has been removed
217215
* @return all projects whose index has been adapted
218216
*/
219217
List<Project> adaptProjectIndexesAfterRemoving(final List<Project> originalList, final int removedIndex) {

src/main/java/de/doubleslash/keeptime/model/Model.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ public Model(final ProjectRepository projectRepository, final WorkRepository wor
5959
public ObjectProperty<Color> defaultFontColor = new SimpleObjectProperty<>(originalDefaultFontColor);
6060
public ObjectProperty<Boolean> useHotkey = new SimpleObjectProperty<>(false);
6161
public ObjectProperty<Boolean> displayProjectsRight = new SimpleObjectProperty<>(false);
62-
public ObjectProperty<Boolean> hideProjectsOnMouseExit = new SimpleObjectProperty<>(true);
62+
6363
}

src/main/java/de/doubleslash/keeptime/model/Settings.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ public class Settings {
4141

4242
private boolean displayProjectsRight;
4343

44-
private boolean hideProjectsOnMouseExit;
45-
4644
public long getId() {
4745
return id;
4846
}
@@ -103,12 +101,4 @@ public void setDisplayProjectsRight(final boolean displayProjectsRight) {
103101
this.displayProjectsRight = displayProjectsRight;
104102
}
105103

106-
public boolean isHideProjectsOnMouseExit() {
107-
return hideProjectsOnMouseExit;
108-
}
109-
110-
public void setHideProjectsOnMouseExit(final boolean hideProjectsOnMouseExit) {
111-
this.hideProjectsOnMouseExit = hideProjectsOnMouseExit;
112-
}
113-
114104
}

src/main/java/de/doubleslash/keeptime/view/SettingsController.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ public class SettingsController {
4747
private CheckBox useHotkeyCheckBox;
4848
@FXML
4949
private CheckBox displayProjectsRightCheckBox;
50-
@FXML
51-
private CheckBox hideProjectsOnMouseExitCheckBox;
5250

5351
@FXML
5452
private Button saveButton;
@@ -77,8 +75,7 @@ private void initialize() {
7775
LOG.info("Save clicked");
7876
controller.updateSettings(hoverBackgroundColor.getValue(), hoverFontColor.getValue(),
7977
defaultBackgroundColor.getValue(), defaultFontColor.getValue(), taskBarColor.getValue(),
80-
useHotkeyCheckBox.isSelected(), displayProjectsRightCheckBox.isSelected(),
81-
hideProjectsOnMouseExitCheckBox.isSelected());
78+
useHotkeyCheckBox.isSelected(), displayProjectsRightCheckBox.isSelected());
8279
thisStage.close();
8380
});
8481

@@ -133,7 +130,6 @@ void update() {
133130

134131
useHotkeyCheckBox.setSelected(model.useHotkey.get());
135132
displayProjectsRightCheckBox.setSelected(model.displayProjectsRight.get());
136-
hideProjectsOnMouseExitCheckBox.setSelected(model.hideProjectsOnMouseExit.get());
137133
}
138134

139135
public void setStage(final Stage thisStage) {

src/main/java/de/doubleslash/keeptime/view/ViewController.java

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,17 @@ private void initialize() throws IOException {
182182

183183
// reposition window if projects are hidden (as anchor is top left)
184184
mouseHoveringProperty.addListener((a, b, c) -> {
185-
if (!model.hideProjectsOnMouseExit.get()) {
186-
setProjectListVisible(true);
187-
return;
185+
// TODO fix the not so nice jumping..
186+
projectsVBox.setManaged(c);
187+
final double beforeWidth = mainStage.getWidth();
188+
mainStage.sizeToScene();
189+
final double afterWidth = mainStage.getWidth();
190+
projectsVBox.setVisible(c);
191+
final double offset = afterWidth - beforeWidth;
192+
if (!model.displayProjectsRight.get()) {
193+
// we only need to move the stage if the node on the left is hidden
194+
mainStage.setX(mainStage.getX() - offset);
188195
}
189-
190-
setProjectListVisible(c);
191196
});
192197

193198
minimizeButton.setOnAction((ae) -> {
@@ -442,20 +447,6 @@ private void initialize() throws IOException {
442447

443448
}
444449

445-
private void setProjectListVisible(final Boolean c) {
446-
// TODO fix the not so nice jumping..
447-
projectsVBox.setManaged(c);
448-
final double beforeWidth = mainStage.getWidth();
449-
mainStage.sizeToScene();
450-
final double afterWidth = mainStage.getWidth();
451-
projectsVBox.setVisible(c);
452-
final double offset = afterWidth - beforeWidth;
453-
if (!model.displayProjectsRight.get()) {
454-
// we only need to move the stage if the node on the left is hidden
455-
mainStage.setX(mainStage.getX() - offset);
456-
}
457-
}
458-
459450
private void loadSubStages() {
460451
try {
461452
// Report stage

src/main/resources/ProjectDetailLayout.fxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<?import javafx.scene.control.Label?>
44
<?import javafx.scene.layout.Pane?>
55

6-
<Pane minHeight="-Infinity" prefHeight="14.0" prefWidth="114.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1">
6+
<Pane minHeight="-Infinity" prefHeight="17.0" prefWidth="114.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1">
77
<children>
88
<Label prefWidth="70.0" text="Projectname" />
99
<Label layoutX="69.0" prefWidth="45.0" text="00:00:00" />

src/main/resources/db/migration/V0_0_2__addedHideProjectsSetting.sql

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/main/resources/menu.css

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)