Skip to content

Commit

Permalink
chore 🧹: jwinui2.0 native TaskBarPeer update on progress
Browse files Browse the repository at this point in the history
  • Loading branch information
SDIDSA committed Dec 15, 2023
1 parent 2985bb9 commit d382be9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/org/luke/jwin/ui/Progress.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import javafx.geometry.Pos;
import javafx.scene.layout.StackPane;
import javafx.scene.shape.Rectangle;
import jna.ITaskbarList3;
import jna.TaskbarPeer;

public class Progress extends StackPane implements Styleable {

Expand Down Expand Up @@ -56,12 +58,17 @@ public Progress(Window win) {
if(nvd > 0 && isIndeterminate()) {
setIndeterminate(false);
}

if(!isIndeterminate()) {
thumb.setTranslateX(0);
thumb.setWidth(getWidth() * val.get());

TaskbarPeer.setProgressState(win, ITaskbarList3.TBPF_NORMAL);
TaskbarPeer.setProgress(win, nv.doubleValue());
}else {
thumb.setWidth(getWidth() / 2);

TaskbarPeer.setProgressState(win, ITaskbarList3.TBPF_NOPROGRESS);
}
};

Expand Down

0 comments on commit d382be9

Please sign in to comment.