New Features #1

Open
marvinelsen wants to merge 76 commits from develop into main
4 changed files with 8 additions and 8 deletions
Showing only changes of commit 6003bc678e - Show all commits

View File

@ -2,7 +2,7 @@ package com.marvinelsen.willow.ui.controllers
import com.marvinelsen.willow.Config
import com.marvinelsen.willow.Model
import com.marvinelsen.willow.ui.dialogs.SettingsDialog
import com.marvinelsen.willow.ui.dialogs.PreferencesDialog
import javafx.application.Platform
import javafx.beans.binding.Bindings
import javafx.fxml.FXML
@ -28,10 +28,10 @@ class MenuController(private val model: Model, private val config: Config) {
@FXML
private fun onMenuItemPreferencesAction() {
SettingsDialog(menuBar.scene.window, config).showAndWait().ifPresent { result ->
PreferencesDialog(menuBar.scene.window, config).showAndWait().ifPresent { result ->
when (result) {
SettingsDialog.Result.CHANGES -> config.save()
SettingsDialog.Result.NO_CHANGES -> config.load()
PreferencesDialog.Result.CHANGES -> config.save()
PreferencesDialog.Result.NO_CHANGES -> config.load()
}
}
}

View File

@ -17,7 +17,7 @@ import javafx.stage.Window
import javafx.util.Callback
@Suppress("MemberVisibilityCanBePrivate")
class SettingsDialog(owner: Window?, config: Config) : Dialog<SettingsDialog.Result>() {
class PreferencesDialog(owner: Window?, config: Config) : Dialog<PreferencesDialog.Result>() {
companion object {
private const val DIALOG_MIN_HEIGHT = 400.0
private const val DIALOG_MIN_WIDTH = 400.0
@ -42,7 +42,7 @@ class SettingsDialog(owner: Window?, config: Config) : Dialog<SettingsDialog.Res
private val entryHeadwordFontSizeObjectProperty = config.detailHeadwordFontSize.asObject()
init {
val loader = FXMLLoader(WillowApplication::class.java.getResource("/fxml/settings-dialog.fxml"))
val loader = FXMLLoader(WillowApplication::class.java.getResource("/fxml/preferences-dialog.fxml"))
loader.setController(this)
val root: DialogPane = loader.load()

View File

@ -37,6 +37,6 @@
-fx-font: 16 "Noto Sans TC";
}
.settings-dialog .content {
.preferences-dialog .content {
-fx-padding: 0;
}

View File

@ -6,7 +6,7 @@
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<DialogPane styleClass="settings-dialog" xmlns="http://javafx.com/javafx/23" xmlns:fx="http://javafx.com/fxml/1">
<DialogPane styleClass="preferences-dialog" xmlns="http://javafx.com/javafx/23" xmlns:fx="http://javafx.com/fxml/1">
<fx:define>
<FXCollections fx:factory="observableArrayList" fx:id="phoneticAlphabets">
<Pronunciation fx:value="PINYIN_WITH_TONE_MARKS"/>