mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-11 18:02:03 +00:00
allow renaming main layouts in subtypeScreen
This commit is contained in:
parent
d79c84d7df
commit
8edea4f7c5
1 changed files with 4 additions and 3 deletions
|
@ -412,10 +412,11 @@ private fun MainLayoutRow(
|
|||
initialLayoutName = layoutName,
|
||||
startContent = startContent,
|
||||
locale = currentSubtype.locale,
|
||||
// only can edit name for new custom layout
|
||||
isNameValid = if (layoutName in customLayouts) null else ({ it !in customLayouts }),
|
||||
isNameValid = { it !in customLayouts },
|
||||
onEdited = {
|
||||
if (layoutName !in customLayouts)
|
||||
if (layoutName !in customLayouts // edited a built-in layout, set new one as current
|
||||
|| layoutName != it && layoutName == currentSubtype.mainLayoutName() // layout name for current subtype changed
|
||||
)
|
||||
setCurrentSubtype(currentSubtype.withLayout(LayoutType.MAIN, it))
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue