优化下载页面条目水波纹样式 (#5521)
This commit is contained in:
@@ -17,8 +17,10 @@
|
||||
*/
|
||||
package org.jackhuang.hmcl.ui.versions;
|
||||
|
||||
import com.jfoenix.controls.*;
|
||||
import com.jfoenix.effects.JFXDepthManager;
|
||||
import com.jfoenix.controls.JFXButton;
|
||||
import com.jfoenix.controls.JFXComboBox;
|
||||
import com.jfoenix.controls.JFXListView;
|
||||
import com.jfoenix.controls.JFXTextField;
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.beans.binding.ObjectBinding;
|
||||
import javafx.beans.property.*;
|
||||
@@ -532,6 +534,7 @@ public class DownloadListPage extends Control implements DecoratorPage, VersionP
|
||||
private static final Insets PADDING = new Insets(9, 9, 0, 9);
|
||||
|
||||
private final RipplerContainer graphic;
|
||||
private final StackPane wrapper = new StackPane();
|
||||
|
||||
private final TwoLineListItem content = new TwoLineListItem();
|
||||
private final ImageView imageView = new ImageView();
|
||||
@@ -540,20 +543,22 @@ public class DownloadListPage extends Control implements DecoratorPage, VersionP
|
||||
setPadding(PADDING);
|
||||
|
||||
HBox container = new HBox(8);
|
||||
container.getStyleClass().add("card");
|
||||
container.setPadding(new Insets(8));
|
||||
container.setCursor(Cursor.HAND);
|
||||
container.setAlignment(Pos.CENTER_LEFT);
|
||||
JFXDepthManager.setDepth(container, 1);
|
||||
|
||||
imageView.setFitWidth(40);
|
||||
imageView.setFitHeight(40);
|
||||
imageView.setMouseTransparent(true);
|
||||
|
||||
container.getChildren().setAll(FXUtils.limitingSize(imageView, 40, 40), content);
|
||||
HBox.setHgrow(content, Priority.ALWAYS);
|
||||
|
||||
this.graphic = new RipplerContainer(container);
|
||||
graphic.setPosition(JFXRippler.RipplerPos.FRONT);
|
||||
FXUtils.onClicked(graphic, () -> {
|
||||
wrapper.getChildren().setAll(this.graphic);
|
||||
wrapper.getStyleClass().add("card-no-padding");
|
||||
|
||||
FXUtils.onClicked(wrapper, () -> {
|
||||
RemoteMod item = getItem();
|
||||
if (item != null)
|
||||
Controllers.navigate(new DownloadPage(getSkinnable(), item, getSkinnable().getProfileVersion(), getSkinnable().callback));
|
||||
@@ -580,7 +585,7 @@ public class DownloadListPage extends Control implements DecoratorPage, VersionP
|
||||
content.addTag(getSkinnable().getLocalizedCategory(category));
|
||||
}
|
||||
iconLoader.load(imageView.imageProperty(), item.getIconUrl());
|
||||
setGraphic(graphic);
|
||||
setGraphic(wrapper);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1052,6 +1052,13 @@
|
||||
-fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.26), 10, 0.12, -1, 2);
|
||||
}
|
||||
|
||||
.card-no-padding {
|
||||
-fx-background-color: -monet-surface-container-low-transparent-80;
|
||||
-fx-background-radius: 4;
|
||||
|
||||
-fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.26), 10, 0.12, -1, 2);
|
||||
}
|
||||
|
||||
.card-non-transparent {
|
||||
-fx-background-color: -monet-surface-container-low;
|
||||
-fx-background-radius: 4;
|
||||
|
||||
Reference in New Issue
Block a user