Skip to content
Permalink
Browse files

Tweak GPS distance status bar message to work better on smaller screens

  • Loading branch information
nyalldawson committed Feb 5, 2020
1 parent dcd1447 commit 438f0fad392a40a531eb9592416b5ee9735e9a31
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/app/gps/qgsgpsinformationwidget.cpp
@@ -1513,12 +1513,12 @@ void QgsGpsInformationWidget::updateGpsDistanceStatusMessage()

const double distance = mDistanceCalculator.convertLengthMeasurement( mDistanceCalculator.measureLine( QVector< QgsPointXY >() << mLastCursorPosWgs84 << mLastGpsPosition ),
QgsProject::instance()->distanceUnits() );
const double bearing = 180 * mDistanceCalculator.bearing( mLastCursorPosWgs84, mLastGpsPosition ) / M_PI;
const double bearing = 180 * mDistanceCalculator.bearing( mLastGpsPosition, mLastCursorPosWgs84 ) / M_PI;
const int distanceDecimalPlaces = QgsSettings().value( QStringLiteral( "qgis/measure/decimalplaces" ), "3" ).toInt();
const QString distanceString = QgsDistanceArea::formatDistance( distance, distanceDecimalPlaces, QgsProject::instance()->distanceUnits() );
const QString bearingString = mBearingNumericFormat->formatDouble( bearing, QgsNumericFormatContext() );

QgisApp::instance()->statusBarIface()->showMessage( tr( "Distance to GPS location %1 (%2)" ).arg( distanceString, bearingString ), 2000 );
QgisApp::instance()->statusBarIface()->showMessage( tr( "%1 (%2) from GPS location" ).arg( distanceString, bearingString ), 2000 );
}

void QgsGpsInformationWidget::updateTimestampDestinationFields( QgsMapLayer *mapLayer )

0 comments on commit 438f0fa

Please sign in to comment.
You can’t perform that action at this time.