mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-14 21:18:56 +01:00
BrowseSourceToolbar: Match display mode dropdown to stable and change toolbar icon based on display mode (#8200)
* BrowseSourceToolbar: Match display mode dropdown to stable and change toolbar icon based on display mode * Review changes * Review changes 2
This commit is contained in:
@@ -2,6 +2,11 @@ package eu.kanade.presentation.components
|
||||
|
||||
import androidx.compose.foundation.layout.ColumnScope
|
||||
import androidx.compose.foundation.layout.sizeIn
|
||||
import androidx.compose.material.icons.Icons
|
||||
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.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.DpOffset
|
||||
@@ -26,3 +31,28 @@ fun DropdownMenu(
|
||||
content = content,
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun RadioButton(
|
||||
text: @Composable () -> Unit,
|
||||
onClick: () -> Unit,
|
||||
isChecked: Boolean,
|
||||
) {
|
||||
DropdownMenuItem(
|
||||
text = text,
|
||||
onClick = onClick,
|
||||
trailingIcon = {
|
||||
if (isChecked) {
|
||||
Icon(
|
||||
imageVector = Icons.Outlined.RadioButtonChecked,
|
||||
contentDescription = "",
|
||||
)
|
||||
} else {
|
||||
Icon(
|
||||
imageVector = Icons.Outlined.RadioButtonUnchecked,
|
||||
contentDescription = "",
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user