From 12eb98d5b1f13aa32108378095b719928c896df8 Mon Sep 17 00:00:00 2001 From: Marvin Elsen Date: Thu, 3 Oct 2024 12:41:12 +0200 Subject: [PATCH] Display pronunciation in details view --- .../kotlin/com/marvinelsen/willow/Model.kt | 6 +- .../com/marvinelsen/willow/config/Config.kt | 64 ++++++++++++------- .../ui/controllers/DetailsController.kt | 36 ++++++++++- .../willow/ui/dialogs/PreferencesDialog.kt | 8 ++- src/main/resources/css/details.css | 5 +- src/main/resources/css/main.css | 4 -- src/main/resources/fxml/details.fxml | 18 ++++-- 7 files changed, 105 insertions(+), 36 deletions(-) diff --git a/src/main/kotlin/com/marvinelsen/willow/Model.kt b/src/main/kotlin/com/marvinelsen/willow/Model.kt index 3622d3f..1823638 100644 --- a/src/main/kotlin/com/marvinelsen/willow/Model.kt +++ b/src/main/kotlin/com/marvinelsen/willow/Model.kt @@ -14,7 +14,11 @@ import javafx.collections.FXCollections import javafx.collections.ObservableList import javafx.event.EventHandler -class Model(private val searchService: SearchService, private val findWordsService: FindWordsService, private val findCharacterService: FindCharacterService) { +class Model( + private val searchService: SearchService, + private val findWordsService: FindWordsService, + private val findCharacterService: FindCharacterService, +) { private val internalSelectedEntry: ObjectProperty = SimpleObjectProperty() private val internalSearchResults: ObservableList = FXCollections.observableArrayList() private val internalWordsContaining: ObservableList = FXCollections.observableArrayList() diff --git a/src/main/kotlin/com/marvinelsen/willow/config/Config.kt b/src/main/kotlin/com/marvinelsen/willow/config/Config.kt index e8c4b4e..c04afc8 100644 --- a/src/main/kotlin/com/marvinelsen/willow/config/Config.kt +++ b/src/main/kotlin/com/marvinelsen/willow/config/Config.kt @@ -14,11 +14,7 @@ class Config { private const val LOCALE_KEY = "locale" private const val THEME_KEY = "theme" private const val SCRIPT_KEY = "script" - private const val DETAIL_HEADWORD_FONT_SIZE_KEY = "detailHeadwordFontSize" - private const val DETAIL_PRONUNCIATION_FONT_SIZE_KEY = "detailPronunciationFontSize" - private const val DEFAULT_DETAIL_HEADWORD_FONT_SIZE = 40 - private const val DEFAULT_DETAIL_PRONUNCIATION_FONT_SIZE = 16 private val DEFAULT_THEME = Theme.SYSTEM private val DEFAULT_SCRIPT = Script.SIMPLIFIED private val DEFAULT_LOCALE = Locale.ENGLISH @@ -26,21 +22,19 @@ class Config { private val preferences = Preferences.userNodeForPackage(this::class.java) val searchResults = SearchResultsConfig(preferences) + val details = DetailsConfig(preferences) val locale: ObjectProperty = SimpleObjectProperty(DEFAULT_LOCALE) val theme: ObjectProperty = SimpleObjectProperty(DEFAULT_THEME) val script: ObjectProperty