From cdc4659165008995bc60d6ac6fabe482928b8aef Mon Sep 17 00:00:00 2001
From: Maik Qualmann
Date: Wed, 17 Jan 2018 19:09:06 +0100
Subject: fix font size in the tooltips BUGS: 337243 FIXED-IN: 5.9.0
---
NEWS | 3 ++-
libs/widgets/itemview/ditemtooltip.cpp | 41 ++++++++++++++++++++++------------
2 files changed, 29 insertions(+), 15 deletions(-)
diff --git a/core/libs/widgets/itemview/ditemtooltip.cpp b/core/libs/widgets/itemview/ditemtooltip.cpp
index c375c53..ab932a7 100644
--- a/core/libs/widgets/itemview/ditemtooltip.cpp
+++ b/core/libs/widgets/itemview/ditemtooltip.cpp
@@ -52,33 +52,46 @@ namespace Digikam
DToolTipStyleSheet::DToolTipStyleSheet(const QFont& font)
: maxStringLength(30)
{
- unavailable = i18n("unavailable");
+ unavailable = i18n("unavailable");
+
+ QString fontSize = (font.pointSize() == -1) ? QString::fromUtf8("font-size: %1px;").arg(font.pixelSize())
+ : QString::fromUtf8("font-size: %1pt;").arg(font.pointSize());
tipHeader = QLatin1String("");
tipFooter = QLatin1String("
");
headBeg = QString::fromLatin1(""
- "")
+ "")
.arg(qApp->palette().color(QPalette::Base).name())
.arg(qApp->palette().color(QPalette::Text).name())
- .arg(font.family());
- headEnd = QLatin1String(" |
");
+ .arg(font.family())
+ .arg(fontSize);
+
+ headEnd = QLatin1String("
");
- cellBeg = QString::fromLatin1("")
+ cellBeg = QString::fromLatin1("")
.arg(qApp->palette().color(QPalette::ToolTipText).name())
- .arg(font.family());
- cellMid = QString::fromLatin1(" | ")
+ .arg(font.family())
+ .arg(fontSize);
+
+ cellMid = QString::fromLatin1(" | ")
.arg(qApp->palette().color(QPalette::ToolTipText).name())
- .arg(font.family());
- cellEnd = QLatin1String(" | ");
+ .arg(font.family())
+ .arg(fontSize);
- cellSpecBeg = QString::fromLatin1("")
+ cellEnd = QLatin1String(" | ");
+
+ cellSpecBeg = QString::fromLatin1("")
.arg(qApp->palette().color(QPalette::ToolTipText).name())
- .arg(font.family());
- cellSpecMid = QString::fromLatin1(" | ")
+ .arg(font.family())
+ .arg(fontSize);
+
+ cellSpecMid = QString::fromLatin1(" | ")
.arg(qApp->palette().color(QPalette::ToolTipText).name())
- .arg(font.family());
- cellSpecEnd = QLatin1String(" | ");
+ .arg(font.family())
+ .arg(fontSize);
+
+ cellSpecEnd = QLatin1String(" |
");
}
QString DToolTipStyleSheet::breakString(const QString& input) const
--
cgit v0.11.2