From a5b378bdf4fef6285e2048ab974f8cff31397cbd Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 15 Jul 2015 10:37:25 -0700 Subject: Better text for dive site completions Also make the explanation text slightly smaller. Signed-off-by: Dirk Hohndel --- qt-ui/modeldelegates.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'qt-ui') diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp index 8e296d412..4a54eebf0 100644 --- a/qt-ui/modeldelegates.cpp +++ b/qt-ui/modeldelegates.cpp @@ -550,6 +550,14 @@ void LocationFilterDelegate::paint(QPainter *painter, const QStyleOptionViewItem bottomText += tr(" (~ %1 away)").arg(distance); } } + if (bottomText.isEmpty()) { + if (dive_site_has_gps_location(&displayed_dive_site)) + bottomText = tr("(no existing GPS data, add GPS fix from this dive)"); + else + bottomText = tr("(no GPS data)"); + } + bottomText = tr("Pick site: ") + bottomText; + print_part: fontBigger.setPointSize(fontBigger.pointSize() + 1); @@ -571,6 +579,8 @@ print_part: painter->setBrush(option.palette.text()); painter->setFont(fontBigger); painter->drawText(option.rect.x(),option.rect.y() + fmBigger.boundingRect("YH").height(), diveSiteName); + double pointSize = fontSmaller.pointSizeF(); + fontSmaller.setPointSizeF(0.9 * pointSize); painter->setFont(fontSmaller); painter->setBrush(option.palette.brightText()); painter->drawText(option.rect.x(),option.rect.y() + fmBigger.boundingRect("YH").height() * 2, bottomText); -- cgit v1.2.3-70-g09d2