Always show library tabs and counts when searching

Closes #8680
This commit is contained in:
arkon 2022-12-05 10:06:41 -05:00
parent c288e6b8fa
commit 3f9820ac79
4 changed files with 3 additions and 6 deletions

View File

@ -38,7 +38,7 @@ fun LazyGridScope.globalSearchItem(
searchQuery: String?, searchQuery: String?,
onGlobalSearchClicked: () -> Unit, onGlobalSearchClicked: () -> Unit,
) { ) {
if (searchQuery.isNullOrEmpty().not()) { if (!searchQuery.isNullOrEmpty()) {
item( item(
span = { GridItemSpan(maxLineSpan) }, span = { GridItemSpan(maxLineSpan) },
contentType = { "library_global_search_item" }, contentType = { "library_global_search_item" },

View File

@ -32,7 +32,6 @@ fun LibraryContent(
selection: List<LibraryManga>, selection: List<LibraryManga>,
contentPadding: PaddingValues, contentPadding: PaddingValues,
currentPage: () -> Int, currentPage: () -> Int,
isLibraryEmpty: Boolean,
showPageTabs: Boolean, showPageTabs: Boolean,
onChangeCurrentPage: (Int) -> Unit, onChangeCurrentPage: (Int) -> Unit,
onMangaClicked: (Long) -> Unit, onMangaClicked: (Long) -> Unit,

View File

@ -747,7 +747,6 @@ class LibraryScreenModel(
val selectionMode = selection.isNotEmpty() val selectionMode = selection.isNotEmpty()
val categories = library.keys.toList() val categories = library.keys.toList()
private val onlyDefaultCategory = categories.size == 1 && categories[0].isSystemCategory
val libraryCount by lazy { val libraryCount by lazy {
library.values library.values
@ -765,7 +764,7 @@ class LibraryScreenModel(
} }
fun getMangaCountForCategory(category: Category): Int? { fun getMangaCountForCategory(category: Category): Int? {
return if (showMangaCount) library[category]?.size else null return if (showMangaCount || !searchQuery.isNullOrEmpty()) library[category]?.size else null
} }
fun getToolbarTitle( fun getToolbarTitle(

View File

@ -170,8 +170,7 @@ object LibraryTab : Tab {
selection = state.selection, selection = state.selection,
contentPadding = contentPadding, contentPadding = contentPadding,
currentPage = { screenModel.activeCategory }, currentPage = { screenModel.activeCategory },
isLibraryEmpty = state.libraryCount == 0, showPageTabs = state.showCategoryTabs || !state.searchQuery.isNullOrEmpty(),
showPageTabs = state.showCategoryTabs,
onChangeCurrentPage = { screenModel.activeCategory = it }, onChangeCurrentPage = { screenModel.activeCategory = it },
onMangaClicked = { navigator.push(MangaScreen(it)) }, onMangaClicked = { navigator.push(MangaScreen(it)) },
onContinueReadingClicked = { it: LibraryManga -> onContinueReadingClicked = { it: LibraryManga ->