adjust some padding/spacing

This commit is contained in:
Helium314 2025-02-02 16:34:21 +01:00
parent 31b2a36bcc
commit 80172665c0
4 changed files with 40 additions and 45 deletions

View file

@ -78,26 +78,19 @@ fun Preference(
@DrawableRes icon: Int? = null,
value: @Composable (RowScope.() -> Unit)? = null,
) {
Column(
Row(
modifier = modifier
.fillMaxWidth()
.clickable { onClick() }
.heightIn(min = 48.dp)
.padding(16.dp),
verticalArrangement = Arrangement.spacedBy(
space = 0.dp,
alignment = Alignment.CenterVertically
)
) {
Row(
modifier = modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween,
.heightIn(min = 40.dp)
.padding(12.dp),
horizontalArrangement = Arrangement.spacedBy(12.dp),
verticalAlignment = Alignment.CenterVertically
) {
if (icon != null)
Icon(painterResource(icon), name, modifier = Modifier.size(48.dp).padding(end = 8.dp))
Icon(painterResource(icon), name, modifier = Modifier.size(36.dp))
Column(modifier = Modifier.weight(2 / 3f)) {
Text(text = name,)
Text(text = name)
if (description != null) {
CompositionLocalProvider(
LocalTextStyle provides MaterialTheme.typography.bodyMedium,
@ -105,11 +98,10 @@ fun Preference(
) {
Text(
text = description,
modifier = Modifier.padding(top = 8.dp)
modifier = Modifier.padding(top = 2.dp)
)
}
}
}
if (value != null) {
CompositionLocalProvider(
@ -130,7 +122,6 @@ fun Preference(
}
}
}
}
}
@Composable

View file

@ -68,7 +68,7 @@ fun <T: Any> ReorderDialog(
text = {
LazyColumn(
state = listState,
verticalArrangement = Arrangement.spacedBy(12.dp),
verticalArrangement = Arrangement.spacedBy(4.dp),
) {
items(reorderableItems, key = getKey) { item ->
ReorderableItem(

View file

@ -1,6 +1,7 @@
package helium314.keyboard.settings.dialogs
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.lazy.LazyColumn
@ -24,6 +25,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.DialogProperties
import androidx.core.content.edit
import helium314.keyboard.keyboard.internal.KeyboardIconsSet
@ -64,7 +66,9 @@ fun ToolbarKeysCustomizer(
},
title = { Text(stringResource(R.string.customize_toolbar_key_codes)) },
text = {
LazyColumn {
LazyColumn(
verticalArrangement = Arrangement.spacedBy(4.dp)
) {
items(ToolbarKey.entries) {
Row(
verticalAlignment = Alignment.CenterVertically,

View file

@ -62,7 +62,7 @@ fun createAboutPrefs(context: Context) = listOf(
name = it.title,
description = it.description,
onClick = { },
icon = R.drawable.ic_launcher_foreground
icon = R.drawable.ic_launcher_foreground // todo: maybe use the bitmap trick here?
)
},
PrefDef(context, NonSettingsPrefs.VERSION, R.string.version) {