Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f176fbd1fd | ||
|
|
23811dad7f | ||
|
|
e792bfc554 | ||
|
|
d6b4af2d96 | ||
|
|
2a915460ae | ||
|
|
e9b577f66f | ||
|
|
e12c7e53f6 | ||
|
|
61caf8a925 |
No files matched your search
@@ -1,21 +0,0 @@
|
||||
name: Check Codes Comment
|
||||
|
||||
# Disabled on this Gitea fork: the upstream flow depends on reviewdog
|
||||
# (missing from git.nest.potatolab.uk) and a checkstyle-artifact produced by
|
||||
# check-codes.yml. Re-enable only after those actions are mirrored or the
|
||||
# comment path is rewritten without reviewdog.
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
comment:
|
||||
runs-on: ubuntu-latest
|
||||
if: false
|
||||
steps:
|
||||
- name: Disabled
|
||||
run: echo "check-codes-comment is disabled on this fork"
|
||||
@@ -1,35 +0,0 @@
|
||||
name: Check Codes
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- '**.java'
|
||||
- '**.properties'
|
||||
- '.github/workflows/check-codes.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.java'
|
||||
- '**.properties'
|
||||
- '.github/workflows/check-codes.yml'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup JDK 17
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: '17'
|
||||
java-package: 'jdk+fx'
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v5
|
||||
with:
|
||||
cache-cleanup: never
|
||||
# Keep only Gradle checks. reviewdog/action-setup is not mirrored on
|
||||
# git.nest.potatolab.uk (404), so PR-comment artifact steps are omitted
|
||||
# for Gitea Actions / act runners.
|
||||
- name: Check Codes
|
||||
run: ./gradlew checkstyle checkTranslations --no-daemon --parallel --stacktrace
|
||||
@@ -1,11 +1,22 @@
|
||||
name: Java CI
|
||||
|
||||
# Pushes to main and pull requests only. A branch with an open pull request used to build twice
|
||||
# (once for the push, once for the pull request), which kept the runners queued.
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- '*'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
|
||||
# A newer run for the same pull request or branch replaces the older one.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
@@ -23,12 +34,26 @@ jobs:
|
||||
uses: gradle/actions/setup-gradle@v5
|
||||
with:
|
||||
cache-cleanup: never
|
||||
# Only main writes the dependency cache; pull requests read it.
|
||||
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
|
||||
# The repository's wrapper downloads Gradle itself, so cache that download too.
|
||||
- name: Cache Gradle distribution
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/wrapper
|
||||
.gradle/wrapper-neo
|
||||
key: gradle-dist-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'gradle/wrapper/GradleWrapperNeo.java') }}
|
||||
- name: Install Xvfb
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y xvfb
|
||||
- name: Build with Gradle
|
||||
run: xvfb-run --auto-servernum ./gradlew build --no-daemon --parallel
|
||||
# Installing is the slowest setup step, so skip it when the runner already has xvfb, and
|
||||
# only refresh the package index when a plain install fails.
|
||||
command -v xvfb-run >/dev/null || sudo apt-get install -y --no-install-recommends xvfb \
|
||||
|| { sudo apt-get update && sudo apt-get install -y --no-install-recommends xvfb; }
|
||||
# One Gradle run builds, tests and runs the code and translation checks, so the
|
||||
# project is configured and compiled once instead of in two workflows.
|
||||
- name: Build and check with Gradle
|
||||
run: xvfb-run --auto-servernum ./gradlew build checkstyle checkTranslations --no-daemon --parallel
|
||||
env:
|
||||
JAVA_TOOL_OPTIONS: -Djava.awt.headless=true
|
||||
MICROSOFT_AUTH_ID: ${{ secrets.MICROSOFT_AUTH_ID }}
|
||||
|
||||
@@ -77,3 +77,6 @@ language-subtag-registry
|
||||
!/.gemini/config.yaml
|
||||
.codex
|
||||
/.gradle-*/
|
||||
|
||||
# Managed Java downloaded by the launcher when it is run from the repository root
|
||||
/java/
|
||||
@@ -28,7 +28,6 @@ import org.jackhuang.hmcl.util.javafx.MappedObservableList;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.UnmodifiableView;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import static org.jackhuang.hmcl.util.i18n.I18n.i18n;
|
||||
import static org.jackhuang.hmcl.util.javafx.ExtendedProperties.createSelectedItemPropertyFor;
|
||||
@@ -78,7 +77,7 @@ public final class AccountListPage extends DecoratorAnimatedPage implements Deco
|
||||
getSidebar().clear();
|
||||
|
||||
getSidebar()
|
||||
.startCategory(i18n("account.create").toUpperCase(Locale.ROOT))
|
||||
.startCategory(i18n("account.create"))
|
||||
.add(offlineItem)
|
||||
.add(microsoftItem);
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import javafx.beans.binding.BooleanBinding;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.layout.StackPane;
|
||||
import javafx.scene.layout.VBox;
|
||||
import org.jackhuang.hmcl.auth.Account;
|
||||
import org.jackhuang.hmcl.setting.Accounts;
|
||||
import org.jackhuang.hmcl.ui.Controllers;
|
||||
@@ -19,6 +20,8 @@ import org.jackhuang.hmcl.ui.SVG;
|
||||
import org.jackhuang.hmcl.ui.construct.AdvancedListItem;
|
||||
import org.jackhuang.hmcl.ui.construct.AdvancedListBox;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.jackhuang.hmcl.util.i18n.I18n.i18n;
|
||||
|
||||
public final class AccountListPopupMenu extends StackPane {
|
||||
@@ -69,20 +72,6 @@ public final class AccountListPopupMenu extends StackPane {
|
||||
box.add(item);
|
||||
}
|
||||
|
||||
// Footer actions: add another account, or open the full account page.
|
||||
AdvancedListItem addItem = footerItem(SVG.ADD_CIRCLE, i18n("account.add"));
|
||||
addItem.setOnAction(e -> {
|
||||
hidePopup();
|
||||
Controllers.dialog(new CreateAccountPane());
|
||||
});
|
||||
AdvancedListItem manageItem = footerItem(SVG.SETTINGS, i18n("account.open_manage"));
|
||||
manageItem.setOnAction(e -> {
|
||||
hidePopup();
|
||||
Controllers.navigate(Controllers.getAccountListPage());
|
||||
});
|
||||
box.add(addItem);
|
||||
box.add(manageItem);
|
||||
|
||||
// https://github.com/HMCL-dev/HMCL/issues/5343
|
||||
Platform.runLater(() -> box.setVvalue(0.0));
|
||||
};
|
||||
@@ -92,9 +81,31 @@ public final class AccountListPopupMenu extends StackPane {
|
||||
Label placeholder = new Label(i18n("account.empty"));
|
||||
placeholder.setStyle("-fx-padding: 10px; -fx-text-fill: -monet-on-surface-variant; -fx-font-style: italic;");
|
||||
|
||||
FXUtils.onChangeAndOperate(isEmpty, empty -> {
|
||||
getChildren().setAll(empty ? placeholder : box);
|
||||
// Footer actions stay visible even when there is no account yet: add one, or open the full account page.
|
||||
AdvancedListItem addItem = footerItem(SVG.ADD_CIRCLE, i18n("account.add"));
|
||||
addItem.setOnAction(e -> {
|
||||
hidePopup();
|
||||
// The first account uses the short name dialog; later ones can pick any login method.
|
||||
if (Accounts.getAccounts().isEmpty()) {
|
||||
Controllers.dialog(new FirstRunAccountDialog());
|
||||
} else {
|
||||
Controllers.dialog(new CreateAccountPane());
|
||||
}
|
||||
});
|
||||
AdvancedListItem manageItem = footerItem(SVG.SETTINGS, i18n("account.open_manage"));
|
||||
manageItem.setOnAction(e -> {
|
||||
hidePopup();
|
||||
Controllers.navigate(Controllers.getAccountListPage());
|
||||
});
|
||||
VBox footer = new VBox(addItem, manageItem);
|
||||
footer.setPrefWidth(220);
|
||||
|
||||
VBox content = new VBox();
|
||||
FXUtils.onChangeAndOperate(isEmpty, empty -> {
|
||||
footer.getChildren().setAll(empty ? List.of(addItem) : List.of(addItem, manageItem));
|
||||
content.getChildren().setAll(empty ? List.of(placeholder, footer) : List.of(box, footer));
|
||||
});
|
||||
getChildren().setAll(content);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -135,6 +135,7 @@ public class ComponentList extends Control implements NoPaddingComponent {
|
||||
|
||||
{
|
||||
Label advanced = new Label(title);
|
||||
advanced.getStyleClass().add("component-list-title");
|
||||
node.getChildren().setAll(advanced);
|
||||
}
|
||||
|
||||
|
||||
@@ -2349,3 +2349,78 @@
|
||||
-fx-pref-height: 18px;
|
||||
-fx-max-height: 18px;
|
||||
}
|
||||
|
||||
/* ---- Unified list and card styling ---- */
|
||||
|
||||
/* Sidebar section labels: small muted text without an underline. */
|
||||
.class-title {
|
||||
-fx-font-family: "Noto Sans SC";
|
||||
-fx-padding: 13px 16px 4px 16px;
|
||||
}
|
||||
|
||||
.class-title Text {
|
||||
-fx-fill: -monet-on-surface-variant;
|
||||
}
|
||||
|
||||
.class-title Rectangle {
|
||||
-fx-fill: transparent;
|
||||
}
|
||||
|
||||
/* Cards: a hairline border instead of a drop shadow. */
|
||||
.card, .card-no-padding, .card-non-transparent {
|
||||
-fx-background-color: -monet-surface-bright;
|
||||
-fx-border-color: -monet-outline-variant;
|
||||
-fx-border-radius: 13px;
|
||||
-fx-effect: null;
|
||||
}
|
||||
|
||||
/* Icon buttons use a softer ink than body text. */
|
||||
.toggle-icon4 .svg, .toggle-icon-tiny .svg {
|
||||
-fx-fill: -monet-on-surface-variant;
|
||||
}
|
||||
|
||||
/* ---- Settings lists ---- */
|
||||
.component-list-title {
|
||||
-fx-font-family: "Noto Sans SC";
|
||||
-fx-font-weight: bold;
|
||||
-fx-font-size: 14px;
|
||||
-fx-text-fill: -monet-on-surface;
|
||||
}
|
||||
|
||||
.options-list {
|
||||
-fx-background-radius: 13px;
|
||||
-fx-border-color: -monet-outline-variant;
|
||||
-fx-border-radius: 13px;
|
||||
-fx-effect: null;
|
||||
}
|
||||
|
||||
.options-list-item {
|
||||
-fx-background-color: -monet-surface-bright;
|
||||
}
|
||||
|
||||
.options-list-item:first {
|
||||
-fx-background-radius: 13px 13px 0 0;
|
||||
}
|
||||
|
||||
.options-list-item:last {
|
||||
-fx-background-radius: 0 0 13px 13px;
|
||||
}
|
||||
|
||||
.options-list-item:first:last {
|
||||
-fx-background-radius: 13px;
|
||||
}
|
||||
|
||||
/* Sidebar rows: a lighter selected and hover tint. */
|
||||
.advanced-list-item:selected .rippler-container,
|
||||
.advanced-list-item .rippler-container:hover {
|
||||
-fx-background-color: -monet-surface-container-high;
|
||||
}
|
||||
|
||||
/* Outlined buttons: one crisp hairline. */
|
||||
.jfx-button-border {
|
||||
-fx-border-color: -monet-outline-variant;
|
||||
-fx-border-radius: 8px;
|
||||
-fx-border-width: 1px;
|
||||
-fx-background-radius: 8px;
|
||||
-fx-padding: 8px 16px;
|
||||
}
|
||||
Reference in new issue
Block a user