Skip to content

Commit

Permalink
add padding when the length of text is greater than 10 in chip
Browse files Browse the repository at this point in the history
  • Loading branch information
shengyou committed Sep 5, 2023
1 parent 86804a6 commit b7e0a42
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package org.jetbrains.jewel.samples.standalone.customs.ui

import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import org.jetbrains.jewel.Chip
import org.jetbrains.jewel.Text
import org.jetbrains.jewel.samples.standalone.customs.data.Platform
Expand All @@ -15,7 +18,12 @@ fun PlatformChips(supportedPlatforms: List<Platform>, modifier: Modifier = Modif
enabled = true,
onChipClick = {}
) {
Text(platform.name)
Text(
text = platform.name,
modifier = Modifier.padding(
horizontal = if (platform.name.length < 10) 6.dp else 12.dp
)
)
}
}
}
Expand Down

0 comments on commit b7e0a42

Please sign in to comment.