Skip to content
Snippets Groups Projects
Commit 3a084d7e authored by Robert Goldmann's avatar Robert Goldmann
Browse files

#157 - added checkboxes for all three custom color options

parent c9d6b7ed
Branches
Tags
No related merge requests found
......@@ -17,6 +17,13 @@ import java.util.function.Consumer;
public class ModernCartDesignViewController extends NVC implements IColorButton {
@FXML
private CheckBox backgroundColorCheckbox;
@FXML
private CheckBox playColorCheckbox;
@FXML
private CheckBox cueInColorCheckbox;
@FXML
private Button backgroundColorButton;
@FXML
......@@ -29,7 +36,7 @@ public class ModernCartDesignViewController extends NVC implements IColorButton
@FXML
private Button resetButton;
private ModernCartDesign design;
private final ModernCartDesign design;
private PopOver colorChooser;
......@@ -44,10 +51,22 @@ public class ModernCartDesignViewController extends NVC implements IColorButton
backgroundColorButton.setStyle(getLinearGradientCss(design.getBackgroundColor()));
playColorButton.setStyle(getLinearGradientCss(design.getPlayColor()));
cueInColorButton.setStyle(getLinearGradientCss(design.getCueInColor()));
backgroundColorCheckbox.setSelected(!design.getBackgroundColor().equals(ModernCartDesign.DEFAULT_COLOR_BACKGROUND));
playColorCheckbox.setSelected(!design.getPlayColor().equals(ModernCartDesign.DEFAULT_COLOR_PLAY));
cueInColorCheckbox.setSelected(!design.getCueInColor().equals(ModernCartDesign.DEFAULT_COLOR_CUE_IN));
}
@Override
public void init() {
backgroundColorCheckbox.selectedProperty().addListener((a, b, c) -> backgroundColorButton.setDisable(!c));
playColorCheckbox.selectedProperty().addListener((a, b, c) -> playColorButton.setDisable(!c));
cueInColorCheckbox.selectedProperty().addListener((a, b, c) -> cueInColorButton.setDisable(!c));
backgroundColorButton.setDisable(true);
playColorButton.setDisable(true);
cueInColorButton.setDisable(true);
addIconToButton(backgroundColorButton);
addIconToButton(playColorButton);
addIconToButton(cueInColorButton);
......@@ -101,5 +120,4 @@ public class ModernCartDesignViewController extends NVC implements IColorButton
return "-fx-background-color: " + color.linearGradient() + ";";
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<VBox spacing="14.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<VBox spacing="14.0" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1">
<children>
<HBox spacing="14.0">
<children>
<VBox alignment="BOTTOM_LEFT" prefWidth="150.0">
<children>
<Label alignment="CENTER_RIGHT" prefWidth="150.0" text="%layout.label.color"
VBox.vgrow="ALWAYS">
<Label alignment="CENTER_RIGHT" prefWidth="150.0" text="%layout.label.color" VBox.vgrow="ALWAYS">
<VBox.margin>
<Insets bottom="5.0" />
</VBox.margin>
......@@ -19,33 +22,30 @@
</VBox>
<VBox layoutX="110.0" layoutY="8.0" maxWidth="1.7976931348623157E308" prefWidth="125.0" spacing="14.0">
<children>
<Label alignment="BOTTOM_LEFT" layoutX="110.0" layoutY="8.0" prefHeight="60.0" prefWidth="150.0"
text="%layout.label.background" wrapText="true" VBox.vgrow="ALWAYS"/>
<Button fx:id="backgroundColorButton" focusTraversable="false" mnemonicParsing="false"
onAction="#backgroundColorButtonHandler" prefWidth="150.0"/>
<CheckBox fx:id="backgroundColorCheckbox" mnemonicParsing="false" text="%padSettings.layout.checkbox.custom" />
<Label alignment="BOTTOM_LEFT" layoutX="110.0" layoutY="8.0" prefWidth="150.0" text="%layout.label.background" wrapText="true" VBox.vgrow="ALWAYS" />
<Button fx:id="backgroundColorButton" focusTraversable="false" mnemonicParsing="false" onAction="#backgroundColorButtonHandler" prefWidth="150.0" />
</children>
</VBox>
<VBox layoutX="243.0" layoutY="8.0" maxWidth="1.7976931348623157E308" prefWidth="125.0" spacing="14.0">
<children>
<Label alignment="BOTTOM_LEFT" layoutX="243.0" layoutY="8.0" prefHeight="60.0" prefWidth="150.0"
text="%layout.label.play" wrapText="true" VBox.vgrow="ALWAYS"/>
<Button fx:id="playColorButton" focusTraversable="false" mnemonicParsing="false"
onAction="#playColorButtonHandler" prefWidth="150.0"/>
<CheckBox fx:id="playColorCheckbox" mnemonicParsing="false" text="%padSettings.layout.checkbox.custom" />
<Label alignment="BOTTOM_LEFT" layoutX="243.0" layoutY="8.0" prefWidth="150.0" text="%layout.label.play" wrapText="true" VBox.vgrow="ALWAYS" />
<Button fx:id="playColorButton" focusTraversable="false" mnemonicParsing="false" onAction="#playColorButtonHandler" prefWidth="150.0" />
</children>
</VBox>
<VBox layoutX="243.0" layoutY="8.0" maxWidth="1.7976931348623157E308" prefWidth="125.0" spacing="14.0">
<children>
<Label alignment="BOTTOM_LEFT" layoutX="243.0" layoutY="8.0" prefHeight="60.0" prefWidth="150.0"
text="%layout.label.cueIn" wrapText="true" VBox.vgrow="ALWAYS"/>
<Button fx:id="cueInColorButton" focusTraversable="false" mnemonicParsing="false"
onAction="#cueInColorButtonHandler" prefWidth="150.0"/>
<CheckBox fx:id="cueInColorCheckbox" mnemonicParsing="false" text="%padSettings.layout.checkbox.custom" />
<Label alignment="BOTTOM_LEFT" layoutX="243.0" layoutY="8.0" prefWidth="150.0" text="%layout.label.cueIn" wrapText="true" VBox.vgrow="ALWAYS" />
<Button fx:id="cueInColorButton" focusTraversable="false" mnemonicParsing="false" onAction="#cueInColorButtonHandler" prefWidth="150.0" />
</children>
</VBox>
</children>
</HBox>
<Button fx:id="resetButton" mnemonicParsing="false" onAction="#resetButtonHandler" text="%layout.button.reset">
<Button fx:id="resetButton" alignment="CENTER" mnemonicParsing="false" onAction="#resetButtonHandler" text="%layout.button.reset">
<VBox.margin>
<Insets left="164.0"/>
<Insets left="164.0" top="28.0" />
</VBox.margin>
</Button>
</children>
......
......@@ -14,6 +14,10 @@ import java.util.UUID;
public class ModernCartDesign implements FeedbackDesignColorSuggester {
public static final ModernColor DEFAULT_COLOR_BACKGROUND = ModernColor.GRAY1;
public static final ModernColor DEFAULT_COLOR_PLAY = ModernColor.RED3;
public static final ModernColor DEFAULT_COLOR_CUE_IN = ModernColor.RED2;
private UUID uuid;
private ObjectProperty<ModernColor> backgroundColor;
private ObjectProperty<ModernColor> playColor;
......@@ -94,12 +98,11 @@ public class ModernCartDesign implements FeedbackDesignColorSuggester {
}
public void reset() {
backgroundColor.set(ModernColor.GRAY1);
playColor.set(ModernColor.RED3);
cueInColor.set(ModernColor.RED2);
backgroundColor.set(DEFAULT_COLOR_BACKGROUND);
playColor.set(DEFAULT_COLOR_PLAY);
cueInColor.set(DEFAULT_COLOR_CUE_IN);
}
// Color Associator
@Override
public Color getDesignEventColor() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment