Skip to content

Commit e46c432

Browse files
ddamkeddamke
authored andcommitted
update Icon color when changing color
1 parent 825e542 commit e46c432

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

src/main/java/de/doubleslash/keeptime/common/SvgNodeProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static String getSvgPathWithXMl(Resources.RESOURCE resource) {
4242
return svgPath;
4343
}
4444

45-
public static Node getSvgNodeWithScale(Resources.RESOURCE resource, Double scaleX, Double scaleY) {
45+
public static SVGPath getSvgNodeWithScale(Resources.RESOURCE resource, Double scaleX, Double scaleY) {
4646
SVGPath iconSvg = new SVGPath();
4747
iconSvg.setContent(getSvgPathWithXMl(resource));
4848
iconSvg.setScaleX(scaleX);

src/main/java/de/doubleslash/keeptime/view/ViewController.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,17 +196,21 @@ private void initialize() {
196196

197197
calendarButton.setOnAction(ae -> calendarClicked());
198198

199-
calendarButton.textFillProperty().bind(fontColorProperty);
200-
calendarButton.setGraphic(SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_CALENDAR_DAYS_ICON, 0.03, 0.03));
199+
SVGPath calendarSvgPath = SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_CALENDAR_DAYS_ICON, 0.03, 0.03);
200+
calendarSvgPath.fillProperty().bind(fontColorProperty);
201+
calendarButton.setGraphic(calendarSvgPath);
201202

202-
closeButton.textFillProperty().bind(fontColorProperty);
203-
closeButton.setGraphic(SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_CLOSE_ICON, 0.03, 0.03));
203+
SVGPath closeSvgPath = SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_CLOSE_ICON, 0.03, 0.03);
204+
closeSvgPath.fillProperty().bind(fontColorProperty);
205+
closeButton.setGraphic(closeSvgPath);
204206

205-
settingsButton.textFillProperty().bind(fontColorProperty);
206-
settingsButton.setGraphic(SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_SETTINGS_ICON, 0.03, 0.03));
207+
SVGPath settingsSvgPath = SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_SETTINGS_ICON, 0.03, 0.03);
208+
settingsSvgPath.fillProperty().bind(fontColorProperty);
209+
settingsButton.setGraphic(settingsSvgPath);
207210

208-
minimizeButton.textFillProperty().bind(fontColorProperty);
209-
minimizeButton.setGraphic(SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_MINUS_ICON, 0.03, 0.03));
211+
SVGPath minimizeSvgPath = SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_MINUS_ICON, 0.03, 0.03);
212+
minimizeSvgPath.fillProperty().bind(fontColorProperty);
213+
minimizeButton.setGraphic(minimizeSvgPath);
210214

211215
final Runnable updateMainBackgroundColor = this::runUpdateMainBackgroundColor;
212216

0 commit comments

Comments
 (0)