Show toolbarTitle depending of size (#8633)

(cherry picked from commit fe6aa4358fccf369412bb898c0dcbe747dc4bac8)
This commit is contained in:
Dexroneum 2022-11-27 19:57:52 +00:00 committed by Jobobby04
parent d2182ed380
commit c71de8d1af

View File

@ -1352,14 +1352,10 @@ class LibraryScreenModel(
): LibraryToolbarTitle { ): LibraryToolbarTitle {
val category = categories.getOrNull(page) ?: return LibraryToolbarTitle(defaultTitle) val category = categories.getOrNull(page) ?: return LibraryToolbarTitle(defaultTitle)
val categoryName = category.let { val categoryName = category.let {
if (it.isSystemCategory) { if (it.isSystemCategory) defaultCategoryTitle else it.name
defaultCategoryTitle
} else {
it.name
}
} }
val title = if (showCategoryTabs) defaultTitle else categoryName val title = if (showCategoryTabs && categories.size <= 1) categoryName else defaultTitle
val count = when { val count = when {
!showMangaCount -> null !showMangaCount -> null
!showCategoryTabs -> getMangaCountForCategory(category) !showCategoryTabs -> getMangaCountForCategory(category)