Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates HMCL’s JFoenix progress bar rendering to produce smoother determinate progress transitions, aligning both the skin implementation and CSS styling.
Changes:
- Reworked
JFXProgressBarSkinto render the bar as aRectangleand add a short determinate width animation (when enabled). - Added a
smoothProgresstoggle toJFXProgressBar, and used it inTaskListPaneto suppress animations during cell rebinding. - Updated
root.cssprogress bar styling to use-fx-fillfor the newRectangle-based bar.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| HMCL/src/main/resources/assets/css/root.css | Updates progress bar bar styling to match Rectangle rendering (-fx-fill). |
| HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskListPane.java | Temporarily disables smooth progress during list cell rebinding to avoid unwanted animations. |
| HMCL/src/main/java/com/jfoenix/skins/JFXProgressBarSkin.java | Implements smooth determinate animation + refactors bar node to a Rectangle. |
| HMCL/src/main/java/com/jfoenix/controls/JFXProgressBar.java | Adds a smoothProgress toggle used by the skin to enable/disable smoothing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private Timeline createIndeterminateTransition() { | ||
| Timeline indeterminateTransition = new Timeline( | ||
| new KeyFrame( | ||
| Duration.ZERO, | ||
| new KeyValue(clip.widthProperty(), 0.0, Interpolator.EASE_IN), | ||
| new KeyValue(clip.translateXProperty(), 0, Interpolator.LINEAR) | ||
| new KeyValue(bar.widthProperty(), 0.0, Interpolator.EASE_IN), | ||
| new KeyValue(bar.translateXProperty(), 0, Interpolator.LINEAR) | ||
| ), | ||
| new KeyFrame( | ||
| DURATION.multiply(0.5), | ||
| new KeyValue(clip.widthProperty(), w * 0.4, Interpolator.LINEAR) | ||
| INDETERMINATE_DURATION.multiply(0.5), | ||
| new KeyValue(bar.widthProperty(), fullWidth * 0.4, Interpolator.LINEAR) | ||
| ), | ||
| new KeyFrame( | ||
| DURATION.multiply(0.9), | ||
| new KeyValue(clip.translateXProperty(), w, Interpolator.LINEAR) | ||
| INDETERMINATE_DURATION.multiply(0.9), | ||
| new KeyValue(bar.translateXProperty(), fullWidth, Interpolator.LINEAR) | ||
| ), | ||
| new KeyFrame( | ||
| DURATION, | ||
| new KeyValue(clip.widthProperty(), 0.0, Interpolator.EASE_OUT) | ||
| INDETERMINATE_DURATION, | ||
| new KeyValue(bar.widthProperty(), 0.0, Interpolator.EASE_OUT) |
| private boolean smoothProgress = true; | ||
|
|
||
| public boolean isSmoothProgress() { | ||
| return smoothProgress; | ||
| } | ||
|
|
||
| public void setSmoothProgress(boolean smoothProgress) { | ||
| this.smoothProgress = smoothProgress; | ||
| } |
| clearAnimation(); | ||
| if (isTreeShowing && playProgressAnimation | ||
| && AnimationUtils.isAnimationEnabled() | ||
| && getSkinnable().isSmoothProgress()) { | ||
| transition = createDeterminateTransition(progress); | ||
| transition.playFromStart(); | ||
| } else { | ||
| bar.setWidth(computeBarWidth(progress)); | ||
| } | ||
| } |
There was a problem hiding this comment.
Pull request overview
This PR introduces “smooth” (animated) determinate progress updates for the custom JFXProgressBar, and adjusts styling/usage to reduce visual jank during list-cell reuse in the task list UI.
Changes:
- Reworked
JFXProgressBarSkinto animate determinate progress width changes and refactor indeterminate animation handling. - Added a
smoothProgresstoggle onJFXProgressBar, and used it inTaskListPaneto disable animations during unbind/rebind. - Simplified the progress bar CSS selector for
.bar.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| HMCL/src/main/resources/assets/css/root.css | Simplifies progress bar .bar selector styling. |
| HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskListPane.java | Temporarily disables smooth progress during cell unbind/rebind to avoid unwanted animations. |
| HMCL/src/main/java/com/jfoenix/skins/JFXProgressBarSkin.java | Implements/updates determinate smooth width animation and refactors indeterminate transition logic. |
| HMCL/src/main/java/com/jfoenix/controls/JFXProgressBar.java | Adds a new smoothProgress flag to control animation behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (isIndeterminate != wasIndeterminate) { | ||
| wasIndeterminate = isIndeterminate; | ||
| clearAnimation(); | ||
| clip.setTranslateX(0); |
No description provided.