From 4e89ce8d1bb3aed8e18b268845dfc085edebee68 Mon Sep 17 00:00:00 2001 From: Sergei Tachenov Date: Mon, 20 Oct 2025 16:25:11 +0300 Subject: [PATCH] [python] IJPL-210924 Fix the Python Packages dark theme detection Now that UIThemeLookAndFeelInfo has the nice isDark property, we no longer need to hardcode exact themes here, except for the high contrast one. GitOrigin-RevId: 4d8f267d1b7d2c24a04093334a49ca6b5be32a9a --- .../toolwindow/details/PyPackagingJcefHtmlPanel.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/python/src/com/jetbrains/python/packaging/toolwindow/details/PyPackagingJcefHtmlPanel.kt b/python/src/com/jetbrains/python/packaging/toolwindow/details/PyPackagingJcefHtmlPanel.kt index 8bf2be1ff926..1839e0bfe745 100644 --- a/python/src/com/jetbrains/python/packaging/toolwindow/details/PyPackagingJcefHtmlPanel.kt +++ b/python/src/com/jetbrains/python/packaging/toolwindow/details/PyPackagingJcefHtmlPanel.kt @@ -19,11 +19,10 @@ class PyPackagingJcefHtmlPanel(project: Project) : JCEFHtmlPanel(uniqueUrl) { private val cssStyleCodeToInject: String get() { val styleKey = when (val laf = LafManager.getInstance().getCurrentUIThemeLookAndFeel()) { - is UIThemeLookAndFeelInfo -> when (laf.id) { - "ExperimentalDark" -> "python_packaging_toolwindow_dark.css" - "ExperimentalLight" -> "python_packaging_toolwindow_light.css" - "JetBrainsHighContrastTheme" -> "python_packaging_toolwindow_high_contrast.css" - else -> "python_packaging_toolwindow_default.css" + is UIThemeLookAndFeelInfo -> when { + laf.id == "JetBrainsHighContrastTheme" -> "python_packaging_toolwindow_high_contrast.css" + laf.isDark -> "python_packaging_toolwindow_dark.css" + else -> "python_packaging_toolwindow_light.css" } else -> "python_packaging_toolwindow_default.css" }