Fix #EDU-526 Set task description font size depends on editor font size Change fonts...
authorValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Wed, 10 Feb 2016 12:28:02 +0000 (15:28 +0300)
committerValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Wed, 10 Feb 2016 12:40:09 +0000 (15:40 +0300)
python/educational-core/student/resources/code-mirror/codemirror-darcula.css
python/educational-core/student/resources/code-mirror/codemirror.css
python/educational-core/student/resources/code-mirror/template.html
python/educational-core/student/src/com/jetbrains/edu/learning/ui/StudyBrowserWindow.java

index 3467a40553d2cd3983784980f8c1e909d0606724..3e66be66285d535ba966218bddee59e64193baa5 100644 (file)
 
 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 */
index 464ad6715e5ca28f8a253efd660590b48c6311aa..02a90171af550eb4ae8c833b02e675b26b77ba9c 100644 (file)
@@ -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 {
index c4226ea99ec52458d46c5489e604dc4091207f51..11ced417926c5ae9d39309931ce68e24b8f0852a 100644 (file)
@@ -1,14 +1,31 @@
 <!DOCTYPE html>
 <html>
 <head>
+  <!--all elements like "${}" is replaced by real values while loading page in StudyBrowser-->
+
+  <!--suppress HtmlUnknownTarget -->
   <link rel="stylesheet" href="${css_oldcodemirror}">
+  <!--suppress HtmlUnknownTarget -->
   <link rel="stylesheet" href="${css_codemirror}">
+  <!--suppress HtmlUnknownTarget -->
   <script src="${codemirror}"></script>
+  <!--suppress HtmlUnknownTarget -->
   <script src="${colorize}"></script>
+  <!--suppress HtmlUnknownTarget -->
   <script src="${runmode}"></script>
+  <!--suppress HtmlUnknownTarget -->
   <script src="${highlight_mode}"></script>
+  <!--suppress HtmlUnknownTarget -->
   <script src="${javascript}"></script>
+  <!--suppress HtmlUnknownTarget -->
   <script src="${python}"></script>
+  <!--suppress CssInvalidPropertyValue -->
+  <style media="screen" type="text/css">
+    body {
+      font-size: ${font_size}pt !important;
+    }
+
+  </style>
 </head>
 <body>
 ${code}
index 004ff791a9400c9f9c4cde786783a15ab81187c2..5b96f88ebc7b5af7655140853e88ccb6a63350ea 100644 (file)
@@ -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());