Fix ruler scaling and various small display issues

parent 66938d03
......@@ -45,6 +45,7 @@ EffectListWidget::EffectListWidget(QWidget *parent)
setResizeMode(QQuickWidget::SizeRootObjectToView);
rootContext()->setContextProperty("effectlist", this);
rootContext()->setContextProperty("effectListModel", m_proxyModel);
m_effectIconProvider.reset(new EffectIconProvider);
engine()->addImageProvider(QStringLiteral("effecticon"), m_effectIconProvider.get());
......
......@@ -163,9 +163,8 @@ Rectangle {
visible: styleData.value != "root"
source: 'image://effecticon/' + styleData.value
}
Text{
Label{
text: effectlist.getName(styleData.index)
color: activePalette.windowText
}
}
TableViewColumn { role: "id"; title: "Name"; width: 200 }
......
......@@ -17,40 +17,51 @@
*/
import QtQuick 2.0
import QtQuick.Controls 1.0
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
Rectangle {
property int stepSize: fontMetrics.tightBoundingRect('00:00:00:00').width / 3
property int labelSize: fontMetrics.tightBoundingRect('00:00:00:00').width
property int stepSize: stepSize
property int frameSize: stepSize
property int index: 0
property real timeScale: timeline.scaleFactor
property real fontUnit: root.baseUnit * 0.9
SystemPalette { id: activePalette }
function adjustStepSize() {
if (timeScale > 19) {
frameSize = timeScale
stepSize = timeScale > labelSize * 1.3 ? timeScale : Math.floor(labelSize/timeScale+1) * timeScale
} else {
frameSize = labelSize / 3
stepSize = labelSize * 4 / 3
}
}
id: rulerTop
enabled: false
height: fontMetrics.font.pixelSize * 2
color: activePalette.base
color: activePalette.window
Repeater {
model: parent.width / stepSize
model: parent.width / frameSize
Rectangle {
anchors.bottom: rulerTop.bottom
height: (index % 4)? ((index % 2) ? 3 : 7) : 14
width: 1
color: activePalette.windowText
x: index * stepSize
x: index * frameSize
}
}
Repeater {
model: parent.width / stepSize / 4
model: parent.width / stepSize
Label {
anchors.top: rulerTop.top
anchors.topMargin: 2
color: activePalette.windowText
x: index * stepSize * 4 + 2
text: timeline.timecode(index * stepSize * 4 / timeScale)
x: index * stepSize + 2
text: timeline.timecode(index * stepSize / timeScale)
font.pointSize: fontUnit
}
}
......
......@@ -133,7 +133,6 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 4
color: activePalette.windowText
elide: Qt.ElideRight
}
TextField {
......
......@@ -75,9 +75,14 @@ Rectangle {
property int droppedPosition: -1
property int droppedTrack: -1
property int clipBeingMovedId: -1
property real timeScale: timeline.scaleFactor
//property alias ripple: toolbar.ripple
//onCurrentTrackChanged: timeline.selection = []
onTimeScaleChanged: {
scrollView.flickableItem.contentX = Math.max(0, root.seekPos * timeline.scaleFactor - (scrollView.width / 2))
ruler.adjustStepSize()
}
DropArea {
width: root.width - headerWidth
......@@ -285,7 +290,6 @@ Rectangle {
id: ruler
width: root.duration
index: index
timeScale: timeline.scaleFactor
}
}
ScrollView {
......@@ -347,10 +351,11 @@ Rectangle {
id: cursor
visible: timeline.position > -1
color: activePalette.text
width: 1
height: root.height - scrollView.__horizontalScrollBar.height
width: Math.max(1, 1 * timeline.scaleFactor)
opacity: (width > 2) ? 0.5 : 1
height: root.height - scrollView.__horizontalScrollBar.height - ruler.height
x: timeline.position * timeline.scaleFactor - scrollView.flickableItem.contentX
y: 0
y: ruler.height
}
Rectangle {
id: seekCursor
......@@ -366,7 +371,7 @@ Rectangle {
id: playhead
visible: timeline.position > -1
height: baseUnit
width: baseUnit
width: baseUnit * 1.5
y: ruler.height - height
x: timeline.position * timeline.scaleFactor - scrollView.flickableItem.contentX - (width / 2)
}
......@@ -434,15 +439,11 @@ Rectangle {
model: multitrack
rootIndex: trackDelegateModel.modelIndex(index)
height: trackHeight
timeScale: timeline.scaleFactor
width: root.duration * timeScale
isAudio: audio
isCurrentTrack: currentTrack === index
trackId: item
selection: timeline.selection
onTimeScaleChanged: {
scrollView.flickableItem.contentX = Math.max(0, root.seekPos * timeline.scaleFactor - (scrollView.width / 2))
}
onClipClicked: {
currentTrack = track.DelegateModel.itemsIndex
if (shiftClick === 1) {
......
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