mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-15 12:29:26 +01:00
New editor: setForeground doesn't change default text color, "IDENTIFIER" token style does the job. Fixes #3372
This commit is contained in:
parent
9089fecbe4
commit
ee006271d8
@ -106,7 +106,6 @@ public class SketchTextArea extends RSyntaxTextArea {
|
|||||||
IOUtils.closeQuietly(defaultXmlInputStream);
|
IOUtils.closeQuietly(defaultXmlInputStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
setForeground(processing.app.Theme.getColor("editor.fgcolor"));
|
|
||||||
setBackground(processing.app.Theme.getColor("editor.bgcolor"));
|
setBackground(processing.app.Theme.getColor("editor.bgcolor"));
|
||||||
setCurrentLineHighlightColor(processing.app.Theme.getColor("editor.linehighlight.color"));
|
setCurrentLineHighlightColor(processing.app.Theme.getColor("editor.linehighlight.color"));
|
||||||
setCaretColor(processing.app.Theme.getColor("editor.caret.color"));
|
setCaretColor(processing.app.Theme.getColor("editor.caret.color"));
|
||||||
@ -129,6 +128,10 @@ public class SketchTextArea extends RSyntaxTextArea {
|
|||||||
setSyntaxTheme(TokenTypes.LITERAL_BOOLEAN, "literal_boolean");
|
setSyntaxTheme(TokenTypes.LITERAL_BOOLEAN, "literal_boolean");
|
||||||
setSyntaxTheme(TokenTypes.LITERAL_CHAR, "literal_char");
|
setSyntaxTheme(TokenTypes.LITERAL_CHAR, "literal_char");
|
||||||
setSyntaxTheme(TokenTypes.LITERAL_STRING_DOUBLE_QUOTE, "literal_string_double_quote");
|
setSyntaxTheme(TokenTypes.LITERAL_STRING_DOUBLE_QUOTE, "literal_string_double_quote");
|
||||||
|
|
||||||
|
Style style = getSyntaxScheme().getStyle(TokenTypes.IDENTIFIER);
|
||||||
|
style.foreground = processing.app.Theme.getColor("editor.fgcolor");
|
||||||
|
getSyntaxScheme().setStyle(TokenTypes.IDENTIFIER, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setSyntaxTheme(int tokenType, String id) {
|
private void setSyntaxTheme(int tokenType, String id) {
|
||||||
@ -391,7 +394,7 @@ public class SketchTextArea extends RSyntaxTextArea {
|
|||||||
// Copy token, viewToModel() unfortunately modifies Token
|
// Copy token, viewToModel() unfortunately modifies Token
|
||||||
t = new TokenImpl(t);
|
t = new TokenImpl(t);
|
||||||
}
|
}
|
||||||
Cursor c2 = null;
|
Cursor c2;
|
||||||
if (t != null && t.isHyperlink()) {
|
if (t != null && t.isHyperlink()) {
|
||||||
if (hoveredOverLinkOffset == -1 ||
|
if (hoveredOverLinkOffset == -1 ||
|
||||||
hoveredOverLinkOffset != t.getOffset()) {
|
hoveredOverLinkOffset != t.getOffset()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user