Remove JFXButton in AdvancedListItem

This commit is contained in:
yushijinhun 2018-10-03 12:02:17 +08:00
parent 45f55b2075
commit 3323ea2be0
No known key found for this signature in database
GPG Key ID: 5BC167F73EA558E4

View File

@ -17,7 +17,6 @@
*/ */
package org.jackhuang.hmcl.ui.construct; package org.jackhuang.hmcl.ui.construct;
import com.jfoenix.controls.JFXButton;
import javafx.geometry.Insets; import javafx.geometry.Insets;
import javafx.geometry.Pos; import javafx.geometry.Pos;
import javafx.scene.control.Label; import javafx.scene.control.Label;
@ -83,19 +82,15 @@ public class AdvancedListItemSkin extends SkinBase<AdvancedListItem> {
HBox right = new HBox(); HBox right = new HBox();
right.setAlignment(Pos.CENTER); right.setAlignment(Pos.CENTER);
right.setPickOnBounds(false); right.setMouseTransparent(true);
right.getStyleClass().setAll("toggle-icon4");
JFXButton settings = new JFXButton(); FXUtils.setLimitWidth(right, 40);
FXUtils.setLimitWidth(settings, 40); FXUtils.onChangeAndOperate(skinnable.rightGraphicProperty(),
settings.getStyleClass().setAll("toggle-icon4"); newGraphic -> right.getChildren().setAll(newGraphic));
settings.graphicProperty().bind(skinnable.rightGraphicProperty());
right.getChildren().setAll(settings);
root.setRight(right); root.setRight(right);
FXUtils.onChangeAndOperate(skinnable.actionButtonVisibleProperty(), newValue -> { FXUtils.onChangeAndOperate(skinnable.actionButtonVisibleProperty(),
if (newValue) root.setRight(right); visible -> root.setRight(visible ? right : null));
else root.setRight(null);
});
stackPane.setStyle("-fx-padding: 10 16 10 16;"); stackPane.setStyle("-fx-padding: 10 16 10 16;");
stackPane.getStyleClass().setAll("transparent"); stackPane.getStyleClass().setAll("transparent");