Compare commits

...

5 Commits

5 changed files with 202347 additions and 85533 deletions

View File

@ -110,9 +110,19 @@ internal class EntryCell(private val resources: ResourceBundle, private val conf
)
)
val definition = entry.cedictDefinitions.joinToString(
separator = " / "
) { it.joinToString(separator = "; ") }
val definition = when {
entry.cedictDefinitions.isNotEmpty() -> entry.cedictDefinitions.joinToString(
separator = " / "
) { it.joinToString(separator = "; ") }
entry.crossStraitsDefinitions.isNotEmpty() -> entry.crossStraitsDefinitions.joinToString(
separator = " / "
) { it.definition }
entry.moedictDefinitions.isNotEmpty() -> entry.moedictDefinitions.joinToString(
separator = " / "
) { it.definition }
else -> error("No definition for entry")
}
labelDefinition.text = definition
contextMenu = createContextMenuForEntry(entry, resources)

View File

@ -12,6 +12,7 @@ import javafx.fxml.FXML
import javafx.scene.control.Label
import javafx.scene.control.ListView
import javafx.scene.control.ProgressIndicator
import javafx.scene.control.Tab
import javafx.scene.control.TabPane
import javafx.scene.input.ContextMenuEvent
import javafx.scene.layout.FlowPane
@ -43,6 +44,9 @@ class DetailsController(private val model: Model, private val config: Config) {
@FXML
private lateinit var tabPaneDetails: TabPane
@FXML
private lateinit var tabCharacters: Tab
@FXML
private lateinit var webViewDefinition: WebView
@ -152,6 +156,15 @@ class DetailsController(private val model: Model, private val config: Config) {
lazyUpdateTabContent(tabPaneDetails.selectionModel.selectedItem.id)
}
tabCharacters.disableProperty().bind(
Bindings.createBooleanBinding(
{
(model.selectedEntry.value?.traditionalProperty?.value?.length ?: 0) < 2
},
model.selectedEntry
)
)
}
private fun initializeListViewWords() {

View File

@ -37,6 +37,8 @@ class PreferencesDialog(
}
val root = fxmlLoader.load(javaClass.getResourceAsStream("/fxml/dialogs/preferences.fxml")) as DialogPane
root.prefHeightProperty().bind(dialogPane.scene.heightProperty())
root.prefWidthProperty().bind(dialogPane.scene.widthProperty())
dialogPane = root
title = "Settings"

View File

@ -35,7 +35,7 @@
<ProgressIndicator fx:id="progressIndicatorWords" visible="false"/>
</StackPane>
</Tab>
<Tab id="tabCharacters" closable="false" text="%tab.characters">
<Tab fx:id="tabCharacters" id="tabCharacters" closable="false" text="%tab.characters">
<StackPane>
<ListView fx:id="listViewCharacters"/>
<Label fx:id="labelNoCharactersFound" text="%list.no_characters_found" textAlignment="CENTER"

File diff suppressed because it is too large Load Diff