From 9550339a2a80a021c03cd63e8731a606a1a5168e Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Wed, 18 Feb 2015 13:34:01 -0800 Subject: [PATCH] Move preferences dialog font scaling to UIUtil --- interface/src/ui/PreferencesDialog.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 56a6e33bc2..29035dacd1 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -24,23 +24,10 @@ #include "PreferencesDialog.h" #include "Snapshot.h" #include "UserActivityLogger.h" +#include "UIUtil.h" const int PREFERENCES_HEIGHT_PADDING = 20; -void scaleWidgetFontSizes(QWidget* widget, float scale) { - for (auto child : widget->findChildren()) { - if (child->parent() == widget) { - scaleWidgetFontSizes(child, scale); - } - } - QFont font = widget->font(); - qDebug() << "Pref: " << widget->objectName() << ": " << font.pointSizeF(); - if (font != QFont()) { - font.setPointSizeF(font.pointSizeF() * scale); - widget->setFont(font); - } -} - PreferencesDialog::PreferencesDialog(QWidget* parent) : QDialog(parent) { @@ -67,7 +54,7 @@ PreferencesDialog::PreferencesDialog(QWidget* parent) : // All font sizes are based on 72 DPI. float dpiScale = 72.0f / glCanvas->logicalDpiX(); - scaleWidgetFontSizes(this, dpiScale); + UIUtil::scaleWidgetFontSizes(this); }