瀏覽代碼

Preliminary fix for reports on HiDPI screens

Neal Wilson 7 年之前
父節點
當前提交
686151899c
簽署人: Neal Wilson <neal@typica.us> GPG 金鑰 ID: 2A0BDDE701E66EB9
共有 1 個檔案被更改,包括 6 行新增0 行删除
  1. 6
    0
      src/webview.w

+ 6
- 0
src/webview.w 查看文件

21
 #include <QWebFrame>
21
 #include <QWebFrame>
22
 #include <QWebElement>
22
 #include <QWebElement>
23
 #include <QSettings>
23
 #include <QSettings>
24
+#include <QDesktopWidget>
25
+#include <QApplication>
24
 
26
 
25
 #ifndef TypicaWebViewHeader
27
 #ifndef TypicaWebViewHeader
26
 #define TypicaWebViewHeader
28
 #define TypicaWebViewHeader
59
 {
61
 {
60
 	page()->setLinkDelegationPolicy(QWebPage::DelegateExternalLinks);
62
 	page()->setLinkDelegationPolicy(QWebPage::DelegateExternalLinks);
61
 	connect(page(), SIGNAL(linkClicked(QUrl)), this, SLOT(linkDelegate(QUrl)));
63
 	connect(page(), SIGNAL(linkClicked(QUrl)), this, SLOT(linkDelegate(QUrl)));
64
+	
65
+    QDesktopWidget *desktop = QApplication::desktop();
66
+    const int dpi = desktop->logicalDpiX();
67
+    setZoomFactor(dpi/96);
62
 }
68
 }
63
 
69
 
64
 @ When a link is clicked, one of three things may happen. Certain reserved URLs
70
 @ When a link is clicked, one of three things may happen. Certain reserved URLs

Loading…
取消
儲存