Skip to content
Snippets Groups Projects
Commit 9f40e121 authored by Tobias Ullerich's avatar Tobias Ullerich
Browse files

Add flat color preview to color picker

parent 8cd77ce2
No related branches found
No related tags found
No related merge requests found
......@@ -69,6 +69,10 @@ public class ModernGlobalDesignViewController extends NVC {
flatDesignCheckbox.selectedProperty().addListener((a, b, c) ->
{
design.setFlatDesign(c);
// Update button preview
backgroundColorButton.setStyle(getLinearGradientCss(design.getBackgroundColor()));
playColorButton.setStyle(getLinearGradientCss(design.getPlayColor()));
});
infoLabelFontSizeComboBox.getItems().addAll(9, 10, 12, 13, 14, 16, 18, 20, 24, 28);
......
package de.tobias.playpad.design.modern;
import de.tobias.playpad.DisplayableColor;
import de.tobias.playpad.profile.Profile;
import de.tobias.playpad.util.FadeableColor;
import javafx.scene.paint.*;
......@@ -106,9 +107,13 @@ public enum ModernColor implements DisplayableColor {
@Override
public Paint getPaint() {
if (Profile.currentProfile().getProfileSettings().getDesign().isFlatDesign()) {
return Color.web(paint());
} else {
return new LinearGradient(0, 0, 0, 1, true, CycleMethod.NO_CYCLE, new Stop(0, Color.web(colorHi)),
new Stop(1, Color.web(colorLow)));
}
}
public String linearGradient() {
return "linear-gradient(" + getColorHi() + "," + getColorLow() + ")";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment