ui changes for video editor

This commit is contained in:
Chris Cochrun 2022-10-07 07:26:00 -05:00
parent 86c661512d
commit f23bbdf806

View file

@ -27,37 +27,29 @@ Item {
RowLayout {
anchors.fill: parent
Controls.ComboBox {
model: Qt.fontFamilies()
Controls.TextField {
implicitWidth: 300
editable: true
hoverEnabled: true
/* onCurrentTextChanged: showPassiveNotification(currentText) */
placeholderText: "Song Title..."
text: video.title
padding: 10
onEditingFinished: updateTitle(text);
}
Controls.SpinBox {
editable: true
from: 5
to: 72
hoverEnabled: true
}
Controls.ComboBox {
model: ["VIDEOS", "Center", "Right", "Justify"]
implicitWidth: 100
hoverEnabled: true
}
Controls.ToolButton {
text: "B"
hoverEnabled: true
}
Controls.ToolButton {
text: "I"
hoverEnabled: true
}
Controls.ToolButton {
text: "U"
hoverEnabled: true
Controls.CheckBox {
id: loopCheckBox
Layout.preferredWidth: 300
Layout.fillWidth: true
Layout.leftMargin: 20
Layout.rightMargin: 20
text: "Repeat"
padding: 10
onToggled: showPassiveNotification("BOOM!")
}
Controls.ToolSeparator {}
Item { Layout.fillWidth: true }
Controls.ToolSeparator {}
Controls.ToolButton {
@ -110,113 +102,18 @@ Item {
}
}
Controls.SplitView {
Layout.fillHeight: true
Layout.fillWidth: true
Layout.columnSpan: 2
handle: Item{
implicitWidth: 6
Rectangle {
height: parent.height
anchors.horizontalCenter: parent.horizontalCenter
width: 1
color: Controls.SplitHandle.hovered ? Kirigami.Theme.hoverColor : Kirigami.Theme.backgroundColor
}
}
ColumnLayout {
Controls.SplitView.fillHeight: true
Controls.SplitView.preferredWidth: 300
Controls.SplitView.minimumWidth: 100
Controls.TextField {
id: videoTitleField
Layout.preferredWidth: 300
Layout.fillWidth: true
Layout.leftMargin: 20
Layout.rightMargin: 20
placeholderText: "Song Title..."
text: video.title
padding: 10
onEditingFinished: updateTitle(text);
}
Controls.CheckBox {
id: loopCheckBox
Layout.preferredWidth: 300
Layout.fillWidth: true
Layout.leftMargin: 20
Layout.rightMargin: 20
text: "Repeat"
padding: 10
onToggled: showPassiveNotification("BOOM!")
}
RowLayout {
Layout.preferredWidth: 300
Layout.fillWidth: true
Layout.leftMargin: 20
Layout.rightMargin: 20
Controls.Label {
Layout.fillHeight: true
Layout.leftMargin: 20
Layout.rightMargin: 20
text: videoLengthSlider.first.value
}
Controls.Label {
Layout.fillHeight: true
Layout.leftMargin: 20
Layout.rightMargin: 20
text: videoLengthSlider.second.value
}
}
Controls.RangeSlider {
id: videoLengthSlider
Layout.preferredWidth: 300
Layout.fillWidth: true
Layout.leftMargin: 20
Layout.rightMargin: 20
to: videoPreview.duration
from: 0
first.value: 0
second.value: to
first.onMoved: updateStartTime(first.value)
second.onMoved: updateEndTime(second.value)
}
Item {
id: empty
Layout.fillHeight: true
}
}
ColumnLayout {
Controls.SplitView.fillHeight: true
Controls.SplitView.preferredWidth: 700
Controls.SplitView.minimumWidth: 300
spacing: 5
Item {
id: topEmpty
Layout.fillHeight: true
Layout.preferredHeight: 50
Layout.fillWidth: true
Layout.columnSpan: 2
}
MpvObject {
id: videoPreview
objectName: "mpv"
Layout.columnSpan: 2
Layout.preferredWidth: 600
Layout.preferredHeight: Layout.preferredWidth / 16 * 9
Layout.alignment: Qt.AlignCenter
@ -233,6 +130,7 @@ Item {
id: videoBg
color: Kirigami.Theme.alternateBackgroundColor
Layout.columnSpan: 2
Layout.preferredWidth: videoPreview.Layout.preferredWidth
Layout.preferredHeight: videoTitleField.height
Layout.alignment: Qt.AlignHCenter
@ -261,6 +159,45 @@ Item {
onMoved: videoPreview.seek(value);
}
}
}
Item {
Layout.columnSpan: 2
Layout.preferredHeight: 60
}
Controls.RangeSlider {
id: videoLengthSlider
Layout.columnSpan: 2
Layout.preferredWidth: videoPreview.Layout.preferredWidth
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.leftMargin: width / 3
Layout.rightMargin: width / 3
to: videoPreview.duration
from: 0
first.value: 0
second.value: to
first.onMoved: updateStartTime(first.value)
second.onMoved: updateEndTime(second.value)
}
Controls.Label {
Layout.alignment: Qt.AlignLeft
Layout.leftMargin: videoLengthSlider.Layout.leftMargin
text: "Start Time: " + videoLengthSlider.first.value
}
Controls.Label {
Layout.alignment: Qt.AlignRight
Layout.rightMargin: videoLengthSlider.Layout.rightMargin
text: "End Time: " + videoLengthSlider.second.value
}
Item {
@ -268,8 +205,7 @@ Item {
Layout.fillHeight: true
}
}
}
/* } */
}
Timer {
id: mpvLoadingTimer