summaryrefslogtreecommitdiffstats
path: root/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/Ruler.h
diff options
context:
space:
mode:
authorMahmoud Badri <mahmoud.badri@qt.io>2019-08-30 10:38:06 +0300
committerMahmoud Badri <mahmoud.badri@qt.io>2019-09-02 10:45:49 +0300
commit747f520cc2e16a97d38c3caf28ecb1880ae1aa4c (patch)
tree67ef832b1557e1999fc2e79590bf8ab0189c1d0c /src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/Ruler.h
parentcd88fefac16b842d938f154d574330fcc0ed2432 (diff)
Timeline ruler and scaling enhancements
- Make timeline scaling smoother and allow further scale values. - Implement non linear scaling strategy which improve UX. - Double clicking the scale head resets the scale to the default value - Optimize drawing by only drawing the visible part of the ruler. - Other assorted small tweaks Change-Id: I5fbf729f3b5e098a60e26978af6bc82bb5f307ae Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/Ruler.h')
-rw-r--r--src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/Ruler.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/Ruler.h b/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/Ruler.h
index 005a23c3..355d3447 100644
--- a/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/Ruler.h
+++ b/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/Ruler.h
@@ -41,7 +41,7 @@ signals:
public:
explicit Ruler(TimelineItem *parent = nullptr);
- void setTimelineScale(double scl);
+ void setTimelineScale(int scl);
long distanceToTime(double distance) const;
double timeToDistance(long time) const;
double timelineScale() const;
@@ -59,12 +59,12 @@ protected:
signals:
void maxDurationChanged(long maxDuration);
- void durationChanged(long duration);
void viewportXChanged(int viewportX);
private:
- const QString timestampString(int timeMs);
- double m_timeScale = 2;
+ const QString formatTime(double seconds);
+
+ double m_timeScale = 1.;
long m_duration = 0; // milliseconds
long m_maxDuration = 0; // milliseconds
int m_viewportX = 0;