diff --git a/pom.xml b/pom.xml index 7c6e089..d9cd716 100644 --- a/pom.xml +++ b/pom.xml @@ -155,6 +155,7 @@ + false src/main/resources/io/github/dbchoco/Salawat/images/icon.ico @@ -162,6 +163,7 @@ ${name}-${version}.exe + installForCurrentUser false false @@ -172,7 +174,7 @@ HKCU:Software\Microsoft\Windows\CurrentVersion\Run Salawat REG_SZ - C:\Program Files\Salawat\Salawat.exe + %USERPROFILE%\AppData\Local\Programs\Salawat\Salawat.exe @@ -183,41 +185,4 @@ - - - flatpak - - - - io.github.fvarrui - javapackager - 1.6.6 - - - - - io.github.dbchoco.Salawat.FakeMain - - true - true - ${project.build.directory}/${project.artifactId}-${project.version}.jar - true - false - false - auto - Salawat.desktop - - src/main/resources/io/github/dbchoco/Salawat/images/icon.png - false - false - - - - - - - - - - \ No newline at end of file diff --git a/src/main/java/io/github/dbchoco/Salawat/controllers/settings/HeaderController.java b/src/main/java/io/github/dbchoco/Salawat/controllers/settings/HeaderController.java index 0eddb2b..32a5029 100644 --- a/src/main/java/io/github/dbchoco/Salawat/controllers/settings/HeaderController.java +++ b/src/main/java/io/github/dbchoco/Salawat/controllers/settings/HeaderController.java @@ -2,6 +2,7 @@ import io.github.dbchoco.Salawat.app.I18N; import io.github.dbchoco.Salawat.controllers.BaseController; +import io.github.dbchoco.Salawat.helpers.FontBinder; import io.github.dbchoco.Salawat.helpers.SizeBinder; import javafx.scene.control.Label; import javafx.scene.layout.FlowPane; @@ -24,7 +25,8 @@ protected void translate() { @Override protected void makeResizable() { - SizeBinder.bindSize(hbox, 1280, 70, "settings"); - SizeBinder.bindSize(flowPane, 600, 70, "settings"); + SizeBinder.bindSize(hbox, 1280, 80, "settings"); + SizeBinder.bindSize(flowPane, 600, 80, "settings"); + FontBinder.bindFontSize(settingsLabel, "large"); } } diff --git a/src/main/java/io/github/dbchoco/Salawat/controllers/settings/SettingsController.java b/src/main/java/io/github/dbchoco/Salawat/controllers/settings/SettingsController.java index a0cc8b1..8e615fb 100644 --- a/src/main/java/io/github/dbchoco/Salawat/controllers/settings/SettingsController.java +++ b/src/main/java/io/github/dbchoco/Salawat/controllers/settings/SettingsController.java @@ -1,35 +1,47 @@ package io.github.dbchoco.Salawat.controllers.settings; +import io.github.dbchoco.Salawat.app.I18N; import io.github.dbchoco.Salawat.app.UserSettings; import io.github.dbchoco.Salawat.controllers.BaseController; import io.github.dbchoco.Salawat.helpers.Controllers; +import io.github.dbchoco.Salawat.helpers.FontBinder; import io.github.dbchoco.Salawat.helpers.SizeBinder; import javafx.beans.property.ReadOnlyDoubleProperty; +import javafx.scene.control.Label; import javafx.scene.image.Image; import javafx.scene.layout.*; import javafx.scene.paint.Color; +import java.awt.*; + public class SettingsController extends BaseController { public BorderPane borderPane; public GridPane gridPane; public AnchorPane root; public FlowPane mainSettings; + public Label quranQuote; + public Label quranSource; public void initialize(){ loadBackground(); Controllers.setSettingsController(this); makeResizable(); + translate(); } @Override protected void translate() { - + I18N.bindString(quranQuote, "quote"); + I18N.bindString(quranSource, "source"); } @Override protected void makeResizable() { //SizeBinder.bindSize(root, 1280, 720, "settings"); SizeBinder.bindSize(borderPane, 1280, 720, "settings"); + SizeBinder.bindSize(gridPane, 1280, 500, "settings"); + FontBinder.bindFontSize(quranQuote, "small"); + FontBinder.bindFontSize(quranSource, "smaller"); } public ReadOnlyDoubleProperty getWidthProperty(){ diff --git a/src/main/java/io/github/dbchoco/Salawat/helpers/FontBinder.java b/src/main/java/io/github/dbchoco/Salawat/helpers/FontBinder.java index 6fe617c..0955d3c 100644 --- a/src/main/java/io/github/dbchoco/Salawat/helpers/FontBinder.java +++ b/src/main/java/io/github/dbchoco/Salawat/helpers/FontBinder.java @@ -14,12 +14,16 @@ public class FontBinder { private static final ObjectProperty fontLarge = new SimpleObjectProperty(font); static final ObjectProperty fontMedium = new SimpleObjectProperty(font); private static final ObjectProperty fontSmall = new SimpleObjectProperty(font); + private static final ObjectProperty fontSmaller = new SimpleObjectProperty(font); + + private static final Integer smallerFontRatio = 50; private static final Integer smallFontRatio = 35; private static final Integer mediumFontRatio = 25; private static final Integer largeFontRatio = 18; private static final Integer largerFontRatio = 10; public static void init(){ + fontSmaller.set(FontChooser.getFont(StageController.getStage().heightProperty().doubleValue() / smallerFontRatio)); fontSmall.set(FontChooser.getFont(StageController.getStage().heightProperty().doubleValue() / smallFontRatio)); fontMedium.set(FontChooser.getFont( StageController.getStage().heightProperty().doubleValue() / mediumFontRatio)); @@ -28,6 +32,7 @@ public static void init(){ StageController.getStage().heightProperty().addListener(new ChangeListener() { @Override public void changed(ObservableValue observableValue, Number number, Number t1) { + fontSmaller.set(FontChooser.getFont(t1.doubleValue() / smallerFontRatio)); fontSmall.set(FontChooser.getFont(t1.doubleValue() / smallFontRatio)); fontMedium.set(FontChooser.getFont(t1.doubleValue() / mediumFontRatio)); fontLarge.set(FontChooser.getFont(t1.doubleValue() / largeFontRatio)); @@ -37,6 +42,7 @@ public void changed(ObservableValue observableValue, Number nu } public static void reloadFonts(){ + fontSmaller.set(FontChooser.getFont(StageController.getStage().heightProperty().doubleValue() / smallerFontRatio)); fontSmall.set(FontChooser.getFont(StageController.getStage().heightProperty().doubleValue() / smallFontRatio)); fontMedium.set(FontChooser.getFont( StageController.getStage().heightProperty().doubleValue() / mediumFontRatio)); @@ -46,6 +52,7 @@ public static void reloadFonts(){ public static void bindFontSize(Label label, String size){ switch (size){ + case "smaller" -> label.fontProperty().bind(fontSmaller); case "small" -> label.fontProperty().bind(fontSmall); case "medium" -> label.fontProperty().bind(fontMedium); case "large" -> label.fontProperty().bind(fontLarge); diff --git a/src/main/resources/io/github/dbchoco/Salawat/fxml/settings.fxml b/src/main/resources/io/github/dbchoco/Salawat/fxml/settings.fxml index 9134733..70612dc 100644 --- a/src/main/resources/io/github/dbchoco/Salawat/fxml/settings.fxml +++ b/src/main/resources/io/github/dbchoco/Salawat/fxml/settings.fxml @@ -1,5 +1,7 @@ + + @@ -7,6 +9,7 @@ + @@ -22,22 +25,41 @@
- + - + + - + + + + + + + + + + + + + + +