Skip to content

Commit

Permalink
Added initial support for a drawer control.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemmermann committed Aug 28, 2024
1 parent 1f849d8 commit fa7e032
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,19 +173,20 @@ private Node createDrawerContent() {
ToggleButton title = new ToggleButton("Content");
title.setMaxWidth(Double.MAX_VALUE);
title.getStyleClass().add("title");
title.selectedProperty().bindBidirectional(showDrawerProperty());

final int HEIGHT = 200;

CategoriesPane content = new CategoriesPane();
content.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
content.setAlignment(Pos.CENTER);
content.setPrefHeight(HEIGHT);
VBox.setVgrow(content, Priority.ALWAYS);

VBox drawer = new VBox(title, content);
drawer.getStyleClass().add("drawer");
drawer.setPrefHeight(300);
drawer.setMaxHeight(Region.USE_PREF_SIZE);

drawer.translateYProperty().bind(Bindings.createDoubleBinding(() -> isShowDrawer() ? 0d : drawer.getHeight() - title.getHeight(), showDrawer));
drawer.translateYProperty().bind(Bindings.createDoubleBinding(() -> title.isSelected() ? 0d: HEIGHT, title.selectedProperty()));

Rectangle clip = new Rectangle();
clip.widthProperty().bind(drawer.widthProperty());
Expand All @@ -196,16 +197,6 @@ private Node createDrawerContent() {
return drawer;
}

private final BooleanProperty showDrawer = new SimpleBooleanProperty(this, "showDrawer", true);

public boolean isShowDrawer() {
return showDrawer.get();
}

public BooleanProperty showDrawerProperty() {
return showDrawer;
}

private <T extends ModelObject> List<T> getRandomSample(List<T> list, int sampleSize) {
if (sampleSize > list.size()) {
throw new IllegalArgumentException("Sample size must be less than or equal to the size of the list");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@
*/
.mobile-search-text-field {
-fx-background-radius: 1000px;
-fx-padding: 5px 10px;
-fx-padding: 6px 10px;
}

.mobile-search-text-field > .ikonli-font-icon {
Expand Down Expand Up @@ -939,10 +939,6 @@
-fx-background-color: -white;
}

.model-list-view .search-wrapper .search-text-field .left-pane {
-fx-padding: 8px;
}

.model-list-view .list-view .model-list-cell {
-fx-cell-size: 80px;
-fx-padding: 10px 5px;
Expand Down

0 comments on commit fa7e032

Please sign in to comment.