From feb15a3c6436854975ac0f483c8294f63240e8bd Mon Sep 17 00:00:00 2001 From: huanghongxun Date: Fri, 3 Sep 2021 03:54:13 +0800 Subject: [PATCH] feat: change style of text field and combo box to match Chrome. --- .../hmcl/ui/versions/VersionSettingsPage.java | 4 ++-- HMCL/src/main/resources/assets/css/root.css | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionSettingsPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionSettingsPage.java index 4a17dba2b..265180a7a 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionSettingsPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionSettingsPage.java @@ -176,7 +176,7 @@ public final class VersionSettingsPage extends StackPane implements DecoratorPag chkAutoAllocate = new JFXCheckBox(i18n("settings.memory.auto_allocate")); VBox.setMargin(chkAutoAllocate, new Insets(0, 0, 8, 5)); - HBox lowerBoundPane = new HBox(); + HBox lowerBoundPane = new HBox(8); lowerBoundPane.setAlignment(Pos.CENTER); VBox.setMargin(lowerBoundPane, new Insets(0, 0, 0, 16)); { @@ -190,7 +190,7 @@ public final class VersionSettingsPage extends StackPane implements DecoratorPag }, chkAutoAllocate.selectedProperty())); JFXSlider slider = new JFXSlider(0, 1, 0); - HBox.setMargin(slider, new Insets(0, 16, 0, 16)); + HBox.setMargin(slider, new Insets(0, 0, 0, 8)); HBox.setHgrow(slider, Priority.ALWAYS); slider.setValueFactory(self -> Bindings.createStringBinding(() -> (int)(self.getValue() * 100) + "%", self.valueProperty())); AtomicBoolean changedByTextField = new AtomicBoolean(false); diff --git a/HMCL/src/main/resources/assets/css/root.css b/HMCL/src/main/resources/assets/css/root.css index 9bd29fc75..afa9ff8ea 100644 --- a/HMCL/src/main/resources/assets/css/root.css +++ b/HMCL/src/main/resources/assets/css/root.css @@ -665,13 +665,14 @@ *******************************************************************************/ .jfx-text-field, .jfx-password-field, .jfx-text-area { - -fx-background-color: transparent; + -fx-background-color: #f1f3f4; -fx-font-weight: BOLD; -fx-prompt-text-fill: #808080; -fx-alignment: top-left; -fx-pref-width: 300.0; -jfx-focus-color: -fx-base-check-color; - -jfx-unfocus-color: #4d4d4d; + -fx-padding: 8; + -jfx-unfocus-color: transparent; } .jfx-text-area .viewport { @@ -1123,7 +1124,10 @@ *******************************************************************************/ .jfx-combo-box { - -jfx-focus-color: -fx-base-check-color; + -jfx-focus-color: transparent; + -jfx-unfocus-color: transparent; + -fx-background-color: #f1f3f4; + -fx-padding: 4; } .jfx-combo-box-warning {