mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-09 08:07:42 +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(
|
||||
items = appLayouts + customLayouts,
|
||||
selectedItem = currentSubtype.mainLayoutName() ?: SubtypeLocaleUtils.QWERTY,
|
||||
onSelected = {
|
||||
setCurrentSubtype(currentSubtype.withLayout(LayoutType.MAIN, it))
|
||||
onSelected = { layout ->
|
||||
// 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 = {
|
||||
IconButton({ showAddLayoutDialog = true })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue