Skip to content

Commit

Permalink
Fixed showTodayProperty() bindings.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemmermann committed Sep 15, 2022
1 parent 07e4410 commit 0d040bb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ public abstract class DayViewBase extends DateControl implements ZonedDateTimePr
* Constructs a new view.
*/
public DayViewBase() {
scrollingEnabledProperty().addListener(it -> Thread.dumpStack());

MapChangeListener<? super Object, ? super Object> propertiesListener = change -> {
if (change.wasAdded()) {
if (change.getKey().equals("show.current.time.marker")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,29 +73,27 @@ public DetailedWeekView() {
public DetailedWeekView(int numberOfDays) {
setNumberOfDays(numberOfDays);


getStyleClass().add(DEFAULT_STYLE_CLASS);

calendarHeaderView = new CalendarHeaderView();
calendarHeaderView.numberOfDaysProperty().bind(numberOfDaysProperty());
calendarHeaderView.numberOfDaysProperty().bindBidirectional(numberOfDaysProperty());
calendarHeaderView.bind(this);

weekDayHeaderView = new WeekDayHeaderView();
weekDayHeaderView.showTodayProperty().bind(showTodayProperty());
weekDayHeaderView.showTodayProperty().bindBidirectional(showTodayProperty());

bind(weekDayHeaderView, true);
Bindings.bindBidirectional(weekDayHeaderView.numberOfDaysProperty(), numberOfDaysProperty());
Bindings.bindBidirectional(weekDayHeaderView.adjustToFirstDayOfWeekProperty(), adjustToFirstDayOfWeekProperty());

allDayView = new AllDayView(getNumberOfDays());
allDayView.showTodayProperty().bind(showTodayProperty());

bind(allDayView, true);
Bindings.bindBidirectional(allDayView.numberOfDaysProperty(), numberOfDaysProperty());
Bindings.bindBidirectional(allDayView.adjustToFirstDayOfWeekProperty(), adjustToFirstDayOfWeekProperty());

weekView = new WeekView();
weekView.showTodayProperty().bind(showTodayProperty());

bind(weekView, true);
Bindings.bindBidirectional(weekView.numberOfDaysProperty(), numberOfDaysProperty());
Bindings.bindBidirectional(weekView.adjustToFirstDayOfWeekProperty(), adjustToFirstDayOfWeekProperty());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public WeekView(int numberOfDays) {

setWeekDayViewFactory(param -> new WeekDayView());
setNumberOfDays(numberOfDays);
setShowToday(true);

dateProperty().addListener(it -> updateStartAndEndDates());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public DetailedDayViewSkin(DetailedDayView view) {

// the all-day view
allDayView = view.getAllDayView();
allDayView.showTodayProperty().unbindBidirectional(view.showTodayProperty());
allDayView.setShowToday(false);
allDayView.setAdjustToFirstDayOfWeek(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ protected Node createRightHandSide() {
getSkinnable().bind(dayView, true);

AllDayView allDayView = dayView.getAllDayView();
allDayView.showTodayProperty().unbind(); // we need control over this
allDayView.showTodayProperty().unbindBidirectional(dayView.showTodayProperty()); // we need control over this

return dayView;
}
Expand Down

0 comments on commit 0d040bb

Please sign in to comment.