Satisfy requirements metioned in #469
This commit is contained in:
@@ -96,7 +96,8 @@ public final class MainPage extends StackPane implements DecoratorPage {
|
|||||||
btnLaunch.setClip(new Rectangle(-100, -100, 310, 200));
|
btnLaunch.setClip(new Rectangle(-100, -100, 310, 200));
|
||||||
btnMenu.setClip(new Rectangle(211, -100, 100, 200));
|
btnMenu.setClip(new Rectangle(211, -100, 100, 200));
|
||||||
menu.setMaxHeight(365);
|
menu.setMaxHeight(365);
|
||||||
menu.setMinWidth(545);
|
menu.setMaxWidth(545);
|
||||||
|
menu.setAlwaysShowingVBar(true);
|
||||||
|
|
||||||
updatePane.visibleProperty().bind(UpdateChecker.outdatedProperty());
|
updatePane.visibleProperty().bind(UpdateChecker.outdatedProperty());
|
||||||
closeUpdateButton.setGraphic(SVG.close(Theme.whiteFillBinding(), 10, 10));
|
closeUpdateButton.setGraphic(SVG.close(Theme.whiteFillBinding(), 10, 10));
|
||||||
|
|||||||
@@ -18,6 +18,9 @@
|
|||||||
package org.jackhuang.hmcl.ui.construct;
|
package org.jackhuang.hmcl.ui.construct;
|
||||||
|
|
||||||
import javafx.beans.binding.Bindings;
|
import javafx.beans.binding.Bindings;
|
||||||
|
import javafx.beans.binding.When;
|
||||||
|
import javafx.beans.property.BooleanProperty;
|
||||||
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
import javafx.scene.Node;
|
import javafx.scene.Node;
|
||||||
@@ -31,6 +34,7 @@ import org.jackhuang.hmcl.ui.FXUtils;
|
|||||||
public class PopupMenu extends Control {
|
public class PopupMenu extends Control {
|
||||||
|
|
||||||
private final ObservableList<Node> content = FXCollections.observableArrayList();
|
private final ObservableList<Node> content = FXCollections.observableArrayList();
|
||||||
|
private final BooleanProperty alwaysShowingVBar = new SimpleBooleanProperty();
|
||||||
|
|
||||||
public PopupMenu() {
|
public PopupMenu() {
|
||||||
}
|
}
|
||||||
@@ -39,6 +43,18 @@ public class PopupMenu extends Control {
|
|||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isAlwaysShowingVBar() {
|
||||||
|
return alwaysShowingVBar.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BooleanProperty alwaysShowingVBarProperty() {
|
||||||
|
return alwaysShowingVBar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlwaysShowingVBar(boolean alwaysShowingVBar) {
|
||||||
|
this.alwaysShowingVBar.set(alwaysShowingVBar);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Skin<?> createDefaultSkin() {
|
protected Skin<?> createDefaultSkin() {
|
||||||
return new PopupMenuSkin();
|
return new PopupMenuSkin();
|
||||||
@@ -52,6 +68,9 @@ public class PopupMenu extends Control {
|
|||||||
ScrollPane scrollPane = new ScrollPane();
|
ScrollPane scrollPane = new ScrollPane();
|
||||||
scrollPane.setFitToHeight(true);
|
scrollPane.setFitToHeight(true);
|
||||||
scrollPane.setFitToWidth(true);
|
scrollPane.setFitToWidth(true);
|
||||||
|
scrollPane.vbarPolicyProperty().bind(new When(alwaysShowingVBar)
|
||||||
|
.then(ScrollPane.ScrollBarPolicy.ALWAYS)
|
||||||
|
.otherwise(ScrollPane.ScrollBarPolicy.AS_NEEDED));
|
||||||
|
|
||||||
VBox content = new VBox();
|
VBox content = new VBox();
|
||||||
content.getStyleClass().add("menu");
|
content.getStyleClass().add("menu");
|
||||||
|
|||||||
Reference in New Issue
Block a user