mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-19 05:39:10 +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,
|
initialLayoutName = layoutName,
|
||||||
startContent = startContent,
|
startContent = startContent,
|
||||||
locale = currentSubtype.locale,
|
locale = currentSubtype.locale,
|
||||||
// only can edit name for new custom layout
|
isNameValid = { it !in customLayouts },
|
||||||
isNameValid = if (layoutName in customLayouts) null else ({ it !in customLayouts }),
|
|
||||||
onEdited = {
|
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))
|
setCurrentSubtype(currentSubtype.withLayout(LayoutType.MAIN, it))
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue