From 16da225273d64f3aa9e8abf9e93949759fb31fad Mon Sep 17 00:00:00 2001
From: Gennady Pospelov <g.pospelov@fz-juelich.de>
Date: Mon, 8 Jun 2020 16:39:44 +0200
Subject: [PATCH] More reasonable font size for overlay label

---
 GUI/coregui/Views/InfoWidgets/OverlayLabelWidget.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/GUI/coregui/Views/InfoWidgets/OverlayLabelWidget.cpp b/GUI/coregui/Views/InfoWidgets/OverlayLabelWidget.cpp
index dec362b10b8..5f2ad739741 100644
--- a/GUI/coregui/Views/InfoWidgets/OverlayLabelWidget.cpp
+++ b/GUI/coregui/Views/InfoWidgets/OverlayLabelWidget.cpp
@@ -14,6 +14,7 @@
 
 #include "OverlayLabelWidget.h"
 #include "DesignerHelper.h"
+#include "StyleUtils.h"
 #include <QColor>
 #include <QFont>
 #include <QPainter>
@@ -39,8 +40,10 @@ void OverlayLabelWidget::paintEvent(QPaintEvent* event)
     Q_UNUSED(event);
     QPainter painter(this);
     painter.setBrush(QColor(Qt::lightGray));
-    QFont serifFont("Monospace", DesignerHelper::getHeaderFontSize(), QFont::Normal, true);
+    QFont serifFont("Monospace", DesignerHelper::getSectionFontSize(), QFont::Normal, true);
     painter.setFont(serifFont);
     //    painter.drawRect(m_bounding_rect);
-    painter.drawText(m_bounding_rect, Qt::AlignCenter, m_text);
+    auto margin = StyleUtils::SizeOfLetterM().width();
+    painter.drawText(m_bounding_rect.marginsRemoved(QMargins(margin, margin, margin, margin)),
+                     Qt::AlignCenter, m_text);
 }
-- 
GitLab