diff options
| author | Marius Kintel <marius@kintel.net> | 2012-01-05 14:53:35 (GMT) | 
|---|---|---|
| committer | Marius Kintel <marius@kintel.net> | 2012-01-05 14:53:35 (GMT) | 
| commit | 56692369cea8cb2339fc657deb7e5e039622c528 (patch) | |
| tree | 879e0ce6f75d7e89c1df18070c9723e09e19a9d0 | |
| parent | e2684d692bf6784695b1edc01f7d252c515f771e (diff) | |
| parent | a7bb2229dc4a36b272fc60bb8244c125efef0032 (diff) | |
Merge pull request #58 from openscad/monofont2
Use Qt's fontfind algorithm for default, so that QFontComboBox works pro...
| -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); | 
