Skip to content

Commit 4241a3a

Browse files
Allow locally customizing the color of progress bar
1 parent b2f2e5d commit 4241a3a

File tree

3 files changed

+62
-2
lines changed

3 files changed

+62
-2
lines changed

.idea/icon.svg

Lines changed: 54 additions & 0 deletions
Loading

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
## [Unreleased]
66

7+
### Added
8+
9+
- Allow locally customizing the color of progress bar
10+
711
## [0.0.4] - 2024-07-31
812

913
### Added

src/main/java/com/github/strangelookingnerd/PedroProgressBarUI.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,10 @@ protected void paintIndeterminate(Graphics graphics, JComponent component) {
129129
startColor = WARNING_COLOR;
130130
endColor = WARNING_END_COLOR;
131131
} else {
132-
startColor = INDETERMINATE_START_COLOR;
133-
endColor = INDETERMINATE_END_COLOR;
132+
startColor = progressBar.getClientProperty("ProgressBar.indeterminateStartColor") instanceof Color color ?
133+
color : INDETERMINATE_START_COLOR;
134+
endColor = progressBar.getClientProperty("ProgressBar.indeterminateEndColor") instanceof Color color ?
135+
color : INDETERMINATE_END_COLOR;
134136
}
135137

136138
Shape shape;

0 commit comments

Comments
 (0)