From e2b94a324f6ea3f5c6e3813253f17754b1647f9e Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Mon, 7 Sep 2020 09:50:43 -0400 Subject: [PATCH] Bug 566732: Connect selection preference page to terminal Bug 549697 introduced the new UI for setting colors, but the selection color (while added to the pref page) was never connected to the code. Change-Id: I9934efe595efe141a14f0bca3bdf355f436d907d --- .../tm/internal/terminal/textcanvas/TextLineRenderer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/textcanvas/TextLineRenderer.java b/terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/textcanvas/TextLineRenderer.java index 6f4cc343fbe..d092bc6fc8b 100644 --- a/terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/textcanvas/TextLineRenderer.java +++ b/terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/textcanvas/TextLineRenderer.java @@ -18,7 +18,6 @@ package org.eclipse.tm.internal.terminal.textcanvas; import java.util.Map; -import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Device; import org.eclipse.swt.graphics.Font; @@ -78,8 +77,9 @@ public class TextLineRenderer implements ILinelRenderer { drawCursor(model, doubleBufferGC, line, 0, 0, colFirst); } if (fModel.hasLineSelection(line)) { - doubleBufferGC.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT)); - doubleBufferGC.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_SELECTION)); + TerminalStyle style = TerminalStyle.getStyle(TerminalColor.SELECTION_FOREGROUND, + TerminalColor.SELECTION_BACKGROUND); + setupGC(doubleBufferGC, style); Point start = model.getSelectionStart(); Point end = model.getSelectionEnd(); char[] chars = model.getTerminalText().getChars(line);