mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-02-07 15:08:24 +00:00
fix(src/main): fix font size on mac os
This commit is contained in:
parent
2a77b298c6
commit
e8804d608a
2 changed files with 15 additions and 6 deletions
|
|
@ -206,9 +206,9 @@ void App::parseArgs () {
|
|||
mParser.addVersionOption();
|
||||
mParser.addOptions({
|
||||
{ "config", tr("commandLineOptionConfig"), tr("commandLineOptionConfigArg") },
|
||||
#ifndef __APPLE__
|
||||
#ifndef Q_OS_MACOS
|
||||
{ "iconified", tr("commandLineOptionIconified") },
|
||||
#endif // ifndef __APPLE__
|
||||
#endif // ifndef Q_OS_MACOS
|
||||
{ "self-test", tr("commandLineOptionSelfTest") },
|
||||
{ { "V", "verbose" }, tr("commandLineOptionVerbose") },
|
||||
{ { "c", "cmd" }, tr("commandLineOptionCmd"), tr("commandLineOptionCmdArg") }
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include <QDirIterator>
|
||||
#include <QFontDatabase>
|
||||
#include <QScreen>
|
||||
|
||||
#include "app/App.hpp"
|
||||
|
||||
|
|
@ -40,11 +41,11 @@ int main (int argc, char *argv[]) {
|
|||
// ---------------------------------------------------------------------------
|
||||
|
||||
// Options to get a nice video render.
|
||||
#ifdef _WIN32
|
||||
#ifdef Q_OS_WIN
|
||||
QCoreApplication::setAttribute(Qt::AA_UseOpenGLES, true);
|
||||
#else
|
||||
QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL, true);
|
||||
#endif // ifdef _WIN32
|
||||
#endif // ifdef Q_OS_WIN
|
||||
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
|
||||
|
||||
{
|
||||
|
|
@ -92,8 +93,16 @@ int main (int argc, char *argv[]) {
|
|||
}
|
||||
}
|
||||
|
||||
app.setFont(QFont(DEFAULT_FONT));
|
||||
qInfo() << QStringLiteral("Main font:") << app.font();
|
||||
{
|
||||
QFont font(DEFAULT_FONT);
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
// 72 dpi on MacOs...
|
||||
font.setPointSizeF(font.pointSize() * 96.0 / 72.0);
|
||||
#endif // ifdef Q_OS_MACOS
|
||||
|
||||
app.setFont(QFont(DEFAULT_FONT));
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Init and run!
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue