summaryrefslogtreecommitdiffstats
path: root/qt-ui/modeldelegates.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-15 10:37:25 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-15 10:37:25 -0700
commita5b378bdf4fef6285e2048ab974f8cff31397cbd (patch)
tree0238b90b859ee2f394150220938559cca86263ac /qt-ui/modeldelegates.cpp
parent14016f83ff992d3645e5bd8a9378380837823128 (diff)
downloadsubsurface-a5b378bdf4fef6285e2048ab974f8cff31397cbd.tar.gz
Better text for dive site completions
Also make the explanation text slightly smaller. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/modeldelegates.cpp')
-rw-r--r--qt-ui/modeldelegates.cpp10
1 files changed, 10 insertions, 0 deletions
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);