Skip to content

Commit 94ecdf9

Browse files
committed
#57: Due to not wrapping correctly most of the time, the text field for the note in the report view is changed to a label. Furthermore for the sake of better contrast and readability the background color of the selected row is set to doubleSlash brand blue and the text color remains white.
1 parent 25fd8d3 commit 94ecdf9

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
import javafx.scene.layout.GridPane;
7373
import javafx.scene.layout.HBox;
7474
import javafx.scene.shape.Circle;
75-
import javafx.scene.text.Text;
7675
import javafx.stage.Stage;
7776
import javafx.util.Callback;
7877

@@ -85,6 +84,8 @@ public class ReportController {
8584

8685
private static final String FX_BACKGROUND_COLOR_NOT_WORKED = "-fx-background-color: #BBBBBB;";
8786

87+
private static final String FX_BACKGROUND_COLOR_WORKED = "-fx-background-color: #00a5e1;";
88+
8889
private static final String EDIT_WORK_DIALOG_TITLE = "Edit work";
8990

9091
@FXML
@@ -148,10 +149,9 @@ protected void updateItem(final TableRow item, final boolean empty) {
148149
setGraphic(null);
149150
setText(null);
150151
} else {
151-
final Text text = new Text(item.getNotes());
152-
text.wrappingWidthProperty().bind(noteColumn.widthProperty().subtract(35));
153-
text.setUnderline(item.isUnderlined());
154-
this.setGraphic(text);
152+
final Label label = new Label(item.getNotes());
153+
label.setUnderline(item.isUnderlined());
154+
this.setGraphic(label);
155155
}
156156
}
157157
};
@@ -263,6 +263,9 @@ public void updateItem(final LocalDate item, final boolean empty) {
263263
if (model.getWorkRepository().findByStartDateOrderByStartTimeAsc(item).isEmpty()) {
264264
setDisable(true);
265265
setStyle(FX_BACKGROUND_COLOR_NOT_WORKED);
266+
} else {
267+
setDisable(false);
268+
setStyle(FX_BACKGROUND_COLOR_WORKED);
266269
}
267270
}
268271

src/main/resources/css/dialog.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
-fx-padding:0px;
1313
-fx-margin:0px
1414
}
15+
.tree-table-row-cell:selected {
16+
-fx-background-color: #00a5e1;
17+
}
1518
.tree-table-row-cell .arrow {
1619
-fx-padding:4px;
1720
}

0 commit comments

Comments
 (0)