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

#157 - Removed old custom design checkbox

parent 408dc186
No related branches found
No related tags found
No related merge requests found
......@@ -6,23 +6,18 @@ import de.tobias.playpad.PlayPadPlugin;
import de.tobias.playpad.Strings;
import de.tobias.playpad.design.modern.model.ModernCartDesign;
import de.tobias.playpad.pad.Pad;
import de.tobias.playpad.pad.PadSettings;
import de.tobias.playpad.profile.Profile;
import de.tobias.playpad.viewcontroller.PadSettingsTabViewController;
import de.tobias.playpad.viewcontroller.design.ModernCartDesignViewController;
import de.tobias.playpad.viewcontroller.main.IMainViewController;
import javafx.fxml.FXML;
import javafx.scene.control.CheckBox;
import javafx.scene.layout.VBox;
public class DesignPadTabViewController extends PadSettingsTabViewController {
@FXML
private VBox layoutContainer;
@FXML
private CheckBox enableLayoutCheckBox;
private Pad pad;
private final Pad pad;
DesignPadTabViewController(Pad pad) {
load("view/option/pad", "LayoutTab", Localization.getBundle());
......@@ -31,26 +26,6 @@ public class DesignPadTabViewController extends PadSettingsTabViewController {
@Override
public void init() {
enableLayoutCheckBox.selectedProperty().addListener((a, b, c) ->
{
PadSettings padSettings = pad.getPadSettings();
if (c && !padSettings.isCustomDesign()) {
try {
padSettings.setCustomDesign(true);
ModernCartDesign layout = padSettings.getDesign();
layout.copyGlobalLayout(Profile.currentProfile().getProfileSettings().getDesign());
setLayoutViewController(pad);
} catch (Exception e) {
showErrorMessage(Localization.getString(Strings.ERROR_STANDARD_GEN, e.getLocalizedMessage()));
Logger.error(e);
}
} else if (!c && padSettings.isCustomDesign()) {
padSettings.setCustomDesign(false);
setLayoutViewController(null);
}
});
}
@Override
......@@ -60,13 +35,8 @@ public class DesignPadTabViewController extends PadSettingsTabViewController {
@Override
public void loadSettings(Pad pad) {
PadSettings padSettings = pad.getPadSettings();
enableLayoutCheckBox.setSelected(padSettings.isCustomDesign());
if (padSettings.isCustomDesign()) {
setLayoutViewController(pad);
}
}
private void setLayoutViewController(Pad pad) {
if (pad != null) {
......
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.*?>
<VBox spacing="14.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<VBox spacing="28.0" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1">
<children>
<HBox layoutX="14.0" layoutY="13.0" spacing="14.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0"
AnchorPane.topAnchor="14.0">
<HBox layoutX="14.0" layoutY="13.0" spacing="14.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="14.0">
<children>
<Label alignment="CENTER_RIGHT" layoutX="14.0" layoutY="14.0" prefWidth="150.0"
text="%padSettings.layout.label.custom"/>
<CheckBox fx:id="enableLayoutCheckBox" layoutX="127.0" layoutY="13.0" mnemonicParsing="false"
text="%padSettings.layout.checkbox.custom"/>
<Label alignment="CENTER_RIGHT" layoutX="14.0" layoutY="14.0" prefWidth="150.0" text="%padSettings.layout.label.custom" />
</children>
<VBox.margin>
<Insets />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment