Skip to content

Commit

Permalink
Code cleanup and ensuring min width for timescale.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemmermann committed Sep 9, 2022
1 parent 5fe9a58 commit 992e9d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@

import com.calendarfx.util.LoggingDomain;
import com.calendarfx.util.ViewHelper;
import com.calendarfx.view.DayEntryView;
import com.calendarfx.view.DayViewBase;
import javafx.application.Platform;
import javafx.beans.binding.Bindings;
import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.event.EventTarget;
import javafx.geometry.Insets;
import javafx.geometry.Orientation;
import javafx.scene.Node;
import javafx.scene.control.ScrollBar;
import javafx.scene.input.DragEvent;
import javafx.scene.input.MouseEvent;
Expand Down Expand Up @@ -218,19 +215,6 @@ private double getMaxTranslateY(Insets insets) {
return (getHeight() - insets.getTop() - insets.getBottom()) - dayView.getHeight();
}

private boolean isOnEntry(EventTarget target) {
if (target == null || !(target instanceof Node)) {
return false;
}

Node node = (Node) target;
if (node instanceof DayEntryView) {
return true;
}

return isOnEntry(node.getParent());
}

private void autoscrollIfNeeded(DragEvent evt) {
evt.acceptTransferModes(TransferMode.ANY);

Expand Down Expand Up @@ -297,7 +281,7 @@ class ScrollThread extends Thread {
private double yOffset;

public ScrollThread() {
super("Autoscrolling List View");
super("Autoscrolling ScrollPane");
setDaemon(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public DetailedDayViewSkin(DetailedDayView view) {
dayViewScrollPane = new DayViewScrollPane(dayView, scrollBar);
dayViewScrollPane.getStyleClass().addAll("calendar-scroll-pane", "day-view-scroll-pane");

// the time scale
// the timescale
TimeScaleView timeScale = view.getTimeScaleView();
Bindings.bindBidirectional(timeScale.translateYProperty(), dayView.translateYProperty());

Expand All @@ -91,6 +91,7 @@ public DetailedDayViewSkin(DetailedDayView view) {
// time scale scroll pane
timeScaleScrollPane = new DayViewScrollPane(timeScale, scrollBar);
timeScaleScrollPane.getStyleClass().addAll("calendar-scroll-pane", "day-view-timescale-scroll-pane");
timeScaleScrollPane.setMinWidth(Region.USE_PREF_SIZE);

// separator
separator = new Separator(Orientation.VERTICAL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public DetailedWeekViewSkin(DetailedWeekView view) {

timeScaleScrollPane = new DayViewScrollPane(timeScale, scrollBar);
timeScaleScrollPane.getStyleClass().addAll("timescale-scroll-pane");
timeScaleScrollPane.setMinWidth(Region.USE_PREF_SIZE);

// synchronous scrolling
Bindings.bindBidirectional(timeScale.translateYProperty(), weekView.translateYProperty());
Expand Down

0 comments on commit 992e9d9

Please sign in to comment.