From e5e3485905d236a5ac20373c6af005a88a1fd1a3 Mon Sep 17 00:00:00 2001 From: Gennady Pospelov <g.pospelov@fz-juelich.de> Date: Mon, 8 Jun 2020 12:52:15 +0200 Subject: [PATCH] Make StatusLabel beneath intensity map high DPI aware. --- GUI/coregui/Views/CommonWidgets/StatusLabel.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/GUI/coregui/Views/CommonWidgets/StatusLabel.cpp b/GUI/coregui/Views/CommonWidgets/StatusLabel.cpp index 6671b28badf..cf4ac60993a 100644 --- a/GUI/coregui/Views/CommonWidgets/StatusLabel.cpp +++ b/GUI/coregui/Views/CommonWidgets/StatusLabel.cpp @@ -16,18 +16,24 @@ #include <QColor> #include <QFont> #include <QPainter> +#include "StyleUtils.h" namespace { -const int default_label_height = 20; -const int default_text_size = 11; +int default_text_size() { + return StyleUtils::SystemPointSize(); +} +int default_label_height() +{ + return StyleUtils::SizeOfLetterM().height()*1.75; +} } // namespace StatusLabel::StatusLabel(QWidget* parent) - : QFrame(parent), m_font("Monospace", default_text_size, QFont::Normal, false) + : QFrame(parent), m_font("Monospace", default_text_size(), QFont::Normal, false) { setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - setFixedHeight(default_label_height); + setFixedHeight(default_label_height()); } void StatusLabel::setText(const QString& text) -- GitLab