Skip to content

Commit

Permalink
Merge pull request #207 from dlsc-software-consulting-gmbh/fix-indica…
Browse files Browse the repository at this point in the history
…tor-height

Set minimum height for indicators and restrict vertical growth.
  • Loading branch information
dlemmermann authored Sep 12, 2024
2 parents 123da72 + 87822cc commit 9be9d47
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ public MonthBox(Month month, YearMonthView view) {

Region indicator = new Region();
indicator.getStyleClass().add("indicator");
indicator.setMinHeight(Region.USE_PREF_SIZE);
VBox.setVgrow(indicator, Priority.NEVER);

getChildren().setAll(monthLabel, indicator);
GridPane.setMargin(this, new Insets(10, 30, 10, 30));
Expand Down
12 changes: 10 additions & 2 deletions gemsfx/src/main/java/com/dlsc/gemsfx/skins/YearViewSkin.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@
import javafx.beans.InvalidationListener;
import javafx.beans.binding.Bindings;
import javafx.event.Event;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.control.SkinBase;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.*;
import javafx.scene.layout.ColumnConstraints;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.layout.Region;
import javafx.scene.layout.RowConstraints;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.shape.Rectangle;

import java.time.LocalDate;
Expand Down Expand Up @@ -164,6 +170,8 @@ private Node createYearNode(int year) {
Region selectionIndicator = new Region();
selectionIndicator.visibleProperty().bind(Bindings.createBooleanBinding(() -> view.getYear() == year, view.valueProperty()));
selectionIndicator.getStyleClass().add("selection-indicator");
selectionIndicator.setMinHeight(Region.USE_PREF_SIZE);
VBox.setVgrow(selectionIndicator, Priority.NEVER);

VBox box = new VBox(yearLabel, selectionIndicator);
box.setMaxWidth(Region.USE_PREF_SIZE);
Expand Down

0 comments on commit 9be9d47

Please sign in to comment.