diff --git a/jfxui/src/main/java/org/itsallcode/whiterabbit/jfxui/table/days/DayRecordTable.java b/jfxui/src/main/java/org/itsallcode/whiterabbit/jfxui/table/days/DayRecordTable.java index 2623fc08..18d2ecc8 100644 --- a/jfxui/src/main/java/org/itsallcode/whiterabbit/jfxui/table/days/DayRecordTable.java +++ b/jfxui/src/main/java/org/itsallcode/whiterabbit/jfxui/table/days/DayRecordTable.java @@ -39,6 +39,9 @@ public class DayRecordTable { private static final Logger LOG = LogManager.getLogger(DayRecordTable.class); + private static final double COL_WIDTH_MEDIUM = 70; + private static final double COL_WIDTH_SMALL = 55; + private static final double COL_WIDTH_COMMENT = 220; private final ObservableList dayRecords = FXCollections.observableArrayList(); private final EditListener editListener; @@ -208,6 +211,17 @@ public void selectRow(final LocalDate date) () -> new AutoCompleteTextField(autocompleteService.dayCommentAutocompleter())), data -> data.getValue().comment); + dateCol.setPrefWidth(COL_WIDTH_MEDIUM); + dayTypeCol.setPrefWidth(COL_WIDTH_MEDIUM); + beginCol.setPrefWidth(COL_WIDTH_SMALL); + endCol.setPrefWidth(COL_WIDTH_SMALL); + breakCol.setPrefWidth(COL_WIDTH_SMALL); + interruptionCol.setPrefWidth(COL_WIDTH_SMALL); + workingTimeCol.setPrefWidth(COL_WIDTH_SMALL); + overTimeCol.setPrefWidth(COL_WIDTH_SMALL); + totalOvertimeCol.setPrefWidth(COL_WIDTH_SMALL); + commentCol.setPrefWidth(COL_WIDTH_COMMENT); + return List.of(dateCol, dayTypeCol, beginCol, endCol, breakCol, interruptionCol, workingTimeCol, overTimeCol, totalOvertimeCol, commentCol); } diff --git a/jfxui/src/main/resources/org/itsallcode/whiterabbit/jfxui/table/days/style.css b/jfxui/src/main/resources/org/itsallcode/whiterabbit/jfxui/table/days/style.css index ef2ff99f..a2dea017 100644 --- a/jfxui/src/main/resources/org/itsallcode/whiterabbit/jfxui/table/days/style.css +++ b/jfxui/src/main/resources/org/itsallcode/whiterabbit/jfxui/table/days/style.css @@ -3,13 +3,11 @@ TableView#day-table { } #day-table #date { - -fx-alignment: CENTER_RIGHT; - -fx-pref-width: 6em; + -fx-alignment: CENTER_LEFT; } #day-table #day-type { -fx-alignment: CENTER_LEFT; - -fx-pref-width: 6em; } #day-table #begin, @@ -18,28 +16,24 @@ TableView#day-table { #day-table #interruption, #day-table #working-time, #day-table #overtime, -#day-table #total-overtime -{ +#day-table #total-overtime { -fx-alignment: CENTER; - -fx-pref-width: 4em; } -#day-table #comment -{ - -fx-pref-width: 20em; -} +#day-table #comment {} .table-row-cell:not-working { - -fx-background-color: -fx-table-cell-border-color, lightyellow; + -fx-background-color: -fx-table-cell-border-color, lightyellow; } .table-row-cell:weekend { - -fx-background-color: -fx-table-cell-border-color, #f8eeee; + -fx-background-color: -fx-table-cell-border-color, #f8eeee; } .table-row-cell:not-working:selected { - -fx-background-color: -fx-focus-color, -fx-cell-focus-inner-border, -fx-selection-bar; + -fx-background-color: -fx-focus-color, -fx-cell-focus-inner-border, -fx-selection-bar; } + .table-row-cell:weekend:selected { - -fx-background-color: -fx-focus-color, -fx-cell-focus-inner-border, -fx-selection-bar; -} + -fx-background-color: -fx-focus-color, -fx-cell-focus-inner-border, -fx-selection-bar; +} \ No newline at end of file