From 3650a6bd3036d05457b453b9b3534fff1b8794d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=9E=E5=BA=90?= <109708109+Ciilu@users.noreply.github.com> Date: Fri, 13 Mar 2026 23:06:04 +0800 Subject: [PATCH 1/4] update --- .../hmcl/ui/construct/FloatScrollBarSkin.java | 22 +++++++++---------- HMCL/src/main/resources/assets/css/root.css | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FloatScrollBarSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FloatScrollBarSkin.java index 1b2c39d7a7..3a251eb50d 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FloatScrollBarSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FloatScrollBarSkin.java @@ -1,6 +1,6 @@ /* * Hello Minecraft! Launcher - * Copyright (C) 2020 huangyuhui and contributors + * Copyright (C) 2020 huangyuhui and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -129,12 +129,12 @@ private void setup() { track.heightProperty().unbind(); if (scrollBar.getOrientation() == Orientation.HORIZONTAL) { - track.relocate(0, -8); + track.relocate(0, -4.5); track.widthProperty().bind(scrollBar.widthProperty()); - track.setHeight(8); + track.setHeight(4.5); } else { - track.relocate(-8, 0); - track.setWidth(8); + track.relocate(-4.5, 0); + track.setWidth(4.5); track.heightProperty().bind(scrollBar.heightProperty()); } @@ -144,13 +144,13 @@ private void setup() { thumb.heightProperty().unbind(); if (scrollBar.getOrientation() == Orientation.HORIZONTAL) { - thumb.relocate(0, -8); + thumb.relocate(0, -4.5); thumb.widthProperty().bind(Bindings.max(20, scrollBar.visibleAmountProperty().divide(range).multiply(scrollBar.widthProperty()))); - thumb.setHeight(8); + thumb.setHeight(4.5); thumb.xProperty().bind(Bindings.subtract(scrollBar.widthProperty(), thumb.widthProperty()).multiply(position)); } else { - thumb.relocate(-8, 0); - thumb.setWidth(8); + thumb.relocate(-4.5, 0); + thumb.setWidth(4.5); thumb.heightProperty().bind(Bindings.max(20, scrollBar.visibleAmountProperty().divide(range).multiply(scrollBar.heightProperty()))); thumb.yProperty().bind(Bindings.subtract(scrollBar.heightProperty(), thumb.heightProperty()).multiply(position)); } @@ -162,7 +162,7 @@ protected double computeMaxWidth(double height) { return Double.MAX_VALUE; } - return 8; + return 4.5; } @Override @@ -171,7 +171,7 @@ protected double computeMaxHeight(double width) { return Double.MAX_VALUE; } - return 8; + return 4.5; } }; } diff --git a/HMCL/src/main/resources/assets/css/root.css b/HMCL/src/main/resources/assets/css/root.css index 799882b6d8..87193cc4a1 100644 --- a/HMCL/src/main/resources/assets/css/root.css +++ b/HMCL/src/main/resources/assets/css/root.css @@ -29,8 +29,8 @@ .scroll-bar .thumb { -fx-fill: -monet-surface-tint; - -fx-arc-width: 8; - -fx-arc-height: 8; + -fx-arc-width: 4.5; + -fx-arc-height: 4.5; } .title-label { From 0c0706b1427f73d0555ea0e4fa8cf5002a4ff36a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=9E=E5=BA=90?= <109708109+Ciilu@users.noreply.github.com> Date: Fri, 13 Mar 2026 23:07:30 +0800 Subject: [PATCH 2/4] update --- .../org/jackhuang/hmcl/ui/construct/FloatScrollBarSkin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FloatScrollBarSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FloatScrollBarSkin.java index 3a251eb50d..47ee72b5e8 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FloatScrollBarSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FloatScrollBarSkin.java @@ -1,6 +1,6 @@ /* * Hello Minecraft! Launcher - * Copyright (C) 2020 huangyuhui and contributors + * Copyright (C) 2020 huangyuhui and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 874f78032a3e51d5bd98bff62c8fc027268facae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=9E=E5=BA=90?= <109708109+Ciilu@users.noreply.github.com> Date: Sun, 5 Apr 2026 20:45:55 +0800 Subject: [PATCH 3/4] update --- .../hmcl/ui/construct/FloatScrollBarSkin.java | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FloatScrollBarSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FloatScrollBarSkin.java index 47ee72b5e8..6a965d835b 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FloatScrollBarSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FloatScrollBarSkin.java @@ -128,14 +128,18 @@ private void setup() { track.widthProperty().unbind(); track.heightProperty().unbind(); + double offset = 4; + if (scrollBar.getOrientation() == Orientation.HORIZONTAL) { - track.relocate(0, -4.5); - track.widthProperty().bind(scrollBar.widthProperty()); + track.relocate(offset, -4.5); + NumberBinding trackWidth = Bindings.subtract(scrollBar.widthProperty(), offset * 2); + track.widthProperty().bind(trackWidth); track.setHeight(4.5); } else { - track.relocate(-4.5, 0); + track.relocate(-4.5, offset); track.setWidth(4.5); - track.heightProperty().bind(scrollBar.heightProperty()); + NumberBinding trackHeight = Bindings.subtract(scrollBar.heightProperty(), offset * 2); + track.heightProperty().bind(trackHeight); } thumb.xProperty().unbind(); @@ -145,14 +149,24 @@ private void setup() { if (scrollBar.getOrientation() == Orientation.HORIZONTAL) { thumb.relocate(0, -4.5); - thumb.widthProperty().bind(Bindings.max(20, scrollBar.visibleAmountProperty().divide(range).multiply(scrollBar.widthProperty()))); thumb.setHeight(4.5); - thumb.xProperty().bind(Bindings.subtract(scrollBar.widthProperty(), thumb.widthProperty()).multiply(position)); + + NumberBinding trackWidth = Bindings.subtract(scrollBar.widthProperty(), offset * 2); + thumb.widthProperty().bind(Bindings.max(20, scrollBar.visibleAmountProperty().divide(range).multiply(trackWidth))); + thumb.xProperty().bind( + Bindings.add(offset, + Bindings.subtract(trackWidth, thumb.widthProperty()).multiply(position)) + ); } else { thumb.relocate(-4.5, 0); thumb.setWidth(4.5); - thumb.heightProperty().bind(Bindings.max(20, scrollBar.visibleAmountProperty().divide(range).multiply(scrollBar.heightProperty()))); - thumb.yProperty().bind(Bindings.subtract(scrollBar.heightProperty(), thumb.heightProperty()).multiply(position)); + + NumberBinding trackHeight = Bindings.subtract(scrollBar.heightProperty(), offset * 2); + thumb.heightProperty().bind(Bindings.max(20, scrollBar.visibleAmountProperty().divide(range).multiply(trackHeight))); + thumb.yProperty().bind( + Bindings.add(offset, + Bindings.subtract(trackHeight, thumb.heightProperty()).multiply(position)) + ); } } From 968719c33ac2ee5b43578ae878c57909cfb22b36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=9E=E5=BA=90?= <109708109+Ciilu@users.noreply.github.com> Date: Sun, 5 Apr 2026 22:51:08 +0800 Subject: [PATCH 4/4] update --- .../hmcl/ui/construct/FloatScrollBarSkin.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FloatScrollBarSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FloatScrollBarSkin.java index 6a965d835b..43ccdd7b3f 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FloatScrollBarSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FloatScrollBarSkin.java @@ -131,13 +131,13 @@ private void setup() { double offset = 4; if (scrollBar.getOrientation() == Orientation.HORIZONTAL) { - track.relocate(offset, -4.5); + track.relocate(offset, -5.0); NumberBinding trackWidth = Bindings.subtract(scrollBar.widthProperty(), offset * 2); track.widthProperty().bind(trackWidth); - track.setHeight(4.5); + track.setHeight(5.0); } else { - track.relocate(-4.5, offset); - track.setWidth(4.5); + track.relocate(-5.0, offset); + track.setWidth(5.0); NumberBinding trackHeight = Bindings.subtract(scrollBar.heightProperty(), offset * 2); track.heightProperty().bind(trackHeight); } @@ -148,8 +148,8 @@ private void setup() { thumb.heightProperty().unbind(); if (scrollBar.getOrientation() == Orientation.HORIZONTAL) { - thumb.relocate(0, -4.5); - thumb.setHeight(4.5); + thumb.relocate(0, -5.0); + thumb.setHeight(5.0); NumberBinding trackWidth = Bindings.subtract(scrollBar.widthProperty(), offset * 2); thumb.widthProperty().bind(Bindings.max(20, scrollBar.visibleAmountProperty().divide(range).multiply(trackWidth))); @@ -158,8 +158,8 @@ private void setup() { Bindings.subtract(trackWidth, thumb.widthProperty()).multiply(position)) ); } else { - thumb.relocate(-4.5, 0); - thumb.setWidth(4.5); + thumb.relocate(-5.0, 0); + thumb.setWidth(5.0); NumberBinding trackHeight = Bindings.subtract(scrollBar.heightProperty(), offset * 2); thumb.heightProperty().bind(Bindings.max(20, scrollBar.visibleAmountProperty().divide(range).multiply(trackHeight))); @@ -176,7 +176,7 @@ protected double computeMaxWidth(double height) { return Double.MAX_VALUE; } - return 4.5; + return 5.0; } @Override @@ -185,7 +185,7 @@ protected double computeMaxHeight(double width) { return Double.MAX_VALUE; } - return 4.5; + return 5.0; } }; }