Allow preferences to multi-line (#5905)

This commit is contained in:
Soitora 2021-09-14 00:39:14 +02:00 committed by GitHub
parent a2cf210a52
commit 971d8a7e40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,6 +94,7 @@ fun initDialog(dialogPreference: DialogPreference) {
inline fun <P : Preference> PreferenceGroup.add(p: P): P { inline fun <P : Preference> PreferenceGroup.add(p: P): P {
return p.apply { return p.apply {
this.isIconSpaceReserved = false this.isIconSpaceReserved = false
this.isSingleLineTitle = false
addPreference(this) addPreference(this)
} }
} }
@ -102,6 +103,7 @@ inline fun <P : Preference> PreferenceGroup.initThenAdd(p: P, block: P.() -> Uni
return p.apply { return p.apply {
block() block()
this.isIconSpaceReserved = false this.isIconSpaceReserved = false
this.isSingleLineTitle = false
addPreference(this) addPreference(this)
} }
} }
@ -109,6 +111,7 @@ inline fun <P : Preference> PreferenceGroup.initThenAdd(p: P, block: P.() -> Uni
inline fun <P : Preference> PreferenceGroup.addThenInit(p: P, block: P.() -> Unit): P { inline fun <P : Preference> PreferenceGroup.addThenInit(p: P, block: P.() -> Unit): P {
return p.apply { return p.apply {
this.isIconSpaceReserved = false this.isIconSpaceReserved = false
this.isSingleLineTitle = false
addPreference(this) addPreference(this)
block() block()
} }