From 4a802befbbf59beb03f939c0a2c360e82b194b95 Mon Sep 17 00:00:00 2001 From: Chris Pollard Date: Mon, 28 Sep 2015 13:42:00 -0400 Subject: [PATCH] Made slight tweaks for high DPI displays --- src/Mod/Draft/DraftGui.py | 6 ++++-- src/Mod/Web/Gui/BrowserView.cpp | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Mod/Draft/DraftGui.py b/src/Mod/Draft/DraftGui.py index fa05878b9..bd08adb50 100644 --- a/src/Mod/Draft/DraftGui.py +++ b/src/Mod/Draft/DraftGui.py @@ -568,9 +568,11 @@ class DraftToolBar: self.facecolorPix = QtGui.QPixmap(16,16) self.facecolorPix.fill(self.facecolor) self.facecolorButton.setIcon(QtGui.QIcon(self.facecolorPix)) - self.widthButton = self._spinbox("widthButton", self.bottomtray, val=self.linewidth,hide=False,size=(50,22)) + p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/General") + bsize = p.GetInt("ToolbarIconSize",24)+2 + self.widthButton = self._spinbox("widthButton", self.bottomtray, val=self.linewidth,hide=False,size=(bsize * 2,bsize)) self.widthButton.setSuffix("px") - self.fontsizeButton = self._spinbox("fontsizeButton",self.bottomtray, val=self.fontsize,vmax=999, hide=False,double=True,size=(65,22)) + self.fontsizeButton = self._spinbox("fontsizeButton",self.bottomtray, val=self.fontsize,vmax=999, hide=False,double=True,size=(bsize * 3,bsize)) self.applyButton = self._pushbutton("applyButton", self.toptray, hide=False, icon='Draft_Apply',width=22) QtCore.QObject.connect(self.wplabel,QtCore.SIGNAL("pressed()"),self.selectplane) diff --git a/src/Mod/Web/Gui/BrowserView.cpp b/src/Mod/Web/Gui/BrowserView.cpp index 3d08d012c..19c15fc5c 100644 --- a/src/Mod/Web/Gui/BrowserView.cpp +++ b/src/Mod/Web/Gui/BrowserView.cpp @@ -49,6 +49,7 @@ # include # include # include +# include #endif #include "BrowserView.h" @@ -74,6 +75,11 @@ using namespace Gui; WebView::WebView(QWidget *parent) : QWebView(parent) { + // Increase html font size for high DPI displays + QRect mainScreenSize = QApplication::desktop()->screenGeometry(); + if(mainScreenSize.width() > 1920){ + setTextSizeMultiplier (mainScreenSize.width()/1920.0); + } } void WebView::wheelEvent(QWheelEvent *event)