[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
This commit is contained in:
Sergei Tachenov
2025-10-20 19:15:07 +00:00
committed by intellij-monorepo-bot
parent d7a6272365
commit 4e89ce8d1b
@@ -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"
}