# HG changeset patch
# User Chris Cannam
# Date 1582035225 0
# Node ID cf0f2f566c0cf53fe139197c0a37ab3068485578
# Parent d55684dff3621e4229dc063071af3554ea40c506
Mac layout tweaks
diff -r d55684dff362 -r cf0f2f566c0c installer.cpp
--- a/installer.cpp Tue Feb 18 13:41:38 2020 +0000
+++ b/installer.cpp Tue Feb 18 14:13:45 2020 +0000
@@ -641,9 +641,10 @@
}
int fontHeight = QFontMetrics(checkArrow->font()).height();
+ int dpratio = dialog.devicePixelRatio();
- QPixmap infoMap(fontHeight, fontHeight);
- QPixmap moreMap(fontHeight * 2, fontHeight * 2);
+ QPixmap infoMap(fontHeight * dpratio, fontHeight * dpratio);
+ QPixmap moreMap(fontHeight * dpratio * 2, fontHeight * dpratio * 2);
infoMap.fill(Qt::transparent);
moreMap.fill(Qt::transparent);
QSvgRenderer renderer(QString(":icons/scalable/info.svg"));
@@ -680,35 +681,46 @@
expand->setAutoRaise(true);
expand->setIcon(infoMap);
expand->setIconSize(QSize(fontHeight, fontHeight));
+
+#ifdef Q_OS_MAC
+ expand->setFixedSize(QSize(int(fontHeight * 1.2),
+ int(fontHeight * 1.2)));
+ expand->setStyleSheet("QToolButton { border: none; }");
+#endif
+
selectionLayout->addWidget(expand, selectionRow, 3);
++selectionRow;
- QString text = QObject::tr("%1
%2
%3
Library contains:
")
+ QString moreTitleText = QObject::tr("%1
%2")
.arg(info.title)
- .arg(info.maker)
+ .arg(info.maker);
+
+ QString moreInfoText = QObject::tr("%1
Library contains:")
.arg(info.description);
int n = 0;
bool closed = false;
for (auto title: info.pluginTitles) {
if (n == 10 && info.pluginTitles.size() > 15) {
- text += QObject::tr("
");
- text += QObject::tr("... and %n other plugins.
", "",
- info.pluginTitles.size() - n);
+ moreInfoText += QObject::tr("
");
+ moreInfoText += QObject::tr("... and %n other plugins.
",
+ "",
+ info.pluginTitles.size() - n);
closed = true;
break;
}
- text += QObject::tr("%1").arg(title);
+ moreInfoText += QObject::tr("%1").arg(title);
++n;
}
if (!closed) {
- text += QObject::tr("");
+ moreInfoText += QObject::tr("");
}
if (info.licence != "") {
- text += QObject::tr("Provided under the %1.
").arg(info.licence);
+ moreInfoText += QObject::tr("Provided under the %1.
")
+ .arg(info.licence);
}
QObject::connect(expand, &QAbstractButton::clicked,
@@ -716,7 +728,8 @@
QMessageBox mbox;
mbox.setIconPixmap(moreMap);
mbox.setWindowTitle(QObject::tr("Library contents"));
- mbox.setText(text);
+ mbox.setText(moreTitleText);
+ mbox.setInformativeText(moreInfoText);
mbox.exec();
});
@@ -812,6 +825,8 @@
QApplication::setOrganizationDomain("sonicvisualiser.org");
QApplication::setApplicationName(QApplication::tr("Vamp Plugin Pack Installer"));
+ QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
+
#ifdef Q_OS_WIN32
QFont font(QApplication::font());
QString preferredFamily = "Segoe UI";
@@ -820,6 +835,15 @@
font.setPointSize(10);
QApplication::setFont(font);
}
+#else
+#ifdef Q_OS_MAC
+ QFont font(QApplication::font());
+ QString preferredFamily = "Lucida Grande";
+ font.setFamily(preferredFamily);
+ if (QFontInfo(font).family() == preferredFamily) {
+ QApplication::setFont(font);
+ }
+#endif
#endif
QString target = getDefaultInstallDirectory();