fix: refine UI. Closes #1052.

This commit is contained in:
huanghongxun
2021-09-21 06:59:10 +08:00
parent 87944a4934
commit 4537fe0390
5 changed files with 10 additions and 8 deletions

View File

@@ -191,7 +191,7 @@ public class RootPage extends DecoratorTabPage {
.add(gameListItem) .add(gameListItem)
.add(gameItem) .add(gameItem)
.add(downloadItem) .add(downloadItem)
.startCategory(i18n("settings.launcher.general").toLowerCase()) .startCategory(i18n("settings.launcher.general").toUpperCase())
.add(multiplayerItem) .add(multiplayerItem)
.add(launcherSettingsItem); .add(launcherSettingsItem);

View File

@@ -99,8 +99,6 @@ public final class SettingsPage extends SettingsView {
UpdateChecker.checkingUpdateProperty().addListener(new WeakInvalidationListener(updateListener)); UpdateChecker.checkingUpdateProperty().addListener(new WeakInvalidationListener(updateListener));
updateListener.invalidated(null); updateListener.invalidated(null);
lblUpdateNote.setWrappingWidth(470);
ToggleGroup updateChannelGroup = new ToggleGroup(); ToggleGroup updateChannelGroup = new ToggleGroup();
chkUpdateDev.setToggleGroup(updateChannelGroup); chkUpdateDev.setToggleGroup(updateChannelGroup);
chkUpdateDev.setUserData(UpdateChannel.DEVELOPMENT); chkUpdateDev.setUserData(UpdateChannel.DEVELOPMENT);

View File

@@ -29,6 +29,7 @@ import javafx.scene.control.ScrollPane;
import javafx.scene.layout.*; import javafx.scene.layout.*;
import javafx.scene.text.Text; import javafx.scene.text.Text;
import javafx.scene.text.TextAlignment; import javafx.scene.text.TextAlignment;
import javafx.scene.text.TextFlow;
import org.jackhuang.hmcl.setting.EnumCommonDirectory; import org.jackhuang.hmcl.setting.EnumCommonDirectory;
import org.jackhuang.hmcl.setting.Theme; import org.jackhuang.hmcl.setting.Theme;
import org.jackhuang.hmcl.ui.FXUtils; import org.jackhuang.hmcl.ui.FXUtils;
@@ -49,7 +50,6 @@ public abstract class SettingsView extends StackPane {
protected final MultiFileItem<EnumCommonDirectory> fileCommonLocation; protected final MultiFileItem<EnumCommonDirectory> fileCommonLocation;
protected final Label lblUpdate; protected final Label lblUpdate;
protected final Label lblUpdateSub; protected final Label lblUpdateSub;
protected final Text lblUpdateNote;
protected final JFXRadioButton chkUpdateStable; protected final JFXRadioButton chkUpdateStable;
protected final JFXRadioButton chkUpdateDev; protected final JFXRadioButton chkUpdateDev;
protected final JFXButton btnUpdate; protected final JFXButton btnUpdate;
@@ -132,10 +132,8 @@ public abstract class SettingsView extends StackPane {
chkUpdateStable = new JFXRadioButton(i18n("update.channel.stable")); chkUpdateStable = new JFXRadioButton(i18n("update.channel.stable"));
chkUpdateDev = new JFXRadioButton(i18n("update.channel.dev")); chkUpdateDev = new JFXRadioButton(i18n("update.channel.dev"));
VBox noteWrapper = new VBox(); TextFlow noteWrapper = new TextFlow(new Text(i18n("update.note")));
noteWrapper.setStyle("-fx-padding: 10 0 0 0;"); VBox.setMargin(noteWrapper, new Insets(10, 0, 0, 0));
lblUpdateNote = new Text(i18n("update.note"));
noteWrapper.getChildren().setAll(lblUpdateNote);
content.getChildren().setAll(chkUpdateStable, chkUpdateDev, noteWrapper); content.getChildren().setAll(chkUpdateStable, chkUpdateDev, noteWrapper);

View File

@@ -292,6 +292,8 @@ class ModListPageSkin extends SkinBase<ModListPage> {
content.setTitle(dataItem.getTitle()); content.setTitle(dataItem.getTitle());
if (dataItem.getMod() != null && I18n.getCurrentLocale().getLocale() == Locale.CHINA) { if (dataItem.getMod() != null && I18n.getCurrentLocale().getLocale() == Locale.CHINA) {
content.getTags().setAll(dataItem.getMod().getDisplayName()); content.getTags().setAll(dataItem.getMod().getDisplayName());
} else {
content.getTags().clear();
} }
content.setSubtitle(dataItem.getSubtitle()); content.setSubtitle(dataItem.getSubtitle());
if (booleanProperty != null) { if (booleanProperty != null) {

View File

@@ -240,6 +240,10 @@
-fx-font-size: 15px; -fx-font-size: 15px;
} }
.wrap-text > HBox > .subtitle {
-fx-wrap-text: true;
}
.bubble { .bubble {
-fx-background-color: rgba(0, 0, 0, 0.5); -fx-background-color: rgba(0, 0, 0, 0.5);
-fx-background-radius: 2px; -fx-background-radius: 2px;