Hi-DPI Support - OAuthDialog Scaling

.. the QWebView embedded in OAuthDialog needs to be zoomed
   so you can see the fonts.

.. the QT recomendation is to set the application wide
   scaling (!) to scale QWebEngine on hi-dpi screens obvs
   thats a really shit solution we ignore.
This commit is contained in:
Mark Liversedge
2017-04-08 21:19:32 +01:00
parent 4b67db6102
commit 6311117f9d

View File

@@ -22,6 +22,7 @@
#include "Athlete.h"
#include "Context.h"
#include "Settings.h"
#include "Colors.h"
#include "TimeUtils.h"
#if QT_VERSION > 0x050000
@@ -44,6 +45,9 @@ OAuthDialog::OAuthDialog(Context *context, OAuthSite site, CloudService *service
setAttribute(Qt::WA_DeleteOnClose);
setWindowTitle(tr("OAuth"));
// we need to scale up, since we zoom the webview on hi-dpi screens
setMinimumSize(640 *dpiXFactor, 640 *dpiYFactor);
if (service) { // ultimately this will be the only way this works
if (service->name() == "Strava") site = this->site = STRAVA;
if (service->name() == "Dropbox") site = this->site = DROPBOX;
@@ -74,6 +78,7 @@ OAuthDialog::OAuthDialog(Context *context, OAuthSite site, CloudService *service
#if defined(NOWEBKIT) || (QT_VERSION > 0x050000 && defined(Q_OS_MAC))
view = new QWebEngineView();
view->setZoomFactor(dpiXFactor);
#else
view = new QWebView();
#endif