New Features #1

Open
marvinelsen wants to merge 95 commits from develop into main
4 changed files with 19 additions and 7 deletions
Showing only changes of commit 5baccc4b3f - Show all commits

View File

@ -142,7 +142,7 @@ class Model(
}
}
fun selectEntry(entry: DictionaryEntry) {
fun deepDive(entry: DictionaryEntry) {
undoManager.execute(object : Command {
private val previouslySelectedEntry = internalSelectedEntry.value
@ -158,6 +158,11 @@ class Model(
})
}
fun normalSelect(entry: DictionaryEntry) {
undoManager.reset()
select(entry)
}
private fun select(entry: DictionaryEntry) {
internalFinishedFindingCharacters.value = false
internalFinishedFindingWordsBeginning.value = false

View File

@ -207,7 +207,7 @@ class DetailsController(
selectionModel.selectedItemProperty().addListener { _, _, newEntry ->
if (newEntry == null) return@addListener
model.selectEntry(newEntry)
model.deepDive(newEntry)
}
}
progressIndicatorWordsContaining.visibleProperty().bind(model.isFindingWordsContaining)
@ -225,7 +225,7 @@ class DetailsController(
selectionModel.selectedItemProperty().addListener { _, _, newEntry ->
if (newEntry == null) return@addListener
model.selectEntry(newEntry)
model.deepDive(newEntry)
}
}
progressIndicatorWordsBeginning.visibleProperty().bind(model.isFindingWordsBeginning)
@ -243,7 +243,7 @@ class DetailsController(
selectionModel.selectedItemProperty().addListener { _, _, newEntry ->
if (newEntry == null) return@addListener
model.selectEntry(newEntry)
model.deepDive(newEntry)
}
}
progressIndicatorCharacters.visibleProperty().bind(model.isFindingCharacters)

View File

@ -49,7 +49,7 @@ class SearchResultsController(
if (newValue == null) {
return@addListener
}
model.selectEntry(newValue)
model.normalSelect(newValue)
}
}
}

View File

@ -15,7 +15,7 @@ class UndoManager {
undoStack.push(command).execute()
canUndoProperty.value = undoStack.size > 1
canUndoProperty.value = !undoStack.isEmpty()
canRedoProperty.value = false
}
@ -24,7 +24,7 @@ class UndoManager {
redoStack.push(undoStack.pop()).undo()
canUndoProperty.value = undoStack.size > 1
canUndoProperty.value = !undoStack.isEmpty()
canRedoProperty.value = true
}
@ -36,4 +36,11 @@ class UndoManager {
canUndoProperty.value = true
canRedoProperty.value = !redoStack.isEmpty()
}
fun reset() {
undoStack.clear()
redoStack.clear()
canUndoProperty.value = false
canRedoProperty.value = false
}
}