Yhtenäinen TV_COLUMN_STYLE

Signed-off-by: laurimaaninka <lauri.maaninka@gmail.com>
This commit is contained in:
2026-05-31 14:18:15 +03:00
parent 0634e8a13b
commit 127c9d671b
5 changed files with 10 additions and 17 deletions
+2 -2
View File
@@ -330,8 +330,8 @@ public class AsiakasIkkuna extends Stage {
alert.setTitle("Onnistuimme!"); alert.setTitle("Onnistuimme!");
alert.setHeaderText("Asiakkaan tallentaminen onnistui!"); alert.setHeaderText("Asiakkaan tallentaminen onnistui!");
//TODO tähän myös dinneri määrät... //TODO tähän myös dinneri määrät...
// alert.setContentText(String.format("%s saa jatkossa yhteensä \n%s salaattia, %s pääruokaa ja %s jälkiruokaa viikossa", alert.setContentText(String.format("%s saa lounaalla yhteensä \n%s salaattia, %s pääruokaa ja %s jälkiruokaa viikossa",
// käsiteltäväAsiakas.getNimi(), käsiteltäväAsiakas.getSalaatit()*viikonKuljetukset, käsiteltäväAsiakas.getPääruoat()*viikonKuljetukset, käsiteltäväAsiakas.getPääruoat()*viikonKuljetukset)); käsiteltäväAsiakas.getNimi(), käsiteltäväAsiakas.getSalaatit()*viikonKuljetukset, käsiteltäväAsiakas.getPääruoat()*viikonKuljetukset, käsiteltäväAsiakas.getPääruoat()*viikonKuljetukset));
alert.showAndWait(); alert.showAndWait();
this.close(); this.close();
} }
@@ -1,9 +1,7 @@
package fi.lpam.gui; package fi.lpam.gui;
import fi.lpam.Main;
import fi.lpam.dataluokat.Asiakas; import fi.lpam.dataluokat.Asiakas;
import fi.lpam.gui.elementit.FontLabel; import fi.lpam.gui.elementit.FontLabel;
import fi.lpam.gui.elementit.MaaraTableColumn;
import fi.lpam.gui.elementit.TabPohja; import fi.lpam.gui.elementit.TabPohja;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.scene.control.*; import javafx.scene.control.*;
@@ -191,10 +189,6 @@ public class Asiakashallinta extends TabPohja {
column.setEditable(false); column.setEditable(false);
column.setReorderable(false); column.setReorderable(false);
column.setResizable(true); column.setResizable(true);
column.setStyle( column.setStyle(TV_COLUMN_STYLE);
"-fx-alignment: CENTER;" +
"-fx-font-size: " + Main.properties.getProperty("tekstiFonttiKoko") + "px;" +
"-fx-font-family: " + Main.properties.getProperty("tekstiFontti")
);
} }
} }
@@ -143,10 +143,7 @@ public class KuljetusListat extends TabPohja {
sarake.setSortable(false); sarake.setSortable(false);
sarake.setEditable(true); sarake.setEditable(true);
sarake.setResizable(true); sarake.setResizable(true);
sarake.setStyle( sarake.setStyle(TV_COLUMN_STYLE);
"-fx-alignment: CENTER;" +
"-fx-font-size: " + Main.properties.getProperty("tekstiFonttiKoko") + "px;" +
"-fx-font-family: " + Main.properties.getProperty("tekstiFontti"));
} }
tcNimi.setEditable(false); tcNimi.setEditable(false);
} }
@@ -123,10 +123,7 @@ public class KuljetusRaportit extends TabPohja {
for (TableColumn<RaporttiRivi, ?> sarake : tableView.getColumns()) { for (TableColumn<RaporttiRivi, ?> sarake : tableView.getColumns()) {
sarake.setEditable(false); sarake.setEditable(false);
sarake.setResizable(true); sarake.setResizable(true);
sarake.setStyle( sarake.setStyle(TV_COLUMN_STYLE);
"-fx-alignment: CENTER;" +
"-fx-font-size: " + Main.properties.getProperty("tekstiFonttiKoko") + "px;" +
"-fx-font-family: " + Main.properties.getProperty("tekstiFontti"));
} }
} }
} }
@@ -17,6 +17,7 @@ public class TabPohja extends Tab {
public static Insets INSETS; public static Insets INSETS;
public static Border BORDER = new Border(new BorderStroke(Color.BLACK, BorderStrokeStyle.SOLID, new CornerRadii(5), BorderWidths.DEFAULT)); public static Border BORDER = new Border(new BorderStroke(Color.BLACK, BorderStrokeStyle.SOLID, new CornerRadii(5), BorderWidths.DEFAULT));
public static String STYLE; public static String STYLE;
public static String TV_COLUMN_STYLE;
public static Font BUTTON_FONT; public static Font BUTTON_FONT;
public static Font TEKSTI_FONT; public static Font TEKSTI_FONT;
public static double SPACING; public static double SPACING;
@@ -29,6 +30,10 @@ public class TabPohja extends Tab {
INSETS = new Insets(Double.parseDouble(prop.getProperty("insets"))); INSETS = new Insets(Double.parseDouble(prop.getProperty("insets")));
SPACING = Double.parseDouble(prop.getProperty("insets")); SPACING = Double.parseDouble(prop.getProperty("insets"));
STYLE = "-fx-background-color: " + prop.getProperty("taustaVari"); STYLE = "-fx-background-color: " + prop.getProperty("taustaVari");
TV_COLUMN_STYLE =
"-fx-alignment: CENTER;" +
"-fx-font-size: " + Main.properties.getProperty("tekstiFonttiKoko") + "px;" +
"-fx-font-family: " + Main.properties.getProperty("tekstiFontti");
BUTTON_FONT = Font.font(prop.getProperty("buttonFontti"), FontWeight.BOLD, Double.parseDouble(prop.getProperty("buttonFonttiKoko"))); BUTTON_FONT = Font.font(prop.getProperty("buttonFontti"), FontWeight.BOLD, Double.parseDouble(prop.getProperty("buttonFonttiKoko")));
TEKSTI_FONT = Font.font(prop.getProperty("tekstiFontti"), FontWeight.NORMAL, Double.parseDouble(prop.getProperty("tekstiFonttiKoko"))); TEKSTI_FONT = Font.font(prop.getProperty("tekstiFontti"), FontWeight.NORMAL, Double.parseDouble(prop.getProperty("tekstiFonttiKoko")));