mirror of https://github.com/buggins/dlangide.git
Editor font face setting support - close #12
This commit is contained in:
parent
3bc212e7e7
commit
38f3547fdd
|
@ -89,7 +89,7 @@
|
||||||
<cv2pdbOptions />
|
<cv2pdbOptions />
|
||||||
<objfiles />
|
<objfiles />
|
||||||
<linkswitches />
|
<linkswitches />
|
||||||
<libfiles>ole32.lib kernel32.lib user32.lib comctl32.lib comdlg32.lib psapi.lib</libfiles>
|
<libfiles>ole32.lib kernel32.lib user32.lib</libfiles>
|
||||||
<libpaths />
|
<libpaths />
|
||||||
<deffile />
|
<deffile />
|
||||||
<resfile />
|
<resfile />
|
||||||
|
@ -191,7 +191,7 @@
|
||||||
<cv2pdbOptions />
|
<cv2pdbOptions />
|
||||||
<objfiles />
|
<objfiles />
|
||||||
<linkswitches />
|
<linkswitches />
|
||||||
<libfiles>ole32.lib kernel32.lib user32.lib comctl32.lib comdlg32.lib psapi.lib</libfiles>
|
<libfiles>ole32.lib kernel32.lib user32.lib</libfiles>
|
||||||
<libpaths />
|
<libpaths />
|
||||||
<deffile />
|
<deffile />
|
||||||
<resfile />
|
<resfile />
|
||||||
|
@ -293,7 +293,7 @@
|
||||||
<cv2pdbOptions />
|
<cv2pdbOptions />
|
||||||
<objfiles />
|
<objfiles />
|
||||||
<linkswitches />
|
<linkswitches />
|
||||||
<libfiles>ole32.lib kernel32.lib user32.lib comctl32.lib comdlg32.lib psapi.lib</libfiles>
|
<libfiles>ole32.lib kernel32.lib user32.lib</libfiles>
|
||||||
<libpaths />
|
<libpaths />
|
||||||
<deffile />
|
<deffile />
|
||||||
<resfile />
|
<resfile />
|
||||||
|
@ -395,7 +395,7 @@
|
||||||
<cv2pdbOptions />
|
<cv2pdbOptions />
|
||||||
<objfiles />
|
<objfiles />
|
||||||
<linkswitches />
|
<linkswitches />
|
||||||
<libfiles>ole32.lib kernel32.lib user32.lib comctl32.lib comdlg32.lib psapi.lib</libfiles>
|
<libfiles>ole32.lib kernel32.lib user32.lib</libfiles>
|
||||||
<libpaths />
|
<libpaths />
|
||||||
<deffile />
|
<deffile />
|
||||||
<resfile />
|
<resfile />
|
||||||
|
@ -497,7 +497,7 @@
|
||||||
<cv2pdbOptions />
|
<cv2pdbOptions />
|
||||||
<objfiles />
|
<objfiles />
|
||||||
<linkswitches />
|
<linkswitches />
|
||||||
<libfiles>ole32.lib kernel32.lib user32.lib comctl32.lib comdlg32.lib psapi.lib</libfiles>
|
<libfiles>ole32.lib kernel32.lib user32.lib</libfiles>
|
||||||
<libpaths />
|
<libpaths />
|
||||||
<deffile />
|
<deffile />
|
||||||
<resfile />
|
<resfile />
|
||||||
|
@ -599,7 +599,7 @@
|
||||||
<cv2pdbOptions />
|
<cv2pdbOptions />
|
||||||
<objfiles />
|
<objfiles />
|
||||||
<linkswitches />
|
<linkswitches />
|
||||||
<libfiles>ole32.lib kernel32.lib user32.lib comctl32.lib comdlg32.lib psapi.lib</libfiles>
|
<libfiles>ole32.lib kernel32.lib user32.lib</libfiles>
|
||||||
<libpaths />
|
<libpaths />
|
||||||
<deffile />
|
<deffile />
|
||||||
<resfile />
|
<resfile />
|
||||||
|
|
|
@ -96,6 +96,13 @@ class DSourceEdit : SourceEdit, EditableContentMarksChangeListener {
|
||||||
smartIndentsAfterPaste = _settings.smartIndentsAfterPaste;
|
smartIndentsAfterPaste = _settings.smartIndentsAfterPaste;
|
||||||
showWhiteSpaceMarks = _settings.showWhiteSpaceMarks;
|
showWhiteSpaceMarks = _settings.showWhiteSpaceMarks;
|
||||||
showTabPositionMarks = _settings.showTabPositionMarks;
|
showTabPositionMarks = _settings.showTabPositionMarks;
|
||||||
|
string face = _settings.editorFontFace;
|
||||||
|
if (face == "Default")
|
||||||
|
face = null;
|
||||||
|
else if (face)
|
||||||
|
face ~= ",";
|
||||||
|
face ~= DEFAULT_SOURCE_EDIT_FONT_FACES;
|
||||||
|
fontFace = face;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected EditorTool _editorTool;
|
protected EditorTool _editorTool;
|
||||||
|
|
|
@ -23,6 +23,7 @@ SettingsPage createSettingsPages() {
|
||||||
StringListValue("ru", "Russian"d),
|
StringListValue("ru", "Russian"d),
|
||||||
StringListValue("es", "Spanish"d),
|
StringListValue("es", "Spanish"d),
|
||||||
StringListValue("cs", "Čeština"d)]);
|
StringListValue("cs", "Čeština"d)]);
|
||||||
|
|
||||||
ui.addIntComboBox("interface/hintingMode", UIString("Font hinting mode"d), [StringListValue(0, "Normal"d), StringListValue(1, "Force Auto Hint"d),
|
ui.addIntComboBox("interface/hintingMode", UIString("Font hinting mode"d), [StringListValue(0, "Normal"d), StringListValue(1, "Force Auto Hint"d),
|
||||||
StringListValue(2, "Disabled"d), StringListValue(3, "Light"d)]);
|
StringListValue(2, "Disabled"d), StringListValue(3, "Light"d)]);
|
||||||
ui.addIntComboBox("interface/minAntialiasedFontSize", UIString("Minimum font size for antialiasing"d),
|
ui.addIntComboBox("interface/minAntialiasedFontSize", UIString("Minimum font size for antialiasing"d),
|
||||||
|
@ -58,6 +59,19 @@ SettingsPage createSettingsPages() {
|
||||||
|
|
||||||
SettingsPage ed = res.addChild("editors", UIString("Editors"d));
|
SettingsPage ed = res.addChild("editors", UIString("Editors"d));
|
||||||
SettingsPage texted = ed.addChild("editors/textEditor", UIString("Text Editors"d));
|
SettingsPage texted = ed.addChild("editors/textEditor", UIString("Text Editors"d));
|
||||||
|
|
||||||
|
// font faces
|
||||||
|
StringListValue[] faces;
|
||||||
|
faces ~= StringListValue("Default", "Default"d);
|
||||||
|
import dlangui.graphics.fonts;
|
||||||
|
import std.utf : toUTF32;
|
||||||
|
FontFaceProps[] allFaces = FontManager.instance.getFaces();
|
||||||
|
for (int i = 0; i < allFaces.length; i++) {
|
||||||
|
if (allFaces[i].family == FontFamily.MonoSpace)
|
||||||
|
faces ~= StringListValue(allFaces[i].face, toUTF32(allFaces[i].face));
|
||||||
|
}
|
||||||
|
texted.addStringComboBox("editors/textEditor/fontFace", UIString("Font face"d), faces);
|
||||||
|
|
||||||
texted.addNumberEdit("editors/textEditor/tabSize", UIString("Tab size"d), 1, 16, 4);
|
texted.addNumberEdit("editors/textEditor/tabSize", UIString("Tab size"d), 1, 16, 4);
|
||||||
texted.addCheckbox("editors/textEditor/useSpacesForTabs", UIString("Use spaces for tabs"d));
|
texted.addCheckbox("editors/textEditor/useSpacesForTabs", UIString("Use spaces for tabs"d));
|
||||||
texted.addCheckbox("editors/textEditor/smartIndents", UIString("Smart indents"d));
|
texted.addCheckbox("editors/textEditor/smartIndents", UIString("Smart indents"d));
|
||||||
|
@ -65,6 +79,7 @@ SettingsPage createSettingsPages() {
|
||||||
texted.addCheckbox("editors/textEditor/showWhiteSpaceMarks", UIString("Show white space marks"d));
|
texted.addCheckbox("editors/textEditor/showWhiteSpaceMarks", UIString("Show white space marks"d));
|
||||||
texted.addCheckbox("editors/textEditor/showTabPositionMarks", UIString("Show tab position marks"d));
|
texted.addCheckbox("editors/textEditor/showTabPositionMarks", UIString("Show tab position marks"d));
|
||||||
|
|
||||||
|
|
||||||
SettingsPage dlang = res.addChild("dlang", UIString("D"d));
|
SettingsPage dlang = res.addChild("dlang", UIString("D"d));
|
||||||
SettingsPage dub = dlang.addChild("dlang/dub", UIString("DUB"d));
|
SettingsPage dub = dlang.addChild("dlang/dub", UIString("DUB"d));
|
||||||
dub.addExecutableFileNameEdit("dlang/dub/executable", UIString("DUB executable"d), "dub");
|
dub.addExecutableFileNameEdit("dlang/dub/executable", UIString("DUB executable"d), "dub");
|
||||||
|
|
|
@ -2,6 +2,7 @@ module dlangide.ui.terminal;
|
||||||
|
|
||||||
import dlangui.widgets.widget;
|
import dlangui.widgets.widget;
|
||||||
import dlangui.widgets.controls;
|
import dlangui.widgets.controls;
|
||||||
|
import dlangui.widgets.scrollbar;
|
||||||
|
|
||||||
struct TerminalAttr {
|
struct TerminalAttr {
|
||||||
ubyte bgColor = 0;
|
ubyte bgColor = 0;
|
||||||
|
|
|
@ -23,6 +23,7 @@ class IDESettings : SettingsFile {
|
||||||
ed.setBooleanDef("smartIndentsAfterPaste", true);
|
ed.setBooleanDef("smartIndentsAfterPaste", true);
|
||||||
ed.setBooleanDef("showWhiteSpaceMarks", true);
|
ed.setBooleanDef("showWhiteSpaceMarks", true);
|
||||||
ed.setBooleanDef("showTabPositionMarks", true);
|
ed.setBooleanDef("showTabPositionMarks", true);
|
||||||
|
ed.setStringDef("fontFace", "Default");
|
||||||
Setting ui = uiSettings();
|
Setting ui = uiSettings();
|
||||||
ui.setStringDef("theme", "ide_theme_default");
|
ui.setStringDef("theme", "ide_theme_default");
|
||||||
ui.setStringDef("language", "en");
|
ui.setStringDef("language", "en");
|
||||||
|
@ -157,6 +158,8 @@ class IDESettings : SettingsFile {
|
||||||
@property bool showTabPositionMarks() { return editorSettings.getBoolean("showTabPositionMarks", true); }
|
@property bool showTabPositionMarks() { return editorSettings.getBoolean("showTabPositionMarks", true); }
|
||||||
/// set tab position marks enabled flag
|
/// set tab position marks enabled flag
|
||||||
@property IDESettings showTabPositionMarks(bool enabled) { editorSettings.setBoolean("showTabPositionMarks", enabled); return this; }
|
@property IDESettings showTabPositionMarks(bool enabled) { editorSettings.setBoolean("showTabPositionMarks", enabled); return this; }
|
||||||
|
/// string value of font face
|
||||||
|
@property string editorFontFace() { return editorSettings.getString("fontFace", "Default"); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue