diff --git a/python/educational-core/student/resources/code-mirror/codemirror-darcula.css b/python/educational-core/student/resources/code-mirror/codemirror-darcula.css index 3467a40553d2..3e66be66285d 100644 --- a/python/educational-core/student/resources/code-mirror/codemirror-darcula.css +++ b/python/educational-core/student/resources/code-mirror/codemirror-darcula.css @@ -16,9 +16,11 @@ body { margin-left: 20px; - /*font-family: Serif, serif;*/ - font-family: monospace; - font-weight: lighter; + font-family: Helvetica, sans-serif; +} + +code { + font-family: Courier, monospace; } /* BASICS */ diff --git a/python/educational-core/student/resources/code-mirror/codemirror.css b/python/educational-core/student/resources/code-mirror/codemirror.css index 464ad6715e5c..02a90171af55 100644 --- a/python/educational-core/student/resources/code-mirror/codemirror.css +++ b/python/educational-core/student/resources/code-mirror/codemirror.css @@ -1,8 +1,11 @@ body { margin-left: 20px; - /*font-family: Serif, serif;*/ - font-family: monospace; - font-weight: lighter; + font-family: Helvetica, sans-serif; + color: #4f5254; +} + +code { + font-family: "Source Code Pro", fantasy; } /* BASICS */ .task-help pre code { diff --git a/python/educational-core/student/resources/code-mirror/template.html b/python/educational-core/student/resources/code-mirror/template.html index c4226ea99ec5..11ced417926c 100644 --- a/python/educational-core/student/resources/code-mirror/template.html +++ b/python/educational-core/student/resources/code-mirror/template.html @@ -1,14 +1,31 @@
+ + + + + + + + + + + + ${code} diff --git a/python/educational-core/student/src/com/jetbrains/edu/learning/ui/StudyBrowserWindow.java b/python/educational-core/student/src/com/jetbrains/edu/learning/ui/StudyBrowserWindow.java index 004ff791a940..5b96f88ebc7b 100644 --- a/python/educational-core/student/src/com/jetbrains/edu/learning/ui/StudyBrowserWindow.java +++ b/python/educational-core/student/src/com/jetbrains/edu/learning/ui/StudyBrowserWindow.java @@ -7,6 +7,8 @@ import com.intellij.ide.ui.LafManagerListener; import com.intellij.ide.ui.laf.darcula.DarculaLookAndFeelInfo; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.editor.colors.EditorColorsManager; +import com.intellij.openapi.editor.colors.EditorColorsScheme; import com.intellij.openapi.util.io.StreamUtil; import com.jetbrains.edu.learning.StudyToolWindowConfigurator; import javafx.application.Platform; @@ -152,8 +154,12 @@ class StudyBrowserWindow extends JFrame { if (template == null) { LOG.warn("Code mirror template is null"); return null; - } + } + + final EditorColorsScheme editorColorsScheme = EditorColorsManager.getInstance().getGlobalScheme(); + int fontSize = editorColorsScheme.getEditorFontSize(); + template = template.replace("${font_size}", String.valueOf(fontSize- 2)); template = template.replace("${highlight_mode}", getClass().getResource("/code-mirror/clike.js").toExternalForm()); template = template.replace("${codemirror}", getClass().getResource("/code-mirror/codemirror.js").toExternalForm()); template = template.replace("${python}", getClass().getResource("/code-mirror/python.js").toExternalForm());