From 3793fa09ff920fc720dfad3738f105d2c9563662 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 13 Apr 2012 17:10:50 +0200 Subject: Allow Qt to wrap long tooltips (fixes #1063) Implemented without having to touch any translation: by listening for QEvent::ToolTipChange events, then rewriting the tooltips to prefix `` if it is not yet rich text. --- src/qt/bitcoingui.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/qt/bitcoingui.cpp') diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index bcf90917ed..db0ddf453f 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -551,22 +551,25 @@ void BitcoinGUI::setNumBlocks(int count) // Set icon state: spinning if catching up, tick otherwise if(secs < 90*60 && count >= nTotalBlocks) { - tooltip = tr("Up to date") + QString(".\n") + tooltip; + tooltip = tr("Up to date") + QString(".
") + tooltip; labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE)); } else { - tooltip = tr("Catching up...") + QString("\n") + tooltip; + tooltip = tr("Catching up...") + QString("
") + tooltip; labelBlocksIcon->setMovie(syncIconMovie); syncIconMovie->start(); } if(!text.isEmpty()) { - tooltip += QString("\n"); + tooltip += QString("
"); tooltip += tr("Last received block was generated %1.").arg(text); } + // Don't word-wrap this (fixed-width) tooltip + tooltip = QString("") + tooltip + QString(""); + labelBlocksIcon->setToolTip(tooltip); progressBarLabel->setToolTip(tooltip); progressBar->setToolTip(tooltip); -- cgit v1.2.3