changeset 968:728343b94622 osx-retina

Merge from default branch
author Chris Cannam
date Thu, 14 May 2015 15:39:47 +0100
parents c9d87032f3da (diff) 5f2c90f7d225 (current diff)
children 80c5d98399ec
files .hgsubstate
diffstat 3 files changed, 30 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsubstate	Thu May 14 14:57:42 2015 +0100
+++ b/.hgsubstate	Thu May 14 15:39:47 2015 +0100
@@ -2,4 +2,4 @@
 55ece8862b6d3a54aad271a53f9c1615e5d3bcf8 sv-dependency-builds
 dc1a360f2b694d73d4bc858b708db44249e2cddc svapp
 f4ad0bfceeb7cc40ab00ecc97883ac02d123a6fd svcore
-b12cd1c2dad5f82d8185869fd12ced10f4dc1c76 svgui
+fa96108d552d4edc2319b9c0fa748afceb970569 svgui
--- a/main/PreferencesDialog.cpp	Thu May 14 14:57:42 2015 +0100
+++ b/main/PreferencesDialog.cpp	Thu May 14 15:39:47 2015 +0100
@@ -223,6 +223,15 @@
 
     settings.beginGroup("Preferences");
 
+#ifdef Q_OS_MAC
+    m_retina = settings.value("scaledHiDpi", true).toBool();
+    QCheckBox *retina = new QCheckBox;
+    retina->setCheckState(m_retina ? Qt::Checked : Qt::Unchecked);
+    connect(retina, SIGNAL(stateChanged(int)), this, SLOT(retinaChanged(int)));
+#else
+    m_retina = false;
+#endif
+
     QString userLocale = settings.value("locale", "").toString();
     m_currentLocale = userLocale;
     
@@ -353,6 +362,13 @@
                        row, 0);
     subgrid->addWidget(showSplash, row++, 1, 1, 1);
 
+#ifdef Q_OS_MAC
+    if (devicePixelRatio() > 1) {
+        subgrid->addWidget(new QLabel(tr("Draw layers at Retina resolution:")), row, 0);
+        subgrid->addWidget(retina, row++, 1, 1, 1);
+    }
+#endif
+
     subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
                                                 ("Property Box Layout"))),
                        row, 0);
@@ -564,6 +580,14 @@
 }
 
 void
+PreferencesDialog::retinaChanged(int state)
+{
+    m_retina = (state == Qt::Checked);
+    m_applyButton->setEnabled(true);
+    // Does not require a restart
+}
+
+void
 PreferencesDialog::showSplashChanged(int state)
 {
     m_showSplash = (state == Qt::Checked);
@@ -680,6 +704,9 @@
     settings.setValue(permishTag, m_networkPermission);
     settings.setValue("audio-target", devices[m_audioDevice]);
     settings.setValue("locale", m_currentLocale);
+#ifdef Q_OS_MAC
+    settings.setValue("scaledHiDpi", m_retina);
+#endif
     settings.endGroup();
 
     settings.beginGroup("MainWindow");
--- a/main/PreferencesDialog.h	Thu May 14 14:57:42 2015 +0100
+++ b/main/PreferencesDialog.h	Thu May 14 15:39:47 2015 +0100
@@ -64,6 +64,7 @@
     void defaultTemplateChanged(int);
     void localeChanged(int);
     void networkPermissionChanged(int state);
+    void retinaChanged(int state);
 
     void tempDirButtonClicked();
 
@@ -95,6 +96,7 @@
     int m_resampleQuality;
     bool m_resampleOnLoad;
     bool m_networkPermission;
+    bool m_retina;
     QString m_tempDirRoot;
     int m_backgroundMode;
     int m_timeToTextMode;