Skip to content

Commit

Permalink
Change button icon and adjustments on display elements
Browse files Browse the repository at this point in the history
This commit replaces the 'more' button icon with a 'close' button icon in ComponentShowcaseTab.kt. It also removes the 'propagateMinConstraints' property from IconButton.kt. In addition, it adjusts IconButton to not necessarily need 'Modifier.size' in Buttons.kt. These changes are made to improve the UI's look and functionality.
  • Loading branch information
fscarponi committed Oct 12, 2023
1 parent 2779c33 commit 4d3cac9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion core/src/main/kotlin/org/jetbrains/jewel/IconButton.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ fun IconButton(
.clip(shape)
.padding(style.metrics.padding)
.background(backgroundColor),
propagateMinConstraints = true,
contentAlignment = Alignment.Center,
content = {
content(buttonState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private fun RowScope.ColumnOne(resourceLoader: ResourceLoader) {

val svgLoader = service<SwingBridgeService>().svgLoader
Row {
val painterProvider = retrieveStatelessIcon("actions/more.svg", svgLoader, IntUiTheme.iconData)
val painterProvider = retrieveStatelessIcon("actions/close.svg", svgLoader, IntUiTheme.iconData)
val painter by painterProvider.getPainter(resourceLoader)
Icon(painter = painter, modifier = Modifier.border(1.dp, Color.Magenta), contentDescription = "An icon")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package org.jetbrains.jewel.samples.standalone.components
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
Expand Down Expand Up @@ -44,7 +43,7 @@ fun Buttons(svgLoader: JewelSvgLoader, resourceLoader: ResourceLoader) {
Text("Default disabled")
}

IconButton(onClick = {}, modifier = Modifier.size(30.dp)) {
IconButton(onClick = {}) {
val iconProvider = remember { ResourcePainterProvider.stateless("icons/close.svg", svgLoader) }
val iconPainter by iconProvider.getPainter(resourceLoader)
Icon(
Expand Down

0 comments on commit 4d3cac9

Please sign in to comment.