1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 11:45:53 +01:00

GUI polishing

This commit is contained in:
Martin Tůma 2016-08-10 21:17:12 +02:00
parent 7cfc05c101
commit 1e6925da75

View File

@ -81,6 +81,7 @@ GUI::GUI(QWidget *parent) : QMainWindow(parent)
updateGraphTabs(); updateGraphTabs();
updateTrackView(); updateTrackView();
updateStatusBarInfo();
readSettings(); readSettings();
@ -468,8 +469,6 @@ void GUI::createStatusBar()
statusBar()->addPermanentWidget(_distanceLabel, 1); statusBar()->addPermanentWidget(_distanceLabel, 1);
statusBar()->addPermanentWidget(_timeLabel, 1); statusBar()->addPermanentWidget(_timeLabel, 1);
statusBar()->setSizeGripEnabled(false); statusBar()->setSizeGripEnabled(false);
updateStatusBarInfo();
} }
void GUI::about() void GUI::about()
@ -907,19 +906,25 @@ void GUI::clearMapCache()
void GUI::updateStatusBarInfo() void GUI::updateStatusBarInfo()
{ {
if (_files.count() == 0) { if (_files.count() == 0)
_fileNameLabel->setText(tr("No GPX files loaded")); _fileNameLabel->setText(tr("No GPX files loaded"));
_distanceLabel->clear(); else if (_files.count() == 1)
_timeLabel->clear();
return;
} else if (_files.count() == 1)
_fileNameLabel->setText(_files.at(0)); _fileNameLabel->setText(_files.at(0));
else else
_fileNameLabel->setText(tr("%1 files").arg(_files.count())); _fileNameLabel->setText(tr("%1 files").arg(_files.count()));
qreal d = distance();
Units units = _imperialUnitsAction->isChecked() ? Imperial : Metric; Units units = _imperialUnitsAction->isChecked() ? Imperial : Metric;
if (d > 0)
_distanceLabel->setText(::distance(distance(), units)); _distanceLabel->setText(::distance(distance(), units));
else
_distanceLabel->clear();
qreal t = time();
if (t > 0)
_timeLabel->setText(::timeSpan(time())); _timeLabel->setText(::timeSpan(time()));
else
_timeLabel->clear();
} }
void GUI::updateWindowTitle() void GUI::updateWindowTitle()