Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move Suggestions settings to same place #531

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import cafe.adriel.voyager.navigator.LocalNavigator
import cafe.adriel.voyager.navigator.currentOrThrow
import com.materialkolor.PaletteStyle
import eu.kanade.core.preference.asState
import eu.kanade.domain.source.service.SourcePreferences
import eu.kanade.domain.ui.UiPreferences
import eu.kanade.domain.ui.model.AppTheme
import eu.kanade.domain.ui.model.TabletUiMode
Expand Down Expand Up @@ -269,10 +268,6 @@ object SettingsAppearanceScreen : SearchableSettings {
@Composable
fun getForkGroup(uiPreferences: UiPreferences): Preference.PreferenceGroup {
val previewsRowCount by uiPreferences.previewsRowCount().collectAsState()
// KMK -->
val sourcePreferences = remember { Injekt.get<SourcePreferences>() }
val relatedMangasInOverflow by uiPreferences.expandRelatedMangas().collectAsState()
// KMK <--

return Preference.PreferenceGroup(
stringResource(SYMR.strings.pref_category_fork),
Expand All @@ -288,26 +283,6 @@ object SettingsAppearanceScreen : SearchableSettings {
pref = uiPreferences.expandFilters(),
title = stringResource(SYMR.strings.toggle_expand_search_filters),
),
// KMK -->
Preference.PreferenceItem.SwitchPreference(
pref = uiPreferences.expandRelatedMangas(),
title = stringResource(KMR.strings.pref_expand_related_mangas),
subtitle = stringResource(KMR.strings.pref_expand_related_mangas_summary),
enabled = sourcePreferences.relatedMangas().get(),
),
Preference.PreferenceItem.SwitchPreference(
pref = uiPreferences.relatedMangasInOverflow(),
enabled = !relatedMangasInOverflow,
title = stringResource(KMR.strings.put_related_mangas_in_overflow),
subtitle = stringResource(KMR.strings.put_related_mangas_in_overflow_summary),
),
Preference.PreferenceItem.SwitchPreference(
pref = uiPreferences.showHomeOnRelatedMangas(),
title = stringResource(KMR.strings.pref_show_home_on_related_mangas),
subtitle = stringResource(KMR.strings.pref_show_home_on_related_mangas_summary),
enabled = sourcePreferences.relatedMangas().get(),
),
// KMK <--
Preference.PreferenceItem.SwitchPreference(
pref = uiPreferences.recommendsInOverflow(),
title = stringResource(SYMR.strings.put_recommends_in_overflow),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ object SettingsBrowseScreen : SearchableSettings {
val uiPreferences = remember { Injekt.get<UiPreferences>() }
val unsortedPreferences = remember { Injekt.get<UnsortedPreferences>() }
// SY <--
// KMK -->
val relatedMangasInOverflow by uiPreferences.expandRelatedMangas().collectAsState()
// KMK <--
return listOf(
// SY -->
Preference.PreferenceGroup(
Expand All @@ -64,6 +67,24 @@ object SettingsBrowseScreen : SearchableSettings {
title = stringResource(KMR.strings.pref_source_related_mangas),
subtitle = stringResource(KMR.strings.pref_source_related_mangas_summary),
),
Preference.PreferenceItem.SwitchPreference(
pref = uiPreferences.expandRelatedMangas(),
title = stringResource(KMR.strings.pref_expand_related_mangas),
subtitle = stringResource(KMR.strings.pref_expand_related_mangas_summary),
enabled = sourcePreferences.relatedMangas().get(),
),
Preference.PreferenceItem.SwitchPreference(
pref = uiPreferences.relatedMangasInOverflow(),
enabled = !relatedMangasInOverflow,
title = stringResource(KMR.strings.put_related_mangas_in_overflow),
subtitle = stringResource(KMR.strings.put_related_mangas_in_overflow_summary),
),
Preference.PreferenceItem.SwitchPreference(
pref = uiPreferences.showHomeOnRelatedMangas(),
title = stringResource(KMR.strings.pref_show_home_on_related_mangas),
subtitle = stringResource(KMR.strings.pref_show_home_on_related_mangas_summary),
enabled = sourcePreferences.relatedMangas().get(),
),
// KMK <--
kotlin.run {
val count by sourcePreferences.sourcesTabCategories().collectAsState()
Expand Down
Loading