diff --git a/src/timeline2/view/qml/AudioLevels.qml b/src/timeline2/view/qml/AudioLevels.qml index 19ccb0d3e..33f6f7d57 100644 --- a/src/timeline2/view/qml/AudioLevels.qml +++ b/src/timeline2/view/qml/AudioLevels.qml @@ -1,32 +1,60 @@ import QtQuick 2.6 import QtGraphicalEffects 1.0 +import QtQuick.Layouts 1.3 -Rectangle { +Item { id: recContainer width: parent.width - border.color: root.frameColor - color: Qt.lighter(activePalette.base) - Repeater { - model: audiorec.levels.length - id: levelRepeater + RowLayout { + spacing: 2 + Layout.fillWidth: true Rectangle { - color: 'transparent' - LinearGradient { + id: recbutton + width: root.baseUnit * 1.5 + height: root.baseUnit * 1.5 + radius: root.baseUnit * .75 + color: 'darkred' + border.color: 'black' + MouseArea { anchors.fill: parent - anchors.margins: 0.5 - start: Qt.point(0,0) - end: Qt.point(recContainer.width, 0) - gradient: Gradient { - GradientStop { position: 0.0; color: "green" } - GradientStop { position: 0.6; color: "greenyellow" } - GradientStop { position: 0.7; color: "yellow" } - GradientStop { position: 0.9; color: "gold" } - GradientStop { position: 1.0; color: "red" } + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onEntered: { + parent.color = 'red' + } + onExited: { + parent.color = 'darkred' + } + } + } + Rectangle { + Layout.fillHeight: true + width: recContainer.width - recbutton.width - 6 + border.color: root.frameColor + color: Qt.lighter(activePalette.base) + Repeater { + model: audiorec.levels.length + id: levelRepeater + Rectangle { + color: 'transparent' + LinearGradient { + anchors.fill: parent + anchors.margins: 0.5 + start: Qt.point(0,0) + end: Qt.point(recContainer.width, 0) + gradient: Gradient { + GradientStop { position: 0.0; color: "green" } + GradientStop { position: 0.6; color: "greenyellow" } + GradientStop { position: 0.7; color: "yellow" } + GradientStop { position: 0.9; color: "gold" } + GradientStop { position: 1.0; color: "red" } + } + } + width: parent.width * audiorec.levels[index] + height: parent.height / levelRepeater.count + y: height * index } } - width: parent.width * audiorec.levels[index] - height: parent.height / levelRepeater.count - y: height * index } } }