Skip to content

Commit

Permalink
Update svgLoader usage for progress bars
Browse files Browse the repository at this point in the history
  • Loading branch information
fscarponi committed Sep 29, 2023
1 parent 429d396 commit cd17094
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ internal class JewelDemoToolWindow : ToolWindowFactory, DumbAware {

Row {
Text("Circular progress small: ")
CircularProgressIndicator()
CircularProgressIndicator(svgLoader)
}
Row(verticalAlignment = Alignment.CenterVertically) {
Text("Circular progress big: ")
CircularProgressIndicatorBig()
CircularProgressIndicatorBig(svgLoader)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fun main() {
@Composable
private fun ComponentShowcase(svgLoader: JewelSvgLoader, resourceLoader: ResourceLoader) {
val verticalScrollState = rememberScrollState()

val svgLoader by rememberSvgLoader()
Box(Modifier.fillMaxSize()) {
Column(
Modifier.width(IntrinsicSize.Max)
Expand All @@ -106,7 +106,7 @@ private fun ComponentShowcase(svgLoader: JewelSvgLoader, resourceLoader: Resourc
Links()
TextFields()
TextAreas()
ProgressBar()
ProgressBar(svgLoader)
ChipsAndTree()
Tabs(svgLoader, resourceLoader)
Icons(svgLoader, resourceLoader)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ import org.jetbrains.jewel.CircularProgressIndicatorBig
import org.jetbrains.jewel.GroupHeader
import org.jetbrains.jewel.HorizontalProgressBar
import org.jetbrains.jewel.IndeterminateHorizontalProgressBar
import org.jetbrains.jewel.SvgLoader
import org.jetbrains.jewel.Text

@Composable
fun ProgressBar() {
fun ProgressBar(svgLoader: SvgLoader) {
GroupHeader("Progress bars")
val transition = rememberInfiniteTransition()
val currentOffset by transition.animateFloat(
Expand Down Expand Up @@ -103,15 +104,15 @@ fun ProgressBar() {
verticalAlignment = Alignment.CenterVertically,
) {
Text("CircularProgress (16x16)")
CircularProgressIndicator()
CircularProgressIndicator(svgLoader)
}
Row(
Modifier.width(600.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp),
verticalAlignment = Alignment.CenterVertically,
) {
Text("CircularProgressBig (32x32) - Big")
CircularProgressIndicatorBig()
CircularProgressIndicatorBig(svgLoader)
}
}
}

0 comments on commit cd17094

Please sign in to comment.