Add option to use placeholder icon as custom icon
This commit is contained in:
parent
0552f18001
commit
ac028946ee
@ -94,6 +94,7 @@ sealed class CustomIcon : CustomAttribute {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
"force_themed_icon" -> ForceThemedIcon
|
"force_themed_icon" -> ForceThemedIcon
|
||||||
|
"default_placeholder_icon" -> DefaultPlaceholderIcon
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -172,3 +173,14 @@ object UnmodifiedSystemDefaultIcon: CustomIcon() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use the default placeholder icon
|
||||||
|
*/
|
||||||
|
object DefaultPlaceholderIcon: CustomIcon() {
|
||||||
|
override fun toDatabaseValue(): String {
|
||||||
|
return jsonObjectOf(
|
||||||
|
"type" to "default_placeholder_icon"
|
||||||
|
).toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -150,6 +150,9 @@ class IconRepository(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (customIcon is DefaultPlaceholderIcon) {
|
||||||
|
return placeholderProvider?.let { listOf(it) } ?: emptyList()
|
||||||
|
}
|
||||||
return emptyList()
|
return emptyList()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,6 +266,8 @@ class IconRepository(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
providerOptions.add(DefaultPlaceholderIcon)
|
||||||
|
|
||||||
suggestions.addAll(
|
suggestions.addAll(
|
||||||
transformationOptions.map {
|
transformationOptions.map {
|
||||||
val transformations = getTransformations(it) ?: defaultTransformations
|
val transformations = getTransformations(it) ?: defaultTransformations
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user