mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-10 00:27:45 +00:00
don't create unnecessary additional subtypes when manually selecting qwerty
This commit is contained in:
parent
ed540466e9
commit
154f7c3a1e
1 changed files with 6 additions and 2 deletions
|
@ -393,8 +393,12 @@ private fun MainLayoutRow(
|
||||||
DropDownField(
|
DropDownField(
|
||||||
items = appLayouts + customLayouts,
|
items = appLayouts + customLayouts,
|
||||||
selectedItem = currentSubtype.mainLayoutName() ?: SubtypeLocaleUtils.QWERTY,
|
selectedItem = currentSubtype.mainLayoutName() ?: SubtypeLocaleUtils.QWERTY,
|
||||||
onSelected = {
|
onSelected = { layout ->
|
||||||
setCurrentSubtype(currentSubtype.withLayout(LayoutType.MAIN, it))
|
// if the locale defaults to qwerty, use it as implicit default to avoid creating unnecessary additional subtypes
|
||||||
|
if (layout == SubtypeLocaleUtils.QWERTY
|
||||||
|
&& SubtypeSettings.getResourceSubtypesForLocale(currentSubtype.locale).any { it.mainLayoutName() == null })
|
||||||
|
setCurrentSubtype(currentSubtype.withoutLayout(LayoutType.MAIN))
|
||||||
|
else setCurrentSubtype(currentSubtype.withLayout(LayoutType.MAIN, layout))
|
||||||
},
|
},
|
||||||
extraButton = {
|
extraButton = {
|
||||||
IconButton({ showAddLayoutDialog = true })
|
IconButton({ showAddLayoutDialog = true })
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue