* Add ability to use custom font family in editors

As suggested by @brainplot in #803
This commit is contained in:
RabsRincon
2018-12-26 21:45:38 +01:00
parent d75c587678
commit 5706da42e1
8 changed files with 30 additions and 7 deletions
+2 -1
View File
@@ -184,7 +184,8 @@ Ast.prototype.onSettingsChange = function (newSettings) {
contextmenu: newSettings.useCustomContextMenu,
minimap: {
enabled: newSettings.showMinimap
}
},
fontFamily: newSettings.editorsFFont
});
};
+3 -2
View File
@@ -105,7 +105,7 @@ function Compiler(hub, container, state) {
scrollBeyondLastLine: false,
readOnly: true,
language: 'asm',
fontFamily: 'Consolas, "Liberation Mono", Courier, monospace',
fontFamily: this.settings.editorsFFont,
glyphMargin: !options.embedded,
fixedOverflowWidgets: true,
minimap: {
@@ -1295,7 +1295,8 @@ Compiler.prototype.onSettingsChange = function (newSettings) {
contextmenu: this.settings.useCustomContextMenu,
minimap: {
enabled: this.settings.showMinimap && !options.embedded
}
},
fontFamily: this.settings.editorsFFont
});
};
+2 -1
View File
@@ -239,7 +239,8 @@ Diff.prototype.onSettingsChange = function (newSettings) {
this.outputEditor.updateOptions({
minimap: {
enabled: newSettings.showMinimap
}
},
fontFamily: newSettings.editorsFFont
});
};
+2 -1
View File
@@ -88,7 +88,7 @@ function Editor(hub, state, container) {
this.editor = monaco.editor.create(root[0], {
scrollBeyondLastLine: false,
language: this.currentLanguage.monaco,
fontFamily: 'Consolas, "Liberation Mono", Courier, monospace',
fontFamily: this.settings.editorsFFont,
readOnly: !!options.readOnly || legacyReadOnly,
glyphMargin: !options.embedded,
quickSuggestions: false,
@@ -538,6 +538,7 @@ Editor.prototype.onSettingsChange = function (newSettings) {
minimap: {
enabled: this.settings.showMinimap && !options.embedded
},
fontFamily: this.settings.editorsFFont,
wordWrap: this.settings.wordWrap ? 'bounded' : 'off',
wordWrapColumn: this.editor.getLayoutInfo().viewportColumn // Ensure the column count is up to date
});
+2 -1
View File
@@ -297,7 +297,8 @@ GccDump.prototype.onSettingsChange = function (newSettings) {
contextmenu: newSettings.useCustomContextMenu,
minimap: {
enabled: newSettings.showMinimap
}
},
fontFamily: newSettings.editorsFFont
});
};
+2 -1
View File
@@ -224,7 +224,8 @@ Opt.prototype.onSettingsChange = function (newSettings) {
contextmenu: newSettings.useCustomContextMenu,
minimap: {
enabled: newSettings.showMinimap
}
},
fontFamily: newSettings.editorsFFont
});
};
+13
View File
@@ -78,6 +78,18 @@ Slider.prototype.putUi = function (elem, value) {
elem.slider('setValue', value);
};
function Textbox() {
}
Textbox.prototype.getUi = function (elem) {
return elem.val();
};
Textbox.prototype.putUi = function (elem, value) {
elem.val(value);
};
function setupSettings(root, settings, onChange, langId) {
settings = settings || {};
// Ensure the default language is not "null" but undefined. Temporary patch for a previous bug :(
@@ -206,6 +218,7 @@ function setupSettings(root, settings, onChange, langId) {
})
);
add(root.find('.enableCtrlS'), 'enableCtrlS', true, Checkbox);
add(root.find('.editorsFFont'), 'editorsFFont', 'Consolas, "Liberation Mono", Courier, monospace', Textbox);
setSettings(settings);
handleThemes();
+4
View File
@@ -100,6 +100,10 @@
.card-title
h4 Editor
.form-group(role="group")
div
label
| Desired Font Family in editors
input.editorsFFont(type="text" style="width:100%")
.checkbox
label
input.autoCloseBrackets(type="checkbox")