From 05f7030d1c9605fb83091b7f569c2eb0c590d057 Mon Sep 17 00:00:00 2001 From: Gijs van Veen Date: Wed, 29 May 2024 23:33:06 +0200 Subject: [PATCH] Fixed small example issue --- .../kaluga/example/shared/stylable/ButtonStyles.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/example/shared/src/commonMain/kotlin/com/splendo/kaluga/example/shared/stylable/ButtonStyles.kt b/example/shared/src/commonMain/kotlin/com/splendo/kaluga/example/shared/stylable/ButtonStyles.kt index 76a321b1d..70e6ea316 100644 --- a/example/shared/src/commonMain/kotlin/com/splendo/kaluga/example/shared/stylable/ButtonStyles.kt +++ b/example/shared/src/commonMain/kotlin/com/splendo/kaluga/example/shared/stylable/ButtonStyles.kt @@ -312,7 +312,15 @@ object ButtonStyles { imageSize = ImageSize.Sized(24.0f, 24.0f) spacing = 8.0f imageGravity = gravity - setTextStyle(KalugaTextStyle(defaultBoldFont, DefaultColors.white, 12.0f, KalugaTextAlignment.LEFT), DefaultColors.azure, DefaultColors.black) + val textAlignment = when (gravity) { + ImageGravity.LEFT -> KalugaTextAlignment.LEFT + ImageGravity.START -> KalugaTextAlignment.START + ImageGravity.RIGHT -> KalugaTextAlignment.RIGHT + ImageGravity.END -> KalugaTextAlignment.END + ImageGravity.BOTTOM -> KalugaTextAlignment.CENTER + ImageGravity.TOP -> KalugaTextAlignment.CENTER + } + setTextStyle(KalugaTextStyle(defaultBoldFont, DefaultColors.white, 12.0f, textAlignment), DefaultColors.azure, DefaultColors.black) setImage("star".asImage()!!, DefaultColors.gold, DefaultColors.goldenrod, DefaultColors.white) setBackground(DefaultColors.lightGray, DefaultColors.gray, DefaultColors.dimGray) }