Skip to content

Commit

Permalink
Update strings and adjust UI layout
Browse files Browse the repository at this point in the history
Changes include the alteration of 'Kotlin Platform' to 'Kotlin Platforms' in packageSearchBundle.properties, and increased padding in the HeaderAttributesTab.kt element for improved readability. These modifications enhance the user-friendly display and arrangement of components.

(cherry picked from commit 90cb41d)
  • Loading branch information
lamba92 authored and Lamberto Basti committed Jan 25, 2024
1 parent 302780c commit 86a5e8a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ internal fun AttributeBadge(text: String, onClick: () -> Unit) {

@Composable
internal fun FlowRow(
xSpacing: Dp = 0.dp,
ySpacing: Dp = 0.dp,
horizontalPadding: Dp = 0.dp,
verticalPadding: Dp = 0.dp,
content: @Composable () -> Unit,
) {
Layout(
Expand All @@ -213,20 +213,20 @@ internal fun FlowRow(
currentWidth = 0
}
currentRow.add(placeable)
currentWidth += placeable.width + xSpacing.roundToPx()
currentWidth += placeable.width + horizontalPadding.roundToPx()
}
rows.add(currentRow)

val height = rows.sumOf { it.maxOf { it.height } + ySpacing.roundToPx() } - ySpacing.roundToPx()
val height = rows.sumOf { it.maxOf { it.height } + verticalPadding.roundToPx() } - verticalPadding.roundToPx()
layout(constraints.maxWidth, height) {
var yPosition = 0
rows.forEach { row ->
var xPosition = 0
row.forEach { placeable ->
placeable.placeRelative(xPosition, yPosition)
xPosition += placeable.width + xSpacing.roundToPx()
xPosition += placeable.width + horizontalPadding.roundToPx()
}
yPosition += row.maxOf { it.height } + ySpacing.roundToPx()
yPosition += row.maxOf { it.height } + verticalPadding.roundToPx()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private fun HeaderAttributesTabImpl(
)
}

FlowRow(xSpacing = 4.dp) {
FlowRow(horizontalPadding = 4.dp, verticalPadding = 4.dp) {
attributes.forEachIndexed { index, attribute ->
AttributeBadge(text = attribute.value) {
scope.scrollToAttribute(scrollState, attributeGlobalPositionMap, index)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,6 @@ packagesearch.toolwindow.loading.dumbMode=Project is initializing...
packagesearch.ui.tree.tooltips.expand=Expand all
packagesearch.ui.tree.tooltips.collapse=Collapse all
packagesearch.ui.toolwindow.sidepanel.platformsList=Platforms:
packagesearch.ui.toolwindow.sidepanel.platforms=Kotlin Platform
packagesearch.ui.toolwindow.sidepanel.platforms=Kotlin Platforms
packagesearch.ui.toolwindow.sidepanel.searchResultSupport=Search results that support:
packagesearch.ui.toolwindow.sidepanel.searchResultSupport.sourceSets=Source Sets:

0 comments on commit 86a5e8a

Please sign in to comment.