From 2b40c2e6ffbe9811b44917520e6a90520cc5c731 Mon Sep 17 00:00:00 2001 From: Robert Goldmann <deadlocker@gmx.de> Date: Wed, 1 Dec 2021 21:34:34 +0100 Subject: [PATCH] #157 - Refactoring --- .../design/ModernCartDesignViewController.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/design/ModernCartDesignViewController.java b/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/design/ModernCartDesignViewController.java index 7c21d7c6..e3d0502e 100644 --- a/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/design/ModernCartDesignViewController.java +++ b/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/design/ModernCartDesignViewController.java @@ -40,14 +40,14 @@ public class ModernCartDesignViewController extends NVC implements IColorButton private PopOver colorChooser; - public ModernCartDesignViewController(ModernCartDesign layout) { + public ModernCartDesignViewController(ModernCartDesign design) { load("view/option/layout", "ModernLayoutCart", Localization.getBundle()); - this.design = layout; - setLayout(); + this.design = design; + setDesign(); } - private void setLayout() { + private void setDesign() { backgroundColorButton.setStyle(getLinearGradientCss(design.getBackgroundColor())); playColorButton.setStyle(getLinearGradientCss(design.getPlayColor())); cueInColorButton.setStyle(getLinearGradientCss(design.getCueInColor())); @@ -75,22 +75,22 @@ public class ModernCartDesignViewController extends NVC implements IColorButton @FXML private void resetButtonHandler(ActionEvent event) { design.reset(); - setLayout(); + setDesign(); } @FXML private void backgroundColorButtonHandler(ActionEvent event) { - colorChooser(backgroundColorButton, design.getBackgroundColor(), color -> design.setBackgroundColor(color)); + colorChooser(backgroundColorButton, design.getBackgroundColor(), design::setBackgroundColor); } @FXML private void playColorButtonHandler(ActionEvent event) { - colorChooser(playColorButton, design.getPlayColor(), color -> design.setPlayColor(color)); + colorChooser(playColorButton, design.getPlayColor(), design::setPlayColor); } @FXML private void cueInColorButtonHandler(ActionEvent event) { - colorChooser(cueInColorButton, design.getPlayColor(), color -> design.setCueInColor(color)); + colorChooser(cueInColorButton, design.getPlayColor(), design::setCueInColor); } private void colorChooser(Button anchorNode, ModernColor startColor, Consumer<ModernColor> onFinish) { @@ -114,7 +114,7 @@ public class ModernCartDesignViewController extends NVC implements IColorButton } private String getLinearGradientCss(ModernColor color) { - if (Profile.currentProfile().getProfileSettings().getDesign().isFlatDesign()) { + if(Profile.currentProfile().getProfileSettings().getDesign().isFlatDesign()) { return "-fx-background-color: " + color.paint() + ";"; } else { return "-fx-background-color: " + color.linearGradient() + ";"; -- GitLab