From fef62a98e5e70b6b91f58baa26eacd7d7c1c6bfa Mon Sep 17 00:00:00 2001 From: caixuan Date: Sat, 17 Feb 2024 19:47:20 +0800 Subject: [PATCH] Make hints happy --- .../org/jetbrains/jewel/bridge/BridgePainterHintsProvider.kt | 2 +- .../jewel/intui/standalone/StandalonePainterHintsProvider.kt | 2 +- .../org/jetbrains/jewel/ui/painter/ResourcePainterProvider.kt | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/BridgePainterHintsProvider.kt b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/BridgePainterHintsProvider.kt index 9c2f2a750..47782dd82 100644 --- a/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/BridgePainterHintsProvider.kt +++ b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/BridgePainterHintsProvider.kt @@ -8,13 +8,13 @@ import com.intellij.ui.NewUI import org.jetbrains.jewel.bridge.theme.isNewUiTheme import org.jetbrains.jewel.foundation.InternalJewelApi import org.jetbrains.jewel.foundation.theme.JewelTheme +import org.jetbrains.jewel.foundation.util.inDebugMode import org.jetbrains.jewel.ui.painter.PainterHint import org.jetbrains.jewel.ui.painter.PalettePainterHintsProvider import org.jetbrains.jewel.ui.painter.hints.ColorBasedPaletteReplacement import org.jetbrains.jewel.ui.painter.hints.Dark import org.jetbrains.jewel.ui.painter.hints.HiDpi import org.jetbrains.jewel.ui.painter.hints.KeyBasedPaletteReplacement -import org.jetbrains.jewel.foundation.util.inDebugMode import org.jetbrains.jewel.ui.util.toRgbaHexString /** diff --git a/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/StandalonePainterHintsProvider.kt b/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/StandalonePainterHintsProvider.kt index 6c6204d58..4ad55ca5a 100644 --- a/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/StandalonePainterHintsProvider.kt +++ b/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/StandalonePainterHintsProvider.kt @@ -4,6 +4,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.Color import org.jetbrains.jewel.foundation.theme.JewelTheme import org.jetbrains.jewel.foundation.theme.ThemeDefinition +import org.jetbrains.jewel.foundation.util.inDebugMode import org.jetbrains.jewel.ui.painter.PainterHint import org.jetbrains.jewel.ui.painter.PalettePainterHintsProvider import org.jetbrains.jewel.ui.painter.hints.ColorBasedPaletteReplacement @@ -11,7 +12,6 @@ import org.jetbrains.jewel.ui.painter.hints.Dark import org.jetbrains.jewel.ui.painter.hints.HiDpi import org.jetbrains.jewel.ui.painter.hints.KeyBasedPaletteReplacement import org.jetbrains.jewel.ui.painter.hints.PathOverride -import org.jetbrains.jewel.foundation.util.inDebugMode /** Provides the default [PainterHint]s to use to load images. */ public class StandalonePainterHintsProvider( diff --git a/ui/src/main/kotlin/org/jetbrains/jewel/ui/painter/ResourcePainterProvider.kt b/ui/src/main/kotlin/org/jetbrains/jewel/ui/painter/ResourcePainterProvider.kt index 77a427985..0c4a5c535 100644 --- a/ui/src/main/kotlin/org/jetbrains/jewel/ui/painter/ResourcePainterProvider.kt +++ b/ui/src/main/kotlin/org/jetbrains/jewel/ui/painter/ResourcePainterProvider.kt @@ -126,7 +126,7 @@ public class ResourcePainterProvider( when (extension) { "svg" -> createSvgPainter(chosenScope, url) "xml" -> createVectorDrawablePainter(chosenScope, url) - else -> createBitmapPainter(chosenScope, url) + else -> createBitmapPainter(url) } for (hint in scope.acceptedHints) { @@ -210,7 +210,6 @@ public class ResourcePainterProvider( @Composable private fun createBitmapPainter( - scope: Scope, url: URL, ) = tryLoadingResource( url = url,