summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorBogdan Gheorghe2013-04-18 12:50:35 (EDT)
committer Silenio Quarti2013-04-18 12:50:35 (EDT)
commit5086a683d26010c44f3d644723882746a85e0532 (patch)
treec39786e806f6c386635980871ebc93c7b80063ca
parent616f28c06e3f9e5c76ea666dbeb3764fb70a9518 (diff)
downloadorg.eclipse.orion.client-5086a683d26010c44f3d644723882746a85e0532.zip
org.eclipse.orion.client-5086a683d26010c44f3d644723882746a85e0532.tar.gz
org.eclipse.orion.client-5086a683d26010c44f3d644723882746a85e0532.tar.bz2
Bug 404492 - Editor theme font should not always be Courier
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/orion/editor/textTheme.js32
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/orion/widgets/themes/editor/ThemeData.js41
2 files changed, 35 insertions, 38 deletions
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/textTheme.js b/bundles/org.eclipse.orion.client.editor/web/orion/editor/textTheme.js
index 807e73d..fecd977 100644
--- a/bundles/org.eclipse.orion.client.editor/web/orion/editor/textTheme.js
+++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/textTheme.js
@@ -131,29 +131,31 @@ define("orion/editor/textTheme", //$NON-NLS-0$
var result = [];
result.push("");
- //view container
- var family = settings.fontFamily;
- if (family === "sans serif") { //$NON-NLS-0$
- family = '"Menlo", "Consolas", "Vera Mono", "monospace"'; //$NON-NLS-0$
- } else {
- family = 'monospace'; //$NON-NLS-0$
- }
-
result.push("." + themeClass + " {"); //$NON-NLS-1$ //$NON-NLS-0$
- result.push("\tfont-family: " + family + ";"); //$NON-NLS-1$ //$NON-NLS-0$
- result.push("\tfont-size: " + settings.fontSize + ";"); //$NON-NLS-1$ //$NON-NLS-0$
- result.push("\tcolor: " + settings.text + ";"); //$NON-NLS-1$ //$NON-NLS-0$
+ if (settings.fontFamily) {
+ result.push("\tfont-family: " + settings.fontFamily + ";"); //$NON-NLS-1$ //$NON-NLS-0$
+ }
+ if (settings.fontSize) {
+ result.push("\tfont-size: " + settings.fontSize + ";"); //$NON-NLS-1$ //$NON-NLS-0$
+ }
+ if (settings.fontSize) {
+ result.push("\tcolor: " + settings.text + ";"); //$NON-NLS-1$ //$NON-NLS-0$
+ }
result.push("}"); //$NON-NLS-0$
//From textview.css
result.push("." + themeClass + ".textview {"); //$NON-NLS-1$ //$NON-NLS-0$
- result.push("\tbackground-color: " + settings.background + ";"); //$NON-NLS-1$ //$NON-NLS-0$
+ if (settings.background) {
+ result.push("\tbackground-color: " + settings.background + ";"); //$NON-NLS-1$ //$NON-NLS-0$
+ }
result.push("}"); //$NON-NLS-0$
function defineRule(className, value, isBackground) {
- result.push("." + themeClass + " ." + className + " {"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
- result.push("\t" + (isBackground ? "background-color" : "color") + ": " + value + ";"); //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
- result.push("}"); //$NON-NLS-0$
+ if (value) {
+ result.push("." + themeClass + " ." + className + " {"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ result.push("\t" + (isBackground ? "background-color" : "color") + ": " + value + ";"); //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ result.push("}"); //$NON-NLS-0$
+ }
}
//From rulers.css
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/themes/editor/ThemeData.js b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/themes/editor/ThemeData.js
index 8a9f9d3..734a1e0 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/themes/editor/ThemeData.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/themes/editor/ThemeData.js
@@ -38,21 +38,8 @@ define(['orion/editor/textTheme'],
return resultString + result;
}
-
- StyleSet.prototype.name = 'prospecto';
- StyleSet.prototype.annotationRuler = 'darkSlateGray';
- StyleSet.prototype.background = '#EFEFEF';
- StyleSet.prototype.comment = '#3C802C';
- StyleSet.prototype.keyword = '#CC4C07';
- StyleSet.prototype.text = '#333';
- StyleSet.prototype.string = '#446FBD';
- StyleSet.prototype.overviewRuler = '#FBFBFB';
- StyleSet.prototype.lineNumberOdd = 'white';
- StyleSet.prototype.lineNumberEven = 'white';
- StyleSet.prototype.lineNumber = 'silver';
- StyleSet.prototype.tag = '#CC4C07';
- StyleSet.prototype.attribute = 'cadetBlue';
- StyleSet.prototypefontSize = '10pt';
+ var defaultFont = '"Menlo", "Consolas", "Vera Mono", "monospace"';
+ var defaultFontSize = '10pt';
function ThemeData() {
@@ -74,7 +61,8 @@ define(['orion/editor/textTheme'],
eclipse.currentLine = '#EAF2FE';
eclipse.tag = 'darkorange';
eclipse.attribute = 'cadetBlue';
- eclipse.fontSize = '10pt';
+ eclipse.fontFamily = defaultFont;
+ eclipse.fontSize = defaultFontSize;
this.styles.push(eclipse);
@@ -94,7 +82,8 @@ define(['orion/editor/textTheme'],
prospecto.currentLine = '#EAF2FE';
prospecto.tag = '#CC4C07';
prospecto.attribute = 'cadetBlue';
- prospecto.fontSize = '10pt';
+ prospecto.fontFamily = defaultFont;
+ prospecto.fontSize = defaultFontSize;
this.styles.push(prospecto);
@@ -115,7 +104,8 @@ define(['orion/editor/textTheme'],
blue.currentLine = 'white';
blue.tag = 'cornFlowerBlue';
blue.attribute = 'cadetBlue';
- blue.fontSize = '10pt';
+ blue.fontFamily = defaultFont;
+ blue.fontSize = defaultFontSize;
this.styles.push(blue);
@@ -135,7 +125,8 @@ define(['orion/editor/textTheme'],
ambience.currentLine = 'lightcyan';
ambience.tag = 'cornFlowerBlue';
ambience.attribute = 'cadetBlue';
- ambience.fontSize = '10pt';
+ ambience.fontFamily = defaultFont;
+ ambience.fontSize = defaultFontSize;
this.styles.push(ambience);
@@ -155,7 +146,8 @@ define(['orion/editor/textTheme'],
tierra.currentLine = '#baa289';
tierra.tag = 'darkred';
tierra.attribute = 'cadetBlue';
- tierra.fontSize = '10pt';
+ tierra.fontFamily = defaultFont;
+ tierra.fontSize = defaultFontSize;
this.styles.push(tierra);
@@ -175,7 +167,8 @@ define(['orion/editor/textTheme'],
nimbus.currentLine = '#aabfbb';
nimbus.tag = 'darkorange';
nimbus.attribute = 'cadetBlue';
- nimbus.fontSize = '10pt';
+ nimbus.fontFamily = defaultFont;
+ nimbus.fontSize = defaultFontSize;
this.styles.push(nimbus);
@@ -195,7 +188,8 @@ define(['orion/editor/textTheme'],
adelante.currentLine = '#9e937b';
adelante.tag = '#AF473B';
adelante.attribute = 'cadetBlue';
- adelante.fontSize = '10pt';
+ adelante.fontFamily = defaultFont;
+ adelante.fontSize = defaultFontSize;
this.styles.push(adelante);
@@ -215,7 +209,8 @@ define(['orion/editor/textTheme'],
raspberry.currentLine = '#F5B1AE';
raspberry.tag = '#E73E36';
raspberry.attribute = 'cadetBlue';
- raspberry.fontSize = '10pt';
+ raspberry.fontFamily = defaultFont;
+ raspberry.fontSize = defaultFontSize;
this.styles.push(raspberry);