#fix 19 TabPohja on nyt Tab, joka hoitaa monia asioita kuin itsestään
Signed-off-by: laurimaaninka <lauri.maaninka@gmail.com>
This commit is contained in:
@@ -6,7 +6,6 @@ import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.layout.BorderPane;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.scene.layout.HBox;
|
||||
import javafx.scene.text.Font;
|
||||
@@ -21,21 +20,19 @@ public class Asetukset extends TabPohja {
|
||||
|
||||
|
||||
public Asetukset() {
|
||||
BorderPane root = new BorderPane();
|
||||
root.setPadding(oletusInsets);
|
||||
super("Asetukset");
|
||||
|
||||
HBox yläpalkki = new HBox();
|
||||
yläpalkki.setSpacing(5);
|
||||
yläpalkki.setAlignment(Pos.CENTER_RIGHT);
|
||||
Button btnNollaa = new Button("Palauta oletukset");
|
||||
btnNollaa.setFont(buttonFont);
|
||||
btnNollaa.setFont(BUTTON_FONT);
|
||||
btnNollaa.setOnAction(_ -> palautaOletukset());
|
||||
yläpalkki.getChildren().add(btnNollaa);
|
||||
root.setTop(yläpalkki);
|
||||
|
||||
root.setCenter(getFonttiAsetukset());
|
||||
|
||||
this.getChildren().add(root);
|
||||
}
|
||||
|
||||
private Spinner<Integer> tekstiFonttiKoko, buttonFonttiKoko, tulostusFonttiKoko, insets;
|
||||
@@ -48,14 +45,14 @@ public class Asetukset extends TabPohja {
|
||||
private GridPane getFonttiAsetukset() {
|
||||
GridPane root = new GridPane();
|
||||
root.setAlignment(Pos.CENTER);
|
||||
root.setHgap(spacing*2);
|
||||
root.setVgap(spacing*2);
|
||||
root.setBorder(oletusBorder);
|
||||
root.setPadding(oletusInsets);
|
||||
root.setHgap(SPACING *2);
|
||||
root.setVgap(SPACING *2);
|
||||
root.setBorder(BORDER);
|
||||
root.setPadding(INSETS);
|
||||
int row = 0;
|
||||
|
||||
Label otsikko = new Label("Fonttien asetukset");
|
||||
otsikko.setFont(tekstiFont);
|
||||
otsikko.setFont(TEKSTI_FONT);
|
||||
root.addRow(row++, otsikko);
|
||||
|
||||
int minFonttiKoko = 8;
|
||||
@@ -64,7 +61,7 @@ public class Asetukset extends TabPohja {
|
||||
tekstiFonttiKoko = new Spinner<>(minFonttiKoko, maxFonttiKoko, Integer.parseInt(prop.getProperty("tekstiFonttiKoko")), stepFontti);
|
||||
tekstiFonttiKoko.valueProperty().addListener((_) -> prop.setProperty("tekstiFonttiKoko", String.valueOf(tekstiFonttiKoko.getValue())));
|
||||
Label tekstinKoko = new Label("Tekstin koko");
|
||||
tekstinKoko.setFont(tekstiFont);
|
||||
tekstinKoko.setFont(TEKSTI_FONT);
|
||||
root.addRow(row++, tekstinKoko, tekstiFonttiKoko);
|
||||
|
||||
tekstiFontti = new ComboBox<>();
|
||||
@@ -72,13 +69,13 @@ public class Asetukset extends TabPohja {
|
||||
tekstiFontti.getSelectionModel().select(prop.getProperty("tekstiFontti"));
|
||||
tekstiFontti.valueProperty().addListener((_) -> prop.setProperty("tekstiFontti", tekstiFontti.getValue()));
|
||||
Label tekstinFontti = new Label("Tekstin fontti");
|
||||
tekstinFontti.setFont(tekstiFont);
|
||||
tekstinFontti.setFont(TEKSTI_FONT);
|
||||
root.addRow(row++, tekstinFontti, tekstiFontti);
|
||||
|
||||
buttonFonttiKoko = new Spinner<>(minFonttiKoko, maxFonttiKoko, Integer.parseInt(prop.getProperty("buttonFonttiKoko")), stepFontti);
|
||||
buttonFonttiKoko.valueProperty().addListener((_) -> prop.setProperty("buttonFonttiKoko", String.valueOf(buttonFonttiKoko.getValue())));
|
||||
Label nappiTekstinKoko = new Label("Painikkeiden koko");
|
||||
nappiTekstinKoko.setFont(tekstiFont);
|
||||
nappiTekstinKoko.setFont(TEKSTI_FONT);
|
||||
root.addRow(row++, nappiTekstinKoko, buttonFonttiKoko);
|
||||
|
||||
buttonFontti = new ComboBox<>();
|
||||
@@ -86,19 +83,19 @@ public class Asetukset extends TabPohja {
|
||||
buttonFontti.getSelectionModel().select(prop.getProperty("buttonFontti"));
|
||||
buttonFontti.valueProperty().addListener((_) -> prop.setProperty("buttonFontti", buttonFontti.getValue()));
|
||||
Label napinFontti = new Label("Painikkeiden fontti");
|
||||
napinFontti.setFont(tekstiFont);
|
||||
napinFontti.setFont(TEKSTI_FONT);
|
||||
root.addRow(row++, napinFontti, buttonFontti);
|
||||
|
||||
tulostusFonttiKoko = new Spinner<>(minFonttiKoko, maxFonttiKoko, Integer.parseInt(prop.getProperty("tulostusFonttiKoko")), stepFontti);
|
||||
tulostusFonttiKoko.valueProperty().addListener((_) -> prop.setProperty("tulostusFonttiKoko", String.valueOf(tulostusFonttiKoko.getValue())));
|
||||
Label tulostusFontinKoko = new Label("Tulostusfontin koko");
|
||||
tulostusFontinKoko.setFont(tekstiFont);
|
||||
tulostusFontinKoko.setFont(TEKSTI_FONT);
|
||||
root.addRow(row++, tulostusFontinKoko, tulostusFonttiKoko);
|
||||
|
||||
insets = new Spinner<>(0, 10, Integer.parseInt(prop.getProperty("insets")), 1);
|
||||
insets.valueProperty().addListener((_) -> prop.setProperty("insets", String.valueOf(insets.getValue())));
|
||||
Label insetsi = new Label("Yleinen fyllinki");
|
||||
insetsi.setFont(tekstiFont);
|
||||
insetsi.setFont(TEKSTI_FONT);
|
||||
root.addRow(row++, insetsi, insets);
|
||||
|
||||
return root;
|
||||
|
||||
Reference in New Issue
Block a user