mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Fix bug with wide screens in languages menu
This commit is contained in:
parent
c9dc656fbf
commit
484a55f7f0
@ -2,6 +2,7 @@ package org.futo.inputmethod.latin.uix.settings.pages
|
|||||||
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
@ -198,6 +199,7 @@ fun LanguageSurface(
|
|||||||
onLayoutAdditionRequested: () -> Unit,
|
onLayoutAdditionRequested: () -> Unit,
|
||||||
onLanguageRemoved: () -> Unit
|
onLanguageRemoved: () -> Unit
|
||||||
) {
|
) {
|
||||||
|
Box(modifier = Modifier.fillMaxWidth(), contentAlignment = Alignment.Center) {
|
||||||
Column(
|
Column(
|
||||||
modifier
|
modifier
|
||||||
.padding(start = 32.dp, end = 32.dp)
|
.padding(start = 32.dp, end = 32.dp)
|
||||||
@ -209,17 +211,30 @@ fun LanguageSurface(
|
|||||||
.padding(top = 14.dp, bottom = 12.dp)
|
.padding(top = 14.dp, bottom = 12.dp)
|
||||||
) {
|
) {
|
||||||
CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.onSurfaceVariant) {
|
CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.onSurfaceVariant) {
|
||||||
Text(item.languageName, modifier = Modifier.padding(start = 16.dp, end = 16.dp), style = TextHeadingMediumMlStyle)
|
Text(
|
||||||
|
item.languageName,
|
||||||
|
modifier = Modifier.padding(start = 16.dp, end = 16.dp),
|
||||||
|
style = TextHeadingMediumMlStyle
|
||||||
|
)
|
||||||
|
|
||||||
if(item.options.dictionary == null) {
|
if (item.options.dictionary == null) {
|
||||||
Tip("This language has no built-in dictionary. We recommend downloading and importing one to get autocorrect and word suggestions.")
|
Tip("This language has no built-in dictionary. We recommend downloading and importing one to get autocorrect and word suggestions.")
|
||||||
} else {
|
} else {
|
||||||
Spacer(modifier = Modifier.height(32.dp))
|
Spacer(modifier = Modifier.height(32.dp))
|
||||||
}
|
}
|
||||||
|
|
||||||
LanguageConfigurable(kind = FileKind.VoiceInput, selection = item.options.voiceInputModel ?: "(None)") { onConfigurableSelected(FileKind.VoiceInput) }
|
LanguageConfigurable(
|
||||||
LanguageConfigurable(kind = FileKind.Dictionary, selection = item.options.dictionary ?: "(None)") { onConfigurableSelected(FileKind.Dictionary) }
|
kind = FileKind.VoiceInput,
|
||||||
LanguageConfigurable(kind = FileKind.Transformer, selection = item.options.transformerModel ?: "(None)") { onConfigurableSelected(FileKind.Transformer) }
|
selection = item.options.voiceInputModel ?: "(None)"
|
||||||
|
) { onConfigurableSelected(FileKind.VoiceInput) }
|
||||||
|
LanguageConfigurable(
|
||||||
|
kind = FileKind.Dictionary,
|
||||||
|
selection = item.options.dictionary ?: "(None)"
|
||||||
|
) { onConfigurableSelected(FileKind.Dictionary) }
|
||||||
|
LanguageConfigurable(
|
||||||
|
kind = FileKind.Transformer,
|
||||||
|
selection = item.options.transformerModel ?: "(None)"
|
||||||
|
) { onConfigurableSelected(FileKind.Transformer) }
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(24.dp))
|
Spacer(modifier = Modifier.height(24.dp))
|
||||||
|
|
||||||
@ -234,7 +249,12 @@ fun LanguageSurface(
|
|||||||
Spacer(modifier = Modifier.height(9.dp))
|
Spacer(modifier = Modifier.height(9.dp))
|
||||||
|
|
||||||
item.layouts.forEach {
|
item.layouts.forEach {
|
||||||
LayoutConfigurable(name = it, active = true, onDelete = { onLayoutRemoved(it) }, canDelete = item.layouts.size > 1)
|
LayoutConfigurable(
|
||||||
|
name = it,
|
||||||
|
active = true,
|
||||||
|
onDelete = { onLayoutRemoved(it) },
|
||||||
|
canDelete = item.layouts.size > 1
|
||||||
|
)
|
||||||
Spacer(modifier = Modifier.height(4.dp))
|
Spacer(modifier = Modifier.height(4.dp))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -257,6 +277,7 @@ fun LanguageSurface(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Preview
|
@Preview
|
||||||
|
Loading…
x
Reference in New Issue
Block a user