From 0596355a2e324f231f919602789ce16065d7566d Mon Sep 17 00:00:00 2001 From: "Andrey.Matveev" Date: Thu, 16 Jan 2025 12:09:32 +0200 Subject: [PATCH] PY-78524 Fix problem with codeCellBackgroundColor undefined because of plugin from master GitOrigin-RevId: c69fc1ec54eb253ceb40bbb9e91851662e84fdce --- .../ui/visualization/NotebookEditorAppearance.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/notebooks/notebook-ui/src/com/intellij/notebooks/ui/visualization/NotebookEditorAppearance.kt b/notebooks/notebook-ui/src/com/intellij/notebooks/ui/visualization/NotebookEditorAppearance.kt index 0ff281242134..e528aa3e5c32 100644 --- a/notebooks/notebook-ui/src/com/intellij/notebooks/ui/visualization/NotebookEditorAppearance.kt +++ b/notebooks/notebook-ui/src/com/intellij/notebooks/ui/visualization/NotebookEditorAppearance.kt @@ -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 + get() { + return object : ObservableProperty { + 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