Update library sheet filter tab on open
Fixes #8885 (cherry picked from commit 34bb90f3c2d0cb3e8d3bb9564a702068dcb10b7e)
This commit is contained in:
parent
f367dcd5f4
commit
145adfaaa1
@ -62,10 +62,14 @@ class LibrarySettingsSheet(
|
|||||||
* @param currentCategory ID of currently shown category
|
* @param currentCategory ID of currently shown category
|
||||||
*/
|
*/
|
||||||
fun show(currentCategory: Category) {
|
fun show(currentCategory: Category) {
|
||||||
|
filters.adjustFilterSelection()
|
||||||
|
|
||||||
sort.currentCategory = currentCategory
|
sort.currentCategory = currentCategory
|
||||||
sort.adjustDisplaySelection()
|
sort.adjustDisplaySelection()
|
||||||
|
|
||||||
display.currentCategory = currentCategory
|
display.currentCategory = currentCategory
|
||||||
display.adjustDisplaySelection()
|
display.adjustDisplaySelection()
|
||||||
|
|
||||||
super.show()
|
super.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,6 +103,12 @@ class LibrarySettingsSheet(
|
|||||||
setGroups(listOf(filterGroup))
|
setGroups(listOf(filterGroup))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Refreshes Filter Setting selections
|
||||||
|
fun adjustFilterSelection() {
|
||||||
|
filterGroup.initModels()
|
||||||
|
filterGroup.items.forEach { adapter.notifyItemChanged(it) }
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if there's at least one filter from [FilterGroup] active.
|
* Returns true if there's at least one filter from [FilterGroup] active.
|
||||||
*/
|
*/
|
||||||
@ -147,6 +157,7 @@ class LibrarySettingsSheet(
|
|||||||
downloaded.enabled = false
|
downloaded.enabled = false
|
||||||
} else {
|
} else {
|
||||||
downloaded.state = libraryPreferences.filterDownloaded().get()
|
downloaded.state = libraryPreferences.filterDownloaded().get()
|
||||||
|
downloaded.enabled = true
|
||||||
}
|
}
|
||||||
unread.state = libraryPreferences.filterUnread().get()
|
unread.state = libraryPreferences.filterUnread().get()
|
||||||
started.state = libraryPreferences.filterStarted().get()
|
started.state = libraryPreferences.filterStarted().get()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user