mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 11:45:53 +01:00
GUI polishing
This commit is contained in:
parent
7cfc05c101
commit
1e6925da75
19
src/gui.cpp
19
src/gui.cpp
@ -81,6 +81,7 @@ GUI::GUI(QWidget *parent) : QMainWindow(parent)
|
||||
|
||||
updateGraphTabs();
|
||||
updateTrackView();
|
||||
updateStatusBarInfo();
|
||||
|
||||
readSettings();
|
||||
|
||||
@ -468,8 +469,6 @@ void GUI::createStatusBar()
|
||||
statusBar()->addPermanentWidget(_distanceLabel, 1);
|
||||
statusBar()->addPermanentWidget(_timeLabel, 1);
|
||||
statusBar()->setSizeGripEnabled(false);
|
||||
|
||||
updateStatusBarInfo();
|
||||
}
|
||||
|
||||
void GUI::about()
|
||||
@ -907,19 +906,25 @@ void GUI::clearMapCache()
|
||||
|
||||
void GUI::updateStatusBarInfo()
|
||||
{
|
||||
if (_files.count() == 0) {
|
||||
if (_files.count() == 0)
|
||||
_fileNameLabel->setText(tr("No GPX files loaded"));
|
||||
_distanceLabel->clear();
|
||||
_timeLabel->clear();
|
||||
return;
|
||||
} else if (_files.count() == 1)
|
||||
else if (_files.count() == 1)
|
||||
_fileNameLabel->setText(_files.at(0));
|
||||
else
|
||||
_fileNameLabel->setText(tr("%1 files").arg(_files.count()));
|
||||
|
||||
qreal d = distance();
|
||||
Units units = _imperialUnitsAction->isChecked() ? Imperial : Metric;
|
||||
if (d > 0)
|
||||
_distanceLabel->setText(::distance(distance(), units));
|
||||
else
|
||||
_distanceLabel->clear();
|
||||
|
||||
qreal t = time();
|
||||
if (t > 0)
|
||||
_timeLabel->setText(::timeSpan(time()));
|
||||
else
|
||||
_timeLabel->clear();
|
||||
}
|
||||
|
||||
void GUI::updateWindowTitle()
|
||||
|
Loading…
Reference in New Issue
Block a user