mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-09 18:48:55 +01:00
Clean up preference extensions/items a bit
This commit is contained in:
@@ -16,7 +16,6 @@ import androidx.compose.ui.platform.LocalConfiguration
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import eu.kanade.presentation.components.TabbedDialog
|
||||
import eu.kanade.presentation.components.TabbedDialogPaddings
|
||||
import eu.kanade.presentation.util.collectAsState
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.ui.library.LibrarySettingsScreenModel
|
||||
import tachiyomi.core.preference.TriState
|
||||
@@ -31,6 +30,7 @@ import tachiyomi.presentation.core.components.SettingsChipRow
|
||||
import tachiyomi.presentation.core.components.SliderItem
|
||||
import tachiyomi.presentation.core.components.SortItem
|
||||
import tachiyomi.presentation.core.components.TriStateItem
|
||||
import tachiyomi.presentation.core.util.collectAsState
|
||||
|
||||
@Composable
|
||||
fun LibrarySettingsDialog(
|
||||
@@ -211,59 +211,35 @@ private fun ColumnScope.DisplayPage(
|
||||
} else {
|
||||
stringResource(R.string.label_default)
|
||||
},
|
||||
onChange = { columnPreference.set(it) },
|
||||
onChange = columnPreference::set,
|
||||
)
|
||||
}
|
||||
|
||||
HeadingItem(R.string.overlay_header)
|
||||
val downloadBadge by screenModel.libraryPreferences.downloadBadge().collectAsState()
|
||||
CheckboxItem(
|
||||
label = stringResource(R.string.action_display_download_badge),
|
||||
checked = downloadBadge,
|
||||
onClick = {
|
||||
screenModel.togglePreference(LibraryPreferences::downloadBadge)
|
||||
},
|
||||
pref = screenModel.libraryPreferences.downloadBadge(),
|
||||
)
|
||||
val localBadge by screenModel.libraryPreferences.localBadge().collectAsState()
|
||||
CheckboxItem(
|
||||
label = stringResource(R.string.action_display_local_badge),
|
||||
checked = localBadge,
|
||||
onClick = {
|
||||
screenModel.togglePreference(LibraryPreferences::localBadge)
|
||||
},
|
||||
pref = screenModel.libraryPreferences.localBadge(),
|
||||
)
|
||||
val languageBadge by screenModel.libraryPreferences.languageBadge().collectAsState()
|
||||
CheckboxItem(
|
||||
label = stringResource(R.string.action_display_language_badge),
|
||||
checked = languageBadge,
|
||||
onClick = {
|
||||
screenModel.togglePreference(LibraryPreferences::languageBadge)
|
||||
},
|
||||
pref = screenModel.libraryPreferences.languageBadge(),
|
||||
)
|
||||
val showContinueReadingButton by screenModel.libraryPreferences.showContinueReadingButton().collectAsState()
|
||||
CheckboxItem(
|
||||
label = stringResource(R.string.action_display_show_continue_reading_button),
|
||||
checked = showContinueReadingButton,
|
||||
onClick = {
|
||||
screenModel.togglePreference(LibraryPreferences::showContinueReadingButton)
|
||||
},
|
||||
pref = screenModel.libraryPreferences.showContinueReadingButton(),
|
||||
)
|
||||
|
||||
HeadingItem(R.string.tabs_header)
|
||||
val categoryTabs by screenModel.libraryPreferences.categoryTabs().collectAsState()
|
||||
CheckboxItem(
|
||||
label = stringResource(R.string.action_display_show_tabs),
|
||||
checked = categoryTabs,
|
||||
onClick = {
|
||||
screenModel.togglePreference(LibraryPreferences::categoryTabs)
|
||||
},
|
||||
pref = screenModel.libraryPreferences.categoryTabs(),
|
||||
)
|
||||
val categoryNumberOfItems by screenModel.libraryPreferences.categoryNumberOfItems().collectAsState()
|
||||
CheckboxItem(
|
||||
label = stringResource(R.string.action_display_show_number_of_items),
|
||||
checked = categoryNumberOfItems,
|
||||
onClick = {
|
||||
screenModel.togglePreference(LibraryPreferences::categoryNumberOfItems)
|
||||
},
|
||||
pref = screenModel.libraryPreferences.categoryNumberOfItems(),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user