1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-01-18 11:52:08 +01:00

Fixed graph slider handling issue

This commit is contained in:
Martin Tůma 2016-09-21 23:48:11 +02:00
parent 1957a51570
commit 799079392c
2 changed files with 20 additions and 26 deletions

View File

@ -1013,7 +1013,6 @@ void GUI::poiFileChecked(int index)
void GUI::sliderPositionChanged(qreal pos) void GUI::sliderPositionChanged(qreal pos)
{ {
_sliderPos = pos; _sliderPos = pos;
//_track->movePositionMarker(_sliderPos);
} }
void GUI::graphChanged(int index) void GUI::graphChanged(int index)
@ -1077,32 +1076,22 @@ void GUI::updateTrackView()
+ _track->waypointCount())); + _track->waypointCount()));
} }
void GUI::setMetricUnits() void GUI::setUnits(Units units)
{ {
_track->setUnits(Metric); _track->setUnits(units);
for (int i = 0; i <_tabs.count(); i++) for (int i = 0; i <_tabs.count(); i++)
_tabs.at(i)->setUnits(Metric); _tabs.at(i)->setUnits(units);
updateStatusBarInfo(); updateStatusBarInfo();
} }
void GUI::setImperialUnits() void GUI::setGraphType(GraphType type)
{ {
_track->setUnits(Imperial); _sliderPos = 0;
for (int i = 0; i <_tabs.count(); i++)
_tabs.at(i)->setUnits(Imperial);
updateStatusBarInfo();
}
void GUI::setDistanceGraph() for (int i = 0; i <_tabs.count(); i++) {
{ _tabs.at(i)->setGraphType(type);
for (int i = 0; i <_tabs.count(); i++) _tabs.at(i)->setSliderPosition(0);
_tabs.at(i)->setGraphType(Distance);
} }
void GUI::setTimeGraph()
{
for (int i = 0; i <_tabs.count(); i++)
_tabs.at(i)->setGraphType(Time);
} }
void GUI::next() void GUI::next()

View File

@ -6,6 +6,8 @@
#include <QList> #include <QList>
#include <QDate> #include <QDate>
#include <QPrinter> #include <QPrinter>
#include "units.h"
#include "graph.h"
#include "poi.h" #include "poi.h"
#include "margins.h" #include "margins.h"
@ -63,10 +65,10 @@ private slots:
void last(); void last();
void first(); void first();
void setMetricUnits(); void setMetricUnits() {setUnits(Metric);}
void setImperialUnits(); void setImperialUnits() {setUnits(Imperial);}
void setDistanceGraph(); void setDistanceGraph() {setGraphType(Distance);}
void setTimeGraph(); void setTimeGraph() {setGraphType(Time);}
void sliderPositionChanged(qreal pos); void sliderPositionChanged(qreal pos);
@ -97,8 +99,8 @@ private:
void updateGraphTabs(); void updateGraphTabs();
void updateTrackView(); void updateTrackView();
void keyPressEvent(QKeyEvent *event); void setUnits(Units units);
void closeEvent(QCloseEvent *event); void setGraphType(GraphType type);
qreal distance(); qreal distance();
qreal time(); qreal time();
@ -106,6 +108,9 @@ private:
void readSettings(); void readSettings();
void writeSettings(); void writeSettings();
void keyPressEvent(QKeyEvent *event);
void closeEvent(QCloseEvent *event);
QToolBar *_fileToolBar; QToolBar *_fileToolBar;
QToolBar *_showToolBar; QToolBar *_showToolBar;
QToolBar *_navigationToolBar; QToolBar *_navigationToolBar;