From cafd9e5811ddf57419a9147dc48928e6549334f1 Mon Sep 17 00:00:00 2001 From: Fabrizio Scarponi <36624359+fscarponi@users.noreply.github.com> Date: Fri, 1 Dec 2023 12:00:33 +0000 Subject: [PATCH] Fix scrollbar color when have 0f alpha (#262) * Fix Scrollbar color value handling in IntUiBridge.kt * Fix #259 Scrollbar color resolution from LAF in corner case --- .../main/kotlin/org/jetbrains/jewel/bridge/theme/IntUiBridge.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/theme/IntUiBridge.kt b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/theme/IntUiBridge.kt index bf7bc407b..fd192a014 100644 --- a/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/theme/IntUiBridge.kt +++ b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/theme/IntUiBridge.kt @@ -611,9 +611,11 @@ private fun readScrollbarStyle(isDark: Boolean) = colors = ScrollbarColors( // See ScrollBarPainter.THUMB_OPAQUE_BACKGROUND thumbBackground = retrieveColorOrUnspecified("ScrollBar.Mac.Transparent.thumbColor") + .let { if (it.alpha == 0f) Color.Unspecified else it } // See https://github.com/JetBrains/jewel/issues/259 .takeOrElse { if (isDark) Color(0x59808080) else Color(0x33000000) }, // See ScrollBarPainter.THUMB_OPAQUE_HOVERED_BACKGROUND thumbBackgroundHovered = retrieveColorOrUnspecified("ScrollBar.Mac.Transparent.hoverThumbColor") + .let { if (it.alpha == 0f) Color.Unspecified else it } // See https://github.com/JetBrains/jewel/issues/259 .takeOrElse { if (isDark) Color(0x8C808080) else Color(0x80000000) }, ), metrics = ScrollbarMetrics(