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

Show clip labels as soon as there is one letter width

Fixes #1339
parent 6aa79cbc
......@@ -67,7 +67,7 @@ Rectangle {
property color borderColor: "#000000"
property bool forceReloadThumb
property bool isComposition: false
property bool hideClipViews: scrollStart > (clipDuration * timeline.scaleFactor) || scrollStart + scrollView.width < 0 || clipRoot.width < 16
property bool hideClipViews: scrollStart > (clipDuration * timeline.scaleFactor) || scrollStart + scrollView.width < 0 || clipRoot.width < root.minClipWidthForViews
property int slipOffset: boundValue(outPoint - maxDuration + 1, trimmingOffset, inPoint)
property int scrollStart: scrollView.contentX - (clipRoot.modelStart * timeline.scaleFactor)
property int mouseXPos: mouseArea.mouseX
......@@ -847,7 +847,7 @@ Rectangle {
color: clipRoot.selected ? 'darkred' : '#66000000'
width: label.width + (2 * itemBorder.border.width)
height: label.height
visible: clipRoot.width > width / 2
visible: clipRoot.width > root.baseUnit
anchors.left: parent.left
anchors.leftMargin: clipRoot.timeremap ? labelRect.height : 0
Text {
......
......@@ -46,7 +46,7 @@ Item {
property double speed: 1.0
property color color: displayRect.color
property color borderColor: 'black'
property bool hideCompoViews
property bool hideCompoViews: scrollStart > (clipDuration * timeline.scaleFactor) || scrollStart + scrollView.width < 0 || width < root.minClipWidthForViews
property int scrollStart: scrollView.contentX - modelStart * timeline.scaleFactor
property int mouseXPos: mouseArea.mouseX
......@@ -60,7 +60,6 @@ Item {
signal trimmedOut(var clip)
onScrollStartChanged: {
compositionRoot.hideCompoViews = compositionRoot.scrollStart > width || compositionRoot.scrollStart + scrollView.width < 0
if (!compositionRoot.hideClipViews && compositionRoot.width > scrollView.width) {
if (effectRow.item && effectRow.item.kfrCanvas) {
effectRow.item.kfrCanvas.requestPaint()
......@@ -391,6 +390,7 @@ Item {
// text background
id: labelRect
color: compositionRoot.aTrack > -1 ? 'yellow' : 'lightgray'
visible: compositionRoot.width > root.baseUnit
width: label.width + 2
height: label.height
Text {
......
......@@ -369,7 +369,8 @@ Rectangle {
}
property int activeTool: ProjectTool.SelectTool
property real baseUnit: Math.max(12, fontMetrics.font.pixelSize)
property int baseUnit: Math.max(12, fontMetrics.font.pixelSize)
property int minClipWidthForViews: 1.5 * baseUnit
property real fontUnit: fontMetrics.font.pointSize
property int collapsedHeight: Math.max(28, baseUnit * 1.8)
property int minHeaderWidth: 6 * collapsedHeight
......
Supports Markdown
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