diff --git a/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/BlockTerminalView.kt b/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/BlockTerminalView.kt index 6ea14ee9886a..dc8d2b022aa8 100644 --- a/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/BlockTerminalView.kt +++ b/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/BlockTerminalView.kt @@ -87,7 +87,7 @@ class BlockTerminalView( } }) - component.background = TerminalUI.terminalBackground + component.background = TerminalUi.terminalBackground installPromptAndOutput() } diff --git a/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/SimpleTerminalView.kt b/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/SimpleTerminalView.kt index a1eb956d3538..019a14d42096 100644 --- a/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/SimpleTerminalView.kt +++ b/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/SimpleTerminalView.kt @@ -54,8 +54,8 @@ class SimpleTerminalView( } }) - component.background = TerminalUI.terminalBackground - component.border = JBUI.Borders.emptyLeft(TerminalUI.alternateBufferLeftInset) + component.background = TerminalUi.terminalBackground + component.border = JBUI.Borders.emptyLeft(TerminalUi.alternateBufferLeftInset) component.layout = BorderLayout() component.add(editor.component, BorderLayout.CENTER) } diff --git a/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalBlocksDecorator.kt b/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalBlocksDecorator.kt index 42f574d3025a..c7677e52b31a 100644 --- a/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalBlocksDecorator.kt +++ b/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalBlocksDecorator.kt @@ -30,13 +30,13 @@ class TerminalBlocksDecorator(private val editor: EditorEx) { @RequiresEdt fun installDecoration(block: CommandBlock, isFirstBlock: Boolean = false): BlockDecoration { // add additional empty space on top of the block, if it is the first block - val topInset = TerminalUI.blockTopInset + if (isFirstBlock) TerminalUI.blocksGap else 0 + val topInset = TerminalUi.blockTopInset + if (isFirstBlock) TerminalUi.blocksGap else 0 val topRenderer = EmptyWidthInlayRenderer(topInset) val topInlay = editor.inlayModel.addBlockElement(block.startOffset, false, true, 1, topRenderer)!! - val bottomRenderer = EmptyWidthInlayRenderer(TerminalUI.blockBottomInset + TerminalUI.blocksGap) + val bottomRenderer = EmptyWidthInlayRenderer(TerminalUi.blockBottomInset + TerminalUi.blocksGap) val bottomInlay = editor.inlayModel.addBlockElement(block.endOffset, true, false, 0, bottomRenderer)!! - val attributes = TextAttributes(TerminalUI.outputForeground, TerminalUI.blockBackground, null, null, Font.PLAIN) + val attributes = TextAttributes(TerminalUi.outputForeground, TerminalUi.blockBackground, null, null, Font.PLAIN) val highlighter = editor.markupModel.addRangeHighlighter(block.startOffset, block.endOffset, HighlighterLayer.FIRST - 100, attributes, HighlighterTargetArea.LINES_IN_RANGE) highlighter.isGreedyToRight = true @@ -60,10 +60,10 @@ class TerminalBlocksDecorator(private val editor: EditorEx) { private class TerminalRightAreaRenderer : CustomHighlighterRenderer { override fun paint(editor: Editor, highlighter: RangeHighlighter, g: Graphics) { val visibleArea = editor.scrollingModel.visibleArea - val width = JBUI.scale(TerminalUI.cornerToBlockInset) + val width = JBUI.scale(TerminalUi.cornerToBlockInset) val oldColor = g.color try { - g.color = TerminalUI.terminalBackground + g.color = TerminalUi.terminalBackground g.fillRect(visibleArea.width - width, visibleArea.y, width, visibleArea.height) } finally { @@ -75,10 +75,10 @@ class TerminalBlocksDecorator(private val editor: EditorEx) { /** Paints the left part of the rounded block frame in the gutter area. */ private class TerminalBlockLeftAreaRenderer : LineMarkerRenderer { override fun paint(editor: Editor, g: Graphics, r: Rectangle) { - val topIns = toFloatAndScale(TerminalUI.blockTopInset) - val bottomIns = toFloatAndScale(TerminalUI.blockBottomInset) - val width = toFloatAndScale(TerminalUI.blockLeftInset) - val arc = toFloatAndScale(TerminalUI.blockArc) + val topIns = toFloatAndScale(TerminalUi.blockTopInset) + val bottomIns = toFloatAndScale(TerminalUi.blockBottomInset) + val width = toFloatAndScale(TerminalUi.blockLeftInset) + val arc = toFloatAndScale(TerminalUi.blockArc) val gutterWidth = (editor as EditorEx).gutterComponentEx.width val rect = Rectangle2D.Float(gutterWidth - width, r.y - topIns, width, r.height + topIns + bottomIns) @@ -96,7 +96,7 @@ class TerminalBlocksDecorator(private val editor: EditorEx) { val g2d = g.create() as Graphics2D try { GraphicsUtil.setupAntialiasing(g2d) - g2d.color = TerminalUI.blockBackground + g2d.color = TerminalUi.blockBackground g2d.fill(path) } finally { @@ -113,11 +113,11 @@ class TerminalBlocksDecorator(private val editor: EditorEx) { */ private class TerminalBlockRenderer : CustomHighlighterRenderer { override fun paint(editor: Editor, highlighter: RangeHighlighter, g: Graphics) { - val topIns = toFloatAndScale(TerminalUI.blockTopInset) - val bottomIns = toFloatAndScale(TerminalUI.blockBottomInset) - val cornerToBlock = toFloatAndScale(TerminalUI.cornerToBlockInset) - val gap = toFloatAndScale(TerminalUI.blocksGap) - val arc = toFloatAndScale(TerminalUI.blockArc) + val topIns = toFloatAndScale(TerminalUi.blockTopInset) + val bottomIns = toFloatAndScale(TerminalUi.blockBottomInset) + val cornerToBlock = toFloatAndScale(TerminalUi.cornerToBlockInset) + val gap = toFloatAndScale(TerminalUi.blocksGap) + val arc = toFloatAndScale(TerminalUi.blockArc) val visibleArea = editor.scrollingModel.visibleArea val width = visibleArea.width - cornerToBlock @@ -145,10 +145,10 @@ class TerminalBlocksDecorator(private val editor: EditorEx) { val g2d = g.create() as Graphics2D try { GraphicsUtil.setupAntialiasing(g2d) - g2d.color = TerminalUI.blockBackground + g2d.color = TerminalUi.blockBackground g2d.fill(topRect) g2d.fill(bottomRect) - g2d.color = TerminalUI.terminalBackground + g2d.color = TerminalUi.terminalBackground g2d.fill(gapRect) // override the right corners to make them rounded g2d.fill(topCornerPath) diff --git a/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalPromptView.kt b/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalPromptView.kt index b2478158b2bb..ec351e249f18 100644 --- a/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalPromptView.kt +++ b/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalPromptView.kt @@ -47,15 +47,15 @@ class TerminalPromptView( commandHistoryPresenter = CommandHistoryPresenter(project, editor, commandExecutor) - val innerBorder = JBUI.Borders.empty(TerminalUI.promptTopInset, - TerminalUI.blockLeftInset + TerminalUI.cornerToBlockInset, - TerminalUI.promptBottomInset, - TerminalUI.blockRightInset + TerminalUI.cornerToBlockInset) + val innerBorder = JBUI.Borders.empty(TerminalUi.promptTopInset, + TerminalUi.blockLeftInset + TerminalUi.cornerToBlockInset, + TerminalUi.promptBottomInset, + TerminalUi.blockRightInset + TerminalUi.cornerToBlockInset) val outerBorder = JBUI.Borders.customLineTop(JBUI.CurrentTheme.CustomFrameDecorations.separatorForeground()) component.border = JBUI.Borders.compound(outerBorder, innerBorder) - component.background = TerminalUI.terminalBackground - component.layout = ListLayout.vertical(TerminalUI.promptToCommandInset) + component.background = TerminalUi.terminalBackground + component.layout = ListLayout.vertical(TerminalUi.promptToCommandInset) component.add(promptLabel) component.add(editorTextField) } @@ -98,7 +98,7 @@ class TerminalPromptView( val editor = textField.getEditor(true) as EditorImpl editor.scrollPane.border = JBUI.Borders.empty() editor.gutterComponentEx.isPaintBackground = false - editor.backgroundColor = TerminalUI.terminalBackground + editor.backgroundColor = TerminalUi.terminalBackground editor.colorsScheme.apply { editorFontName = settings.terminalFont.fontName editorFontSize = settings.terminalFont.size @@ -116,7 +116,7 @@ class TerminalPromptView( font = EditorUtil.getEditorFont() } } - label.foreground = TerminalUI.promptForeground + label.foreground = TerminalUi.promptForeground label.alignmentX = JComponent.LEFT_ALIGNMENT return label } diff --git a/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalUI.kt b/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalUi.kt similarity index 97% rename from plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalUI.kt rename to plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalUi.kt index fe887fb4bb82..0938ea6b650a 100644 --- a/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalUI.kt +++ b/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalUi.kt @@ -5,7 +5,7 @@ import com.intellij.ui.JBColor import java.awt.Color @Suppress("ConstPropertyName") -object TerminalUI { +object TerminalUi { const val blockTopInset = 8 const val blockBottomInset = 12 const val blockLeftInset = 12 diff --git a/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalWidgetImpl.kt b/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalWidgetImpl.kt index bc5bd41e43b4..046cf97d46bd 100644 --- a/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalWidgetImpl.kt +++ b/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalWidgetImpl.kt @@ -101,7 +101,7 @@ class TerminalWidgetImpl(private val project: Project, private class TerminalPlaceholder : TerminalContentView { override val component: JComponent = object : JPanel() { override fun getBackground(): Color { - return TerminalUI.terminalBackground + return TerminalUi.terminalBackground } }