fix(ui): some text overflow. Closes #1694.

This commit is contained in:
huanghongxun 2022-09-03 22:21:19 +08:00
parent 6c07924d9b
commit cc1fc1e4be
7 changed files with 25 additions and 32 deletions

View File

@ -1,6 +1,6 @@
[*] [*]
charset = utf-8 charset = utf-8
end_of_line = crlf end_of_line = lf
indent_size = 4 indent_size = 4
indent_style = space indent_style = space
insert_final_newline = false insert_final_newline = false

View File

@ -286,7 +286,8 @@ public class CreateAccountPane extends JFXDialogLayout implements DialogAware {
holder.add(Accounts.OAUTH_CALLBACK.onGrantDeviceCode.registerWeak(value -> { holder.add(Accounts.OAUTH_CALLBACK.onGrantDeviceCode.registerWeak(value -> {
runInFX(() -> deviceCode.set(value)); runInFX(() -> deviceCode.set(value));
})); }));
HBox box = new HBox(8); FlowPane box = new FlowPane();
box.setHgap(8);
JFXHyperlink birthLink = new JFXHyperlink(i18n("account.methods.microsoft.birth")); JFXHyperlink birthLink = new JFXHyperlink(i18n("account.methods.microsoft.birth"));
birthLink.setOnAction(e -> FXUtils.openLink("https://support.microsoft.com/account-billing/837badbc-999e-54d2-2617-d19206b9540a")); birthLink.setOnAction(e -> FXUtils.openLink("https://support.microsoft.com/account-billing/837badbc-999e-54d2-2617-d19206b9540a"));
JFXHyperlink profileLink = new JFXHyperlink(i18n("account.methods.microsoft.profile")); JFXHyperlink profileLink = new JFXHyperlink(i18n("account.methods.microsoft.profile"));

View File

@ -50,8 +50,9 @@ public class OptionToggleButton extends StackPane {
titleLabel.textProperty().bind(title); titleLabel.textProperty().bind(title);
Label subtitleLabel = new Label(); Label subtitleLabel = new Label();
subtitleLabel.setMouseTransparent(true); subtitleLabel.setMouseTransparent(true);
subtitleLabel.setWrapText(true);
subtitleLabel.textProperty().bind(subtitle); subtitleLabel.textProperty().bind(subtitle);
pane.setLeft(left); pane.setCenter(left);
left.setAlignment(Pos.CENTER_LEFT); left.setAlignment(Pos.CENTER_LEFT);
JFXToggleButton toggleButton = new JFXToggleButton(); JFXToggleButton toggleButton = new JFXToggleButton();

View File

@ -53,10 +53,9 @@ public class DownloadSettingsPage extends StackPane {
getChildren().setAll(scrollPane); getChildren().setAll(scrollPane);
{ {
ComponentList downloadSource = new ComponentList(); VBox downloadSource = new VBox(8);
downloadSource.getStyleClass().add("card-non-transparent");
{ {
VBox pane = new VBox(8);
VBox chooseWrapper = new VBox(); VBox chooseWrapper = new VBox();
chooseWrapper.setPadding(new Insets(8, 0, 8, 0)); chooseWrapper.setPadding(new Insets(8, 0, 8, 0));
@ -75,7 +74,7 @@ public class DownloadSettingsPage extends StackPane {
JFXComboBox<String> cboVersionListSource = new JFXComboBox<>(); JFXComboBox<String> cboVersionListSource = new JFXComboBox<>();
cboVersionListSource.setConverter(stringConverter(key -> i18n("download.provider." + key))); cboVersionListSource.setConverter(stringConverter(key -> i18n("download.provider." + key)));
versionListSourcePane.setRight(cboVersionListSource); versionListSourcePane.setRight(cboVersionListSource);
FXUtils.setLimitWidth(cboVersionListSource, 420); FXUtils.setLimitWidth(cboVersionListSource, 400);
cboVersionListSource.getItems().setAll(DownloadProviders.providersById.keySet()); cboVersionListSource.getItems().setAll(DownloadProviders.providersById.keySet());
selectedItemPropertyFor(cboVersionListSource).bindBidirectional(config().versionListSourceProperty()); selectedItemPropertyFor(cboVersionListSource).bindBidirectional(config().versionListSourceProperty());
@ -91,31 +90,28 @@ public class DownloadSettingsPage extends StackPane {
JFXComboBox<String> cboDownloadSource = new JFXComboBox<>(); JFXComboBox<String> cboDownloadSource = new JFXComboBox<>();
cboDownloadSource.setConverter(stringConverter(key -> i18n("download.provider." + key))); cboDownloadSource.setConverter(stringConverter(key -> i18n("download.provider." + key)));
downloadSourcePane.setRight(cboDownloadSource); downloadSourcePane.setCenter(cboDownloadSource);
FXUtils.setLimitWidth(cboDownloadSource, 420); FXUtils.setLimitWidth(cboDownloadSource, 420);
cboDownloadSource.getItems().setAll(DownloadProviders.rawProviders.keySet()); cboDownloadSource.getItems().setAll(DownloadProviders.rawProviders.keySet());
selectedItemPropertyFor(cboDownloadSource).bindBidirectional(config().downloadTypeProperty()); selectedItemPropertyFor(cboDownloadSource).bindBidirectional(config().downloadTypeProperty());
} }
pane.getChildren().setAll(chooseWrapper, versionListSourcePane, downloadSourcePane); downloadSource.getChildren().setAll(chooseWrapper, versionListSourcePane, downloadSourcePane);
downloadSource.getContent().add(pane);
} }
content.getChildren().addAll(ComponentList.createComponentListTitle(i18n("settings.launcher.version_list_source")), downloadSource); content.getChildren().addAll(ComponentList.createComponentListTitle(i18n("settings.launcher.version_list_source")), downloadSource);
} }
{ {
ComponentList downloadThreads = new ComponentList(); VBox downloadThreads = new VBox(16);
downloadThreads.getStyleClass().add("card-non-transparent");
{ {
VBox pane = new VBox(16);
pane.setPadding(new Insets(8, 0, 8, 0));
{ {
JFXCheckBox chkAutoDownloadThreads = new JFXCheckBox(i18n("settings.launcher.download.threads.auto")); JFXCheckBox chkAutoDownloadThreads = new JFXCheckBox(i18n("settings.launcher.download.threads.auto"));
VBox.setMargin(chkAutoDownloadThreads, new Insets(8, 0, 0, 0));
chkAutoDownloadThreads.selectedProperty().bindBidirectional(config().autoDownloadThreadsProperty()); chkAutoDownloadThreads.selectedProperty().bindBidirectional(config().autoDownloadThreadsProperty());
pane.getChildren().add(chkAutoDownloadThreads); downloadThreads.getChildren().add(chkAutoDownloadThreads);
chkAutoDownloadThreads.selectedProperty().addListener((a, b, newValue) -> { chkAutoDownloadThreads.selectedProperty().addListener((a, b, newValue) -> {
if (newValue) { if (newValue) {
@ -150,7 +146,7 @@ public class DownloadSettingsPage extends StackPane {
}); });
hbox.getChildren().setAll(label, slider, threadsField); hbox.getChildren().setAll(label, slider, threadsField);
pane.getChildren().add(hbox); downloadThreads.getChildren().add(hbox);
} }
{ {
@ -158,26 +154,22 @@ public class DownloadSettingsPage extends StackPane {
VBox.setMargin(hintPane, new Insets(0, 0, 0, 30)); VBox.setMargin(hintPane, new Insets(0, 0, 0, 30));
hintPane.disableProperty().bind(config().autoDownloadThreadsProperty()); hintPane.disableProperty().bind(config().autoDownloadThreadsProperty());
hintPane.setText(i18n("settings.launcher.download.threads.hint")); hintPane.setText(i18n("settings.launcher.download.threads.hint"));
pane.getChildren().add(hintPane); downloadThreads.getChildren().add(hintPane);
} }
downloadThreads.getContent().add(pane);
} }
content.getChildren().addAll(ComponentList.createComponentListTitle(i18n("download")), downloadThreads); content.getChildren().addAll(ComponentList.createComponentListTitle(i18n("download")), downloadThreads);
} }
{ {
ComponentList proxyList = new ComponentList(); VBox proxyList = new VBox(10);
proxyList.getStyleClass().add("card-non-transparent");
VBox proxyWrapper = new VBox();
proxyWrapper.setPadding(new Insets(8, 0, 8, 0));
proxyWrapper.setSpacing(10);
VBox proxyPane = new VBox(); VBox proxyPane = new VBox();
{ {
JFXCheckBox chkDisableProxy = new JFXCheckBox(i18n("settings.launcher.proxy.disable")); JFXCheckBox chkDisableProxy = new JFXCheckBox(i18n("settings.launcher.proxy.disable"));
proxyWrapper.getChildren().add(chkDisableProxy); VBox.setMargin(chkDisableProxy, new Insets(8, 0, 0, 0));
proxyList.getChildren().add(chkDisableProxy);
reversedSelectedPropertyFor(chkDisableProxy).bindBidirectional(config().hasProxyProperty()); reversedSelectedPropertyFor(chkDisableProxy).bindBidirectional(config().hasProxyProperty());
proxyPane.disableProperty().bind(chkDisableProxy.selectedProperty()); proxyPane.disableProperty().bind(chkDisableProxy.selectedProperty());
} }
@ -310,9 +302,8 @@ public class DownloadSettingsPage extends StackPane {
proxyPane.getChildren().add(authPane); proxyPane.getChildren().add(authPane);
} }
proxyWrapper.getChildren().add(proxyPane); proxyList.getChildren().add(proxyPane);
} }
proxyList.getContent().add(proxyWrapper);
content.getChildren().addAll(ComponentList.createComponentListTitle(i18n("settings.launcher.proxy")), proxyList); content.getChildren().addAll(ComponentList.createComponentListTitle(i18n("settings.launcher.proxy")), proxyList);
} }

View File

@ -146,7 +146,6 @@ public class MultiplayerPageSkin extends DecoratorAnimatedPage.DecoratorAnimated
content.setFillWidth(true); content.setFillWidth(true);
ScrollPane scrollPane = new ScrollPane(content); ScrollPane scrollPane = new ScrollPane(content);
scrollPane.setFitToWidth(true); scrollPane.setFitToWidth(true);
scrollPane.setFitToHeight(true);
setCenter(scrollPane); setCenter(scrollPane);
ComponentList roomPane = new ComponentList(); ComponentList roomPane = new ComponentList();

View File

@ -885,7 +885,7 @@
-fx-background-radius: 4; -fx-background-radius: 4;
-fx-padding: 8px; -fx-padding: 8px;
-fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.26), 10, 0.12, -1, 2); -fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.26), 5, 0.06, -0.5, 1);
} }
.card:selected { .card:selected {

View File

@ -76,7 +76,8 @@ account.failed.server_disconnected=Cannot access authentication server. You can
account.failed.server_response_malformed=Invalid server response, the authentication server may not be working. account.failed.server_response_malformed=Invalid server response, the authentication server may not be working.
account.failed.wrong_account=You have logged in to the wrong account. account.failed.wrong_account=You have logged in to the wrong account.
account.hmcl.hint=You need to click on "Login" and complete the process in the opened tab in your browser. account.hmcl.hint=You need to click on "Login" and complete the process in the opened tab in your browser.
account.injector.add=Add an Authentication Server # avoid too long sequence.
account.injector.add=New Auth Server
account.injector.empty=None (You can click on the plus button on the right to add one) account.injector.empty=None (You can click on the plus button on the right to add one)
account.injector.http=Warning\: This server uses the unsafe HTTP protocol, anyone between your connection will be able to see your credentials in cleartext. account.injector.http=Warning\: This server uses the unsafe HTTP protocol, anyone between your connection will be able to see your credentials in cleartext.
account.injector.link.homepage=Homepage account.injector.link.homepage=Homepage
@ -572,7 +573,7 @@ input.number=The input must be a number.
input.not_empty=This is a required field. input.not_empty=This is a required field.
input.url=The input must be a valid URL. input.url=The input must be a valid URL.
install=Add a New Instance install=New Instance
install.change_version=Change Version install.change_version=Change Version
install.change_version.confirm=Are you sure you want to switch %s from version %s to %s? install.change_version.confirm=Are you sure you want to switch %s from version %s to %s?
install.failed=Installation Failed install.failed=Installation Failed