diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2022-05-16 08:03:56 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2022-05-16 08:17:45 +0000 |
commit | 86708dbddea29ee9bc4ae2d0a1f174cffbf92793 (patch) | |
tree | 05c80668df5565c12c187a75c1228795cef6fe84 /src/libs/utils/proxyaction.cpp | |
parent | 92c93c388a9a29ffa50c946a123a8a5a13f3f011 (diff) |
Improve various HTML-based tooltips
A couple of tooltips in Qt Creator, contain rich text (HTML). These
tooltips tend to have line breaks in unfavorable places, making the
content sometimes hard to read.
This is fixed in this change by using: style="white-space:pre"
Another issue with some tooltips is that they show key/value definitions
in a <table>, which, especially with longer keys makes looking up the
value quite hard. Also the length of the key column is dependent on the
(translated) content.
This change implements an alternative: using "description lists" <dl>,
which indent the values nicely independent from the key length.
Fixes: QTCREATORBUG-27553
Change-Id: If047627193413f23d868c52f005f22aa9a0752a9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/libs/utils/proxyaction.cpp')
-rw-r--r-- | src/libs/utils/proxyaction.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libs/utils/proxyaction.cpp b/src/libs/utils/proxyaction.cpp index d8d9cf86971..b0360f5c355 100644 --- a/src/libs/utils/proxyaction.cpp +++ b/src/libs/utils/proxyaction.cpp @@ -173,7 +173,8 @@ void ProxyAction::updateToolTipWithKeySequence() QString ProxyAction::stringWithAppendedShortcut(const QString &str, const QKeySequence &shortcut) { const QString s = stripAccelerator(str); - return QString::fromLatin1("%1 <span style=\"color: gray; font-size: small\">%2</span>") + return QString::fromLatin1("<div style=\"white-space:pre\">%1 " + "<span style=\"color: gray; font-size: small\">%2</span></div>") .arg(s, shortcut.toString(QKeySequence::NativeText)); } |