From dbd93cf5d1f853988f408f5e45bb7a71e0d2f9ed Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 15 Oct 2022 12:05:52 -0400 Subject: [PATCH] Tweak source view type menu radio icon to match stable --- .../browse/components/BrowseSourceToolbar.kt | 23 +++++++++++-------- .../presentation/components/DropdownMenu.kt | 6 +++-- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceToolbar.kt b/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceToolbar.kt index f7489c88d..efbd4e79f 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceToolbar.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceToolbar.kt @@ -24,7 +24,7 @@ import eu.kanade.presentation.browse.BrowseSourceState import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBarActions import eu.kanade.presentation.components.DropdownMenu -import eu.kanade.presentation.components.RadioButton +import eu.kanade.presentation.components.RadioMenuItem import eu.kanade.presentation.components.SearchToolbar import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.CatalogueSource @@ -119,21 +119,24 @@ fun BrowseSourceRegularToolbar( expanded = selectingDisplayMode, onDismissRequest = { selectingDisplayMode = false }, ) { - RadioButton( + RadioMenuItem( text = { Text(text = stringResource(R.string.action_display_comfortable_grid)) }, - onClick = { onDisplayModeChange(LibraryDisplayMode.ComfortableGrid) }, isChecked = displayMode == LibraryDisplayMode.ComfortableGrid, - ) - RadioButton( + ) { + onDisplayModeChange(LibraryDisplayMode.ComfortableGrid) + } + RadioMenuItem( text = { Text(text = stringResource(R.string.action_display_grid)) }, - onClick = { onDisplayModeChange(LibraryDisplayMode.CompactGrid) }, isChecked = displayMode == LibraryDisplayMode.CompactGrid, - ) - RadioButton( + ) { + onDisplayModeChange(LibraryDisplayMode.CompactGrid) + } + RadioMenuItem( text = { Text(text = stringResource(R.string.action_display_list)) }, - onClick = { onDisplayModeChange(LibraryDisplayMode.List) }, isChecked = displayMode == LibraryDisplayMode.List, - ) + ) { + onDisplayModeChange(LibraryDisplayMode.List) + } } }, scrollBehavior = scrollBehavior, diff --git a/app/src/main/java/eu/kanade/presentation/components/DropdownMenu.kt b/app/src/main/java/eu/kanade/presentation/components/DropdownMenu.kt index de2ef3b0d..988dd79fc 100644 --- a/app/src/main/java/eu/kanade/presentation/components/DropdownMenu.kt +++ b/app/src/main/java/eu/kanade/presentation/components/DropdownMenu.kt @@ -7,6 +7,7 @@ import androidx.compose.material.icons.outlined.RadioButtonChecked import androidx.compose.material.icons.outlined.RadioButtonUnchecked import androidx.compose.material3.DropdownMenuItem import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.unit.DpOffset @@ -33,10 +34,10 @@ fun DropdownMenu( } @Composable -fun RadioButton( +fun RadioMenuItem( text: @Composable () -> Unit, - onClick: () -> Unit, isChecked: Boolean, + onClick: () -> Unit, ) { DropdownMenuItem( text = text, @@ -46,6 +47,7 @@ fun RadioButton( Icon( imageVector = Icons.Outlined.RadioButtonChecked, contentDescription = "", + tint = MaterialTheme.colorScheme.primary, ) } else { Icon(