diff options
author | Marius Kintel <marius@kintel.net> | 2012-01-08 18:14:30 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2012-01-08 18:14:30 (GMT) |
commit | 3c18145b13759db1a8926e29b81fb41f8efcde4d (patch) | |
tree | 75cc01dd8507a1667c4ba715cdc408ad785dce19 /src/Preferences.cc | |
parent | 11fb1f71dad9c7d744ff5bbe7c3ee017ed67ff41 (diff) | |
parent | f3e6e8168bac6b14383d1d321de7dcf122e0b7de (diff) |
Merge branch 'master' into boost_filesystem
Diffstat (limited to 'src/Preferences.cc')
-rw-r--r-- | src/Preferences.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/Preferences.cc b/src/Preferences.cc index 4c43f2d..e05106b 100644 --- a/src/Preferences.cc +++ b/src/Preferences.cc @@ -47,16 +47,24 @@ Preferences::Preferences(QWidget *parent) : QMainWindow(parent) // Setup default settings this->defaultmap["3dview/colorscheme"] = this->colorSchemeChooser->currentItem()->text(); + this->defaultmap["advanced/opencsg_show_warning"] = true; + this->defaultmap["advanced/enable_opencsg_opengl1x"] = true; + + // Setup default font (Try to use a nice monospace font) + QString fontfamily; #ifdef Q_WS_X11 - this->defaultmap["editor/fontfamily"] = "Mono"; + fontfamily = "Mono"; #elif defined (Q_WS_WIN) - this->defaultmap["editor/fontfamily"] = "Console"; + fontfamily = "Console"; #elif defined (Q_WS_MAC) - this->defaultmap["editor/fontfamily"] = "Monaco"; + fontfamily = "Monaco"; #endif + QFont font; + font.setStyleHint(QFont::TypeWriter); + font.setFamily(fontfamily); // this runs Qt's font matching algorithm + QString found_family(QFontInfo(font).family()); + this->defaultmap["editor/fontfamily"] = found_family; this->defaultmap["editor/fontsize"] = 12; - this->defaultmap["advanced/opencsg_show_warning"] = true; - this->defaultmap["advanced/enable_opencsg_opengl1x"] = true; // Toolbar QActionGroup *group = new QActionGroup(this); |