Commit e8cc6d25 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Elide timeline markers instead of hiding them on lower zoom.

Related to #760
parent c0959b53
...@@ -365,10 +365,17 @@ Rectangle { ...@@ -365,10 +365,17 @@ Rectangle {
onClicked: proxy.position = (clipRoot.x + markerBase.x) / timeline.scaleFactor onClicked: proxy.position = (clipRoot.x + markerBase.x) / timeline.scaleFactor
} }
} }
TextMetrics {
id: textMetrics
font: miniFont
text: model.comment
elide: root.timeScale > 1 ? Text.ElideNone : Text.ElideRight
elideWidth: root.maxLabelWidth
}
Text { Text {
id: mlabel id: mlabel
visible: timeline.showMarkers && parent.width > width * 1.5 visible: timeline.showMarkers && textMetrics.elideWidth > root.baseUnit
text: model.comment text: textMetrics.elidedText
font: miniFont font: miniFont
x: markerBase.x x: markerBase.x
anchors { anchors {
......
...@@ -305,6 +305,7 @@ Rectangle { ...@@ -305,6 +305,7 @@ Rectangle {
property int scrollMax: scrollMin + scrollView.contentItem.width / timeline.scaleFactor property int scrollMax: scrollMin + scrollView.contentItem.width / timeline.scaleFactor
property double dar: 16/9 property double dar: 16/9
property bool paletteUnchanged: true property bool paletteUnchanged: true
property int maxLabelWidth: 20 * root.baseUnit * Math.sqrt(root.timeScale)
onSeekingFinishedChanged : { onSeekingFinishedChanged : {
playhead.opacity = seekingFinished ? 1 : 0.5 playhead.opacity = seekingFinished ? 1 : 0.5
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment