Disable characters tab for entries that only contain a single character
This commit is contained in:
parent
cf07585361
commit
1c5b7d9bcc
@ -12,6 +12,7 @@ import javafx.fxml.FXML
|
|||||||
import javafx.scene.control.Label
|
import javafx.scene.control.Label
|
||||||
import javafx.scene.control.ListView
|
import javafx.scene.control.ListView
|
||||||
import javafx.scene.control.ProgressIndicator
|
import javafx.scene.control.ProgressIndicator
|
||||||
|
import javafx.scene.control.Tab
|
||||||
import javafx.scene.control.TabPane
|
import javafx.scene.control.TabPane
|
||||||
import javafx.scene.input.ContextMenuEvent
|
import javafx.scene.input.ContextMenuEvent
|
||||||
import javafx.scene.layout.FlowPane
|
import javafx.scene.layout.FlowPane
|
||||||
@ -43,6 +44,9 @@ class DetailsController(private val model: Model, private val config: Config) {
|
|||||||
@FXML
|
@FXML
|
||||||
private lateinit var tabPaneDetails: TabPane
|
private lateinit var tabPaneDetails: TabPane
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private lateinit var tabCharacters: Tab
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private lateinit var webViewDefinition: WebView
|
private lateinit var webViewDefinition: WebView
|
||||||
|
|
||||||
@ -152,6 +156,15 @@ class DetailsController(private val model: Model, private val config: Config) {
|
|||||||
|
|
||||||
lazyUpdateTabContent(tabPaneDetails.selectionModel.selectedItem.id)
|
lazyUpdateTabContent(tabPaneDetails.selectionModel.selectedItem.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tabCharacters.disableProperty().bind(
|
||||||
|
Bindings.createBooleanBinding(
|
||||||
|
{
|
||||||
|
(model.selectedEntry.value?.traditionalProperty?.value?.length ?: 0) < 2
|
||||||
|
},
|
||||||
|
model.selectedEntry
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initializeListViewWords() {
|
private fun initializeListViewWords() {
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
<ProgressIndicator fx:id="progressIndicatorWords" visible="false"/>
|
<ProgressIndicator fx:id="progressIndicatorWords" visible="false"/>
|
||||||
</StackPane>
|
</StackPane>
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab id="tabCharacters" closable="false" text="%tab.characters">
|
<Tab fx:id="tabCharacters" id="tabCharacters" closable="false" text="%tab.characters">
|
||||||
<StackPane>
|
<StackPane>
|
||||||
<ListView fx:id="listViewCharacters"/>
|
<ListView fx:id="listViewCharacters"/>
|
||||||
<Label fx:id="labelNoCharactersFound" text="%list.no_characters_found" textAlignment="CENTER"
|
<Label fx:id="labelNoCharactersFound" text="%list.no_characters_found" textAlignment="CENTER"
|
||||||
|
Loading…
Reference in New Issue
Block a user