feat(download): refresh button
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.jackhuang.hmcl.ui.download;
|
package org.jackhuang.hmcl.ui.download;
|
||||||
|
|
||||||
|
import com.jfoenix.controls.JFXButton;
|
||||||
import com.jfoenix.controls.JFXCheckBox;
|
import com.jfoenix.controls.JFXCheckBox;
|
||||||
import com.jfoenix.controls.JFXListView;
|
import com.jfoenix.controls.JFXListView;
|
||||||
import com.jfoenix.controls.JFXSpinner;
|
import com.jfoenix.controls.JFXSpinner;
|
||||||
@@ -39,7 +40,9 @@ import org.jackhuang.hmcl.download.forge.ForgeRemoteVersion;
|
|||||||
import org.jackhuang.hmcl.download.game.GameRemoteVersion;
|
import org.jackhuang.hmcl.download.game.GameRemoteVersion;
|
||||||
import org.jackhuang.hmcl.download.liteloader.LiteLoaderRemoteVersion;
|
import org.jackhuang.hmcl.download.liteloader.LiteLoaderRemoteVersion;
|
||||||
import org.jackhuang.hmcl.download.optifine.OptiFineRemoteVersion;
|
import org.jackhuang.hmcl.download.optifine.OptiFineRemoteVersion;
|
||||||
|
import org.jackhuang.hmcl.setting.Theme;
|
||||||
import org.jackhuang.hmcl.ui.FXUtils;
|
import org.jackhuang.hmcl.ui.FXUtils;
|
||||||
|
import org.jackhuang.hmcl.ui.SVG;
|
||||||
import org.jackhuang.hmcl.ui.animation.ContainerAnimations;
|
import org.jackhuang.hmcl.ui.animation.ContainerAnimations;
|
||||||
import org.jackhuang.hmcl.ui.animation.TransitionPane;
|
import org.jackhuang.hmcl.ui.animation.TransitionPane;
|
||||||
import org.jackhuang.hmcl.ui.construct.ComponentList;
|
import org.jackhuang.hmcl.ui.construct.ComponentList;
|
||||||
@@ -58,6 +61,7 @@ import java.util.concurrent.CompletableFuture;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static org.jackhuang.hmcl.ui.ToolbarListPageSkin.wrap;
|
||||||
import static org.jackhuang.hmcl.util.Logging.LOG;
|
import static org.jackhuang.hmcl.util.Logging.LOG;
|
||||||
import static org.jackhuang.hmcl.util.i18n.I18n.i18n;
|
import static org.jackhuang.hmcl.util.i18n.I18n.i18n;
|
||||||
|
|
||||||
@@ -84,6 +88,8 @@ public final class VersionsPage extends BorderPane implements WizardPage, Refres
|
|||||||
@FXML
|
@FXML
|
||||||
private JFXCheckBox chkOld;
|
private JFXCheckBox chkOld;
|
||||||
@FXML
|
@FXML
|
||||||
|
private JFXButton btnRefresh;
|
||||||
|
@FXML
|
||||||
private HBox checkPane;
|
private HBox checkPane;
|
||||||
@FXML
|
@FXML
|
||||||
private ComponentList centrePane;
|
private ComponentList centrePane;
|
||||||
@@ -114,6 +120,8 @@ public final class VersionsPage extends BorderPane implements WizardPage, Refres
|
|||||||
chkSnapshot.selectedProperty().addListener(listener);
|
chkSnapshot.selectedProperty().addListener(listener);
|
||||||
chkOld.selectedProperty().addListener(listener);
|
chkOld.selectedProperty().addListener(listener);
|
||||||
|
|
||||||
|
btnRefresh.setGraphic(wrap(SVG.refresh(Theme.blackFillBinding(), -1, -1)));
|
||||||
|
|
||||||
list.setCellFactory(listView -> new ListCell<RemoteVersion>() {
|
list.setCellFactory(listView -> new ListCell<RemoteVersion>() {
|
||||||
IconedTwoLineListItem content = new IconedTwoLineListItem();
|
IconedTwoLineListItem content = new IconedTwoLineListItem();
|
||||||
RipplerContainer ripplerContainer = new RipplerContainer(content);
|
RipplerContainer ripplerContainer = new RipplerContainer(content);
|
||||||
|
|||||||
@@ -23,10 +23,26 @@
|
|||||||
<JFXSpinner fx:id="spinner" styleClass="first-spinner" />
|
<JFXSpinner fx:id="spinner" styleClass="first-spinner" />
|
||||||
<StackPane fx:id="center" style="-fx-padding: 10;">
|
<StackPane fx:id="center" style="-fx-padding: 10;">
|
||||||
<ComponentList fx:id="centrePane" styleClass="no-padding">
|
<ComponentList fx:id="centrePane" styleClass="no-padding">
|
||||||
<HBox fx:id="checkPane" spacing="10" style="-fx-padding: 10;">
|
<HBox fx:id="checkPane" spacing="10">
|
||||||
<JFXCheckBox fx:id="chkRelease" text="%version.game.releases" selected="true" />
|
<JFXCheckBox fx:id="chkRelease" text="%version.game.releases" selected="true">
|
||||||
<JFXCheckBox fx:id="chkSnapshot" text="%version.game.snapshots" />
|
<HBox.margin>
|
||||||
<JFXCheckBox fx:id="chkOld" text="%version.game.old" />
|
<Insets top="10" bottom="10" />
|
||||||
|
</HBox.margin>
|
||||||
|
</JFXCheckBox>
|
||||||
|
<JFXCheckBox fx:id="chkSnapshot" text="%version.game.snapshots">
|
||||||
|
<HBox.margin>
|
||||||
|
<Insets top="10" bottom="10" />
|
||||||
|
</HBox.margin>
|
||||||
|
</JFXCheckBox>
|
||||||
|
<JFXCheckBox fx:id="chkOld" text="%version.game.old">
|
||||||
|
<HBox.margin>
|
||||||
|
<Insets top="10" bottom="10" />
|
||||||
|
</HBox.margin>
|
||||||
|
</JFXCheckBox>
|
||||||
|
|
||||||
|
<HBox HBox.hgrow="ALWAYS" />
|
||||||
|
|
||||||
|
<JFXButton fx:id="btnRefresh" styleClass="jfx-tool-bar-button" onMouseClicked="#onRefresh" text="%button.refresh" />
|
||||||
</HBox>
|
</HBox>
|
||||||
<JFXListView fx:id="list" styleClass="jfx-list-view-float" VBox.vgrow="ALWAYS">
|
<JFXListView fx:id="list" styleClass="jfx-list-view-float" VBox.vgrow="ALWAYS">
|
||||||
</JFXListView>
|
</JFXListView>
|
||||||
|
|||||||
Reference in New Issue
Block a user