Skip to content

Commit

Permalink
Modules pane correct scroll behaviour.
Browse files Browse the repository at this point in the history
Avoid issues with Region and FlowPane where children where stacked
  • Loading branch information
torakiki committed Dec 14, 2016
1 parent 8049a76 commit bb16a8b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Expand Up @@ -30,6 +30,7 @@

import javafx.scene.control.Button;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.ScrollPane.ScrollBarPolicy;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.text.TextAlignment;
Expand All @@ -54,8 +55,10 @@ class DashboardItemPane extends BorderPane {
this.item.pane().getStyleClass().addAll(Style.DEAULT_CONTAINER.css());
this.item.pane().getStyleClass().addAll(Style.CONTAINER.css());
ScrollPane scroll = new ScrollPane(this.item.pane());
scroll.setFitToHeight(true);
scroll.getStyleClass().addAll(Style.DEAULT_CONTAINER.css());
scroll.setFitToWidth(true);
scroll.setHbarPolicy(ScrollBarPolicy.NEVER);
scroll.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
setCenter(scroll);
eventStudio().add(SetActiveModuleRequest.class, enableFooterListener, Integer.MAX_VALUE,
ReferenceStrength.STRONG);
Expand Down
Expand Up @@ -38,10 +38,9 @@
* @author Andrea Vacondio
*
*/
class DashboardTile extends Region {
class DashboardTile extends VBox {
private static final PseudoClass ARMED_PSEUDOCLASS_STATE = PseudoClass.getPseudoClass("armed");

VBox bottom = new VBox();
private Button button = new Button();

public DashboardTile(String title, String description, Node graphic) {
Expand All @@ -61,12 +60,10 @@ public DashboardTile(String title, String description, Node graphic) {
button.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);

armed.bind(button.armedProperty());
bottom.getChildren().addAll(new StackPane(topTile, button));
bottom.getStyleClass().add("dashboard-modules-tile-inner");
prefHeightProperty().bind(bottom.heightProperty());
getChildren().addAll(new StackPane(topTile, button));
getStyleClass().add("dashboard-modules-tile-inner");
setMaxHeight(USE_PREF_SIZE);
setMinHeight(USE_PREF_SIZE);
getChildren().add(bottom);
}

/**
Expand All @@ -92,6 +89,6 @@ public final void setOnAction(EventHandler<ActionEvent> eventHandler) {
}

void addBottomPanel(Region pane) {
bottom.getChildren().add(pane);
getChildren().add(pane);
}
}

0 comments on commit bb16a8b

Please sign in to comment.