From e3ecc3ce3619e04c48bba5e63c44ba88d1dd56d0 Mon Sep 17 00:00:00 2001 From: Igor Slobodskov Date: Wed, 23 Apr 2025 11:57:11 +0200 Subject: [PATCH] [R] decouple R from visualization module Use RNotebookAppearance instead of abstract notebook appearance GitOrigin-RevId: 0d6364c8bbb646c1c325b06e8666ae956222bc8f --- .../ui/visualization/NotebookUtil.kt | 20 ------------------- ...ookTextCellBackgroundLineMarkerRenderer.kt | 18 ----------------- 2 files changed, 38 deletions(-) delete mode 100644 notebooks/notebook-ui/src/com/intellij/notebooks/ui/visualization/markerRenderers/NotebookTextCellBackgroundLineMarkerRenderer.kt diff --git a/notebooks/notebook-ui/src/com/intellij/notebooks/ui/visualization/NotebookUtil.kt b/notebooks/notebook-ui/src/com/intellij/notebooks/ui/visualization/NotebookUtil.kt index 68d6e4737967..c41463fa30c0 100644 --- a/notebooks/notebook-ui/src/com/intellij/notebooks/ui/visualization/NotebookUtil.kt +++ b/notebooks/notebook-ui/src/com/intellij/notebooks/ui/visualization/NotebookUtil.kt @@ -4,7 +4,6 @@ package com.intellij.notebooks.ui.visualization import com.intellij.notebooks.ui.visualization.NotebookEditorAppearance.Companion.NOTEBOOK_APPEARANCE_KEY import com.intellij.openapi.editor.Editor import com.intellij.openapi.editor.EditorKind -import com.intellij.openapi.editor.colors.EditorColors import com.intellij.openapi.editor.impl.EditorImpl import java.awt.Graphics import java.awt.Rectangle @@ -41,23 +40,4 @@ object NotebookUtil { actionBetweenBackgroundAndStripe() } - - fun paintCaretRow(editor: EditorImpl, g: Graphics, lines: IntRange) { - if (editor.settings.isCaretRowShown) { - val caretModel = editor.caretModel - val caretLine = caretModel.logicalPosition.line - if (caretLine in lines) { - g.color = editor.colorsScheme.getColor(EditorColors.CARET_ROW_COLOR) - g.fillRect( - 0, - editor.visualLineToY(caretModel.visualPosition.line), - g.clipBounds.width, - editor.lineHeight - ) - } - } - } } - - - diff --git a/notebooks/notebook-ui/src/com/intellij/notebooks/ui/visualization/markerRenderers/NotebookTextCellBackgroundLineMarkerRenderer.kt b/notebooks/notebook-ui/src/com/intellij/notebooks/ui/visualization/markerRenderers/NotebookTextCellBackgroundLineMarkerRenderer.kt deleted file mode 100644 index ea729ba2d73b..000000000000 --- a/notebooks/notebook-ui/src/com/intellij/notebooks/ui/visualization/markerRenderers/NotebookTextCellBackgroundLineMarkerRenderer.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.intellij.notebooks.ui.visualization.markerRenderers - -import com.intellij.notebooks.ui.visualization.NotebookUtil.paintCaretRow -import com.intellij.openapi.editor.Editor -import com.intellij.openapi.editor.impl.EditorImpl -import com.intellij.openapi.editor.markup.RangeHighlighter -import java.awt.Graphics -import java.awt.Rectangle - -class NotebookTextCellBackgroundLineMarkerRenderer(private val highlighter: RangeHighlighter) : NotebookLineMarkerRenderer() { - override fun paint(editor: Editor, g: Graphics, r: Rectangle) { - editor as EditorImpl - - val lines = IntRange(editor.document.getLineNumber(highlighter.startOffset), editor.document.getLineNumber(highlighter.endOffset)) - - paintCaretRow(editor, g, lines) - } -} \ No newline at end of file