PY-78524 Fix problem with codeCellBackgroundColor undefined because of plugin from master

GitOrigin-RevId: c69fc1ec54eb253ceb40bbb9e91851662e84fdce
This commit is contained in:
Andrey.Matveev
2025-01-16 12:09:32 +02:00
committed by intellij-monorepo-bot
parent c88308938b
commit 0596355a2e

View File

@@ -3,8 +3,10 @@ package com.intellij.notebooks.ui.visualization
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.editor.colors.ColorKey
import com.intellij.openapi.editor.colors.EditorColorsManager
import com.intellij.openapi.editor.colors.EditorColorsScheme
import com.intellij.openapi.editor.impl.EditorImpl
import com.intellij.openapi.observable.properties.ObservableProperty
import com.intellij.openapi.util.Key
import com.intellij.ui.JBColor
import com.intellij.ui.NewUiValue
@@ -72,6 +74,16 @@ interface NotebookEditorAppearanceSizes {
interface NotebookEditorAppearanceColors {
// TODO Sort everything lexicographically.
// it is a temporary hack to avoid PY-78524 (will be removed in future)
val codeCellBackgroundColor: ObservableProperty<Color>
get() {
return object : ObservableProperty<Color> {
override fun get(): Color {
return getCodeCellBackground(EditorColorsManager.getInstance().globalScheme) ?: JBColor.BLACK
}
}
}
fun getCodeCellBackground(scheme: EditorColorsScheme): Color? = scheme.defaultBackground
fun getGutterInputExecutionCountForegroundColor(scheme: EditorColorsScheme): Color? = null
fun getGutterOutputExecutionCountForegroundColor(scheme: EditorColorsScheme): Color? = null