apply ui font changes

This commit is contained in:
Vadim Lopatin 2017-08-25 17:01:25 +03:00
parent 8fffaa9e09
commit a318577f97
2 changed files with 26 additions and 0 deletions

View File

@ -1354,6 +1354,22 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
FontManager.minAnitialiasedFontSize = settings.minAntialiasedFontSize;
Platform.instance.uiLanguage = settings.uiLanguage;
Platform.instance.uiTheme = settings.uiTheme;
bool needUpdateTheme = false;
string oldFontFace = currentTheme.fontFace;
string newFontFace = settings.uiFontFace;
if (newFontFace == "Default")
newFontFace = "Helvetica Neue,Verdana,Arial,DejaVu Sans,Liberation Sans,Helvetica,Roboto,Droid Sans";
int oldFontSize = currentTheme.fontSize;
if (oldFontFace != newFontFace) {
currentTheme.fontFace = newFontFace;
needUpdateTheme = true;
}
if (oldFontSize != settings.uiFontSize) {
currentTheme.fontSize = settings.uiFontSize;
needUpdateTheme = true;
}
if (needUpdateTheme)
Platform.instance.onThemeChanged();
requestLayout();
}

View File

@ -126,6 +126,16 @@ class IDESettings : SettingsFile {
return this;
}
/// UI font face
@property string uiFontFace() {
return uiSettings.getString("uiFontFace", "Default");
}
/// UI font size
@property int uiFontSize() {
return pointsToPixels(cast(int)uiSettings.getInteger("uiFontSize", 10));
}
/// text editor setting, true if need to insert spaces instead of tabs
@property bool useSpacesForTabs() {
return editorSettings.getBoolean("useSpacesForTabs", true);