diff --git a/app/src/main/java/com/dd3boh/outertune/ui/component/SelectHeader.kt b/app/src/main/java/com/dd3boh/outertune/ui/component/SelectHeader.kt index 111627808..51f0c5bc7 100644 --- a/app/src/main/java/com/dd3boh/outertune/ui/component/SelectHeader.kt +++ b/app/src/main/java/com/dd3boh/outertune/ui/component/SelectHeader.kt @@ -1,6 +1,8 @@ package com.dd3boh.outertune.ui.component +import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.RowScope +import androidx.compose.foundation.layout.padding import androidx.compose.material.icons.Icons import androidx.compose.material.icons.rounded.Close import androidx.compose.material.icons.rounded.Deselect @@ -11,7 +13,9 @@ import androidx.compose.material3.IconButton import androidx.compose.material3.LocalContentColor import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp import com.dd3boh.outertune.models.MediaMetadata import com.dd3boh.outertune.ui.menu.SelectionMediaMetadataMenu @@ -25,51 +29,56 @@ fun RowScope.SelectHeader( onDismiss: () -> Unit = {}, onRemoveFromHistory: (() -> Unit)? = null ) { - Text( - text = "${selectedItems.size}/${totalItemCount} selected", - modifier = Modifier.weight(1f) - ) + Row( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.padding(top = 2.dp, bottom = 3.dp) + ) { + Text( + text = "${selectedItems.size}/${totalItemCount} selected", + modifier = Modifier.weight(1f) + ) - // option menu - IconButton( - onClick = { - menuState.show { - SelectionMediaMetadataMenu( - selection = selectedItems, - onDismiss = menuState::dismiss, - clearAction = onDeselectAll, - onRemoveFromHistory = onRemoveFromHistory - ) + // option menu + IconButton( + onClick = { + menuState.show { + SelectionMediaMetadataMenu( + selection = selectedItems, + onDismiss = menuState::dismiss, + clearAction = onDeselectAll, + onRemoveFromHistory = onRemoveFromHistory + ) + } } + ) { + Icon( + Icons.Rounded.MoreVert, + contentDescription = null, + tint = LocalContentColor.current + ) } - ) { - Icon( - Icons.Rounded.MoreVert, - contentDescription = null, - tint = LocalContentColor.current - ) - } - // select/deselect all - val allSelected = selectedItems.size < totalItemCount + // select/deselect all + val allSelected = selectedItems.size < totalItemCount - IconButton( - onClick = if (allSelected) onSelectAll else onDeselectAll - ) { - Icon( - imageVector = if (allSelected) Icons.Rounded.SelectAll else Icons.Rounded.Deselect, - contentDescription = null, - tint = LocalContentColor.current - ) - } + IconButton( + onClick = if (allSelected) onSelectAll else onDeselectAll + ) { + Icon( + imageVector = if (allSelected) Icons.Rounded.SelectAll else Icons.Rounded.Deselect, + contentDescription = null, + tint = LocalContentColor.current + ) + } - // close selection mode - IconButton( - onClick = onDismiss, - ) { - Icon( - Icons.Rounded.Close, - contentDescription = null - ) + // close selection mode + IconButton( + onClick = onDismiss, + ) { + Icon( + Icons.Rounded.Close, + contentDescription = null + ) + } } } \ No newline at end of file