mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-18 03:42:09 +01:00
Fixed graph slider handling issue
This commit is contained in:
parent
1957a51570
commit
799079392c
29
src/gui.cpp
29
src/gui.cpp
@ -1013,7 +1013,6 @@ void GUI::poiFileChecked(int index)
|
||||
void GUI::sliderPositionChanged(qreal pos)
|
||||
{
|
||||
_sliderPos = pos;
|
||||
//_track->movePositionMarker(_sliderPos);
|
||||
}
|
||||
|
||||
void GUI::graphChanged(int index)
|
||||
@ -1077,32 +1076,22 @@ void GUI::updateTrackView()
|
||||
+ _track->waypointCount()));
|
||||
}
|
||||
|
||||
void GUI::setMetricUnits()
|
||||
void GUI::setUnits(Units units)
|
||||
{
|
||||
_track->setUnits(Metric);
|
||||
_track->setUnits(units);
|
||||
for (int i = 0; i <_tabs.count(); i++)
|
||||
_tabs.at(i)->setUnits(Metric);
|
||||
_tabs.at(i)->setUnits(units);
|
||||
updateStatusBarInfo();
|
||||
}
|
||||
|
||||
void GUI::setImperialUnits()
|
||||
void GUI::setGraphType(GraphType type)
|
||||
{
|
||||
_track->setUnits(Imperial);
|
||||
for (int i = 0; i <_tabs.count(); i++)
|
||||
_tabs.at(i)->setUnits(Imperial);
|
||||
updateStatusBarInfo();
|
||||
}
|
||||
_sliderPos = 0;
|
||||
|
||||
void GUI::setDistanceGraph()
|
||||
{
|
||||
for (int i = 0; i <_tabs.count(); i++)
|
||||
_tabs.at(i)->setGraphType(Distance);
|
||||
}
|
||||
|
||||
void GUI::setTimeGraph()
|
||||
{
|
||||
for (int i = 0; i <_tabs.count(); i++)
|
||||
_tabs.at(i)->setGraphType(Time);
|
||||
for (int i = 0; i <_tabs.count(); i++) {
|
||||
_tabs.at(i)->setGraphType(type);
|
||||
_tabs.at(i)->setSliderPosition(0);
|
||||
}
|
||||
}
|
||||
|
||||
void GUI::next()
|
||||
|
17
src/gui.h
17
src/gui.h
@ -6,6 +6,8 @@
|
||||
#include <QList>
|
||||
#include <QDate>
|
||||
#include <QPrinter>
|
||||
#include "units.h"
|
||||
#include "graph.h"
|
||||
#include "poi.h"
|
||||
#include "margins.h"
|
||||
|
||||
@ -63,10 +65,10 @@ private slots:
|
||||
void last();
|
||||
void first();
|
||||
|
||||
void setMetricUnits();
|
||||
void setImperialUnits();
|
||||
void setDistanceGraph();
|
||||
void setTimeGraph();
|
||||
void setMetricUnits() {setUnits(Metric);}
|
||||
void setImperialUnits() {setUnits(Imperial);}
|
||||
void setDistanceGraph() {setGraphType(Distance);}
|
||||
void setTimeGraph() {setGraphType(Time);}
|
||||
|
||||
void sliderPositionChanged(qreal pos);
|
||||
|
||||
@ -97,8 +99,8 @@ private:
|
||||
void updateGraphTabs();
|
||||
void updateTrackView();
|
||||
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
void closeEvent(QCloseEvent *event);
|
||||
void setUnits(Units units);
|
||||
void setGraphType(GraphType type);
|
||||
|
||||
qreal distance();
|
||||
qreal time();
|
||||
@ -106,6 +108,9 @@ private:
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
||||
QToolBar *_fileToolBar;
|
||||
QToolBar *_showToolBar;
|
||||
QToolBar *_navigationToolBar;
|
||||
|
Loading…
x
Reference in New Issue
Block a user