Update AltPages to List<Row> instead of Keyboard

This commit is contained in:
Aleksandras Kostarevas 2024-08-24 15:02:37 +03:00
parent 2e883781d5
commit 942fe63d96
3 changed files with 5 additions and 13 deletions

View File

@ -85,11 +85,7 @@ rows:
- "$delete"
altPages:
- name: International Phonetic Alphabet
minimumFunctionalKeyWidth: 0.0
attributes: *attrs
rows:
- letters:
- - letters:
- "i"
- "y"
- "$gap"
@ -158,11 +154,7 @@ altPages:
- "ɑ"
- "ɒ"
- "$delete"
- name: International Phonetic Alphabet
minimumFunctionalKeyWidth: 0.0
attributes: *attrs
rows:
- letters:
- - letters:
- "ɓ̥"
- "ɓ"
- "ɗ̥"

View File

@ -149,9 +149,7 @@ data class Keyboard(
val minimumFunctionalKeyWidth: Float = 0.125f,
val minimumBottomRowFunctionalKeyWidth: Float = 0.15f,
// TODO: These should probably be lists of List<Row> or similar,
// it doesn't make sense to declare name and description repeatedly
val altPages: List<Keyboard> = listOf()
val altPages: List<List<Row>> = listOf()
) {
var id: String = ""

View File

@ -169,6 +169,8 @@ class KeyboardLayoutSetV2 internal constructor(
val baseElement = element.copy(page = KeyboardLayoutPage.Base)
val baseLayout = elements[baseElement]
baseLayout?.altPages?.get(altIdx)
}?.let {
mainLayout.copy(definedRows = it)
}
} ?: run {
// If all else fails, show the error layout