Skip to content

Commit 669a9df

Browse files
authored
优化更新弹窗的颜色 (#4903)
1 parent a1e75e4 commit 669a9df

5 files changed

Lines changed: 12 additions & 10 deletions

File tree

HMCL/src/main/java/org/jackhuang/hmcl/setting/StyleSheets.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ private static String getThemeStyleSheet() {
181181
addColor(builder, scheme, ColorRole.ON_SURFACE_VARIANT, 0.38);
182182
addColor(builder, scheme, ColorRole.SURFACE_CONTAINER_LOW, 0.8);
183183
addColor(builder, scheme, ColorRole.SECONDARY_CONTAINER, 0.8);
184+
addColor(builder, scheme, ColorRole.INVERSE_SURFACE, 0.8);
184185

185186
builder.append("}\n");
186187
return toStyleSheetUri(builder.toString(), blueCss);

HMCL/src/main/java/org/jackhuang/hmcl/ui/UpgradeDialog.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
import com.jfoenix.controls.JFXButton;
2121
import com.jfoenix.controls.JFXDialogLayout;
22+
import com.jfoenix.controls.JFXSpinner;
2223
import javafx.scene.control.Label;
23-
import javafx.scene.control.ProgressIndicator;
2424
import javafx.scene.control.ScrollPane;
2525
import org.jackhuang.hmcl.Metadata;
2626
import org.jackhuang.hmcl.task.Schedulers;
@@ -48,7 +48,7 @@ public UpgradeDialog(RemoteVersion remoteVersion, Runnable updateRunnable) {
4848
maxHeightProperty().bind(Controllers.getScene().heightProperty().multiply(0.7));
4949

5050
setHeading(new Label(i18n("update.changelog")));
51-
setBody(new ProgressIndicator());
51+
setBody(new JFXSpinner());
5252

5353
String url = CHANGELOG_URL + remoteVersion.getChannel().channelName + ".html";
5454

HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,13 @@ public final class MainPage extends StackPane implements DecoratorPage {
188188
StackPane.setAlignment(hBox, Pos.CENTER_LEFT);
189189
StackPane.setMargin(hBox, new Insets(9, 12, 9, 16));
190190
{
191-
Label lblIcon = new Label();
192-
lblIcon.setGraphic(SVG.UPDATE.createIcon(20));
193-
194191
TwoLineListItem prompt = new TwoLineListItem();
195192
prompt.setSubtitle(i18n("update.bubble.subtitle"));
196193
prompt.setPickOnBounds(false);
197194
prompt.titleProperty().bind(BindingMapping.of(latestVersionProperty()).map(latestVersion ->
198195
latestVersion == null ? "" : i18n("update.bubble.title", latestVersion.getVersion())));
199196

200-
hBox.getChildren().setAll(lblIcon, prompt);
197+
hBox.getChildren().setAll(SVG.UPDATE.createIcon(20), prompt);
201198
}
202199

203200
JFXButton closeUpdateButton = new JFXButton();

HMCL/src/main/resources/assets/css/blue.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,5 @@
5656
-monet-on-surface-variant-transparent-38: #45465161;
5757
-monet-surface-container-low-transparent-80: #F5F2FACC;
5858
-monet-secondary-container-transparent-80: #D0D5FDCC;
59+
-monet-inverse-surface-transparent-80: #303036CC;
5960
}

HMCL/src/main/resources/assets/css/root.css

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,14 +355,17 @@
355355
}
356356

357357
.bubble {
358-
-fx-background-color: rgba(0, 0, 0, 0.5);
358+
-fx-background-color: -monet-inverse-surface-transparent-80;
359359
-fx-background-radius: 2px;
360-
-fx-text-fill: white;
361360
}
362361

363362
.bubble > HBox > .two-line-list-item > .first-line > .title,
364363
.bubble > HBox > .two-line-list-item > HBox > .subtitle {
365-
-fx-text-fill: white;
364+
-fx-text-fill: -monet-inverse-on-surface;
365+
}
366+
367+
.bubble .svg {
368+
-fx-fill: -monet-inverse-on-surface;
366369
}
367370

368371
.sponsor-pane {
@@ -1638,7 +1641,7 @@
16381641
}
16391642

16401643
.html-hyperlink {
1641-
-fx-fill: blue;
1644+
-fx-fill: -monet-primary;
16421645
}
16431646

16441647
.html-h1 {

0 commit comments

Comments
 (0)