New Features #1
@ -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
|
||||
|
@ -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)
|
||||
|
@ -49,7 +49,7 @@ class SearchResultsController(
|
||||
if (newValue == null) {
|
||||
return@addListener
|
||||
}
|
||||
model.selectEntry(newValue)
|
||||
model.normalSelect(newValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user