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 { RowLayout {
anchors.fill: parent anchors.fill: parent
Controls.ComboBox { Controls.TextField {
model: Qt.fontFamilies()
implicitWidth: 300 implicitWidth: 300
editable: true
hoverEnabled: true hoverEnabled: true
/* onCurrentTextChanged: showPassiveNotification(currentText) */ placeholderText: "Song Title..."
text: video.title
padding: 10
onEditingFinished: updateTitle(text);
} }
Controls.SpinBox {
editable: true Controls.CheckBox {
from: 5 id: loopCheckBox
to: 72 Layout.preferredWidth: 300
hoverEnabled: true Layout.fillWidth: true
} Layout.leftMargin: 20
Controls.ComboBox { Layout.rightMargin: 20
model: ["VIDEOS", "Center", "Right", "Justify"]
implicitWidth: 100 text: "Repeat"
hoverEnabled: true padding: 10
} onToggled: showPassiveNotification("BOOM!")
Controls.ToolButton {
text: "B"
hoverEnabled: true
}
Controls.ToolButton {
text: "I"
hoverEnabled: true
}
Controls.ToolButton {
text: "U"
hoverEnabled: true
} }
Controls.ToolSeparator {} Controls.ToolSeparator {}
Item { Layout.fillWidth: true } Item { Layout.fillWidth: true }
Controls.ToolSeparator {} Controls.ToolSeparator {}
Controls.ToolButton { 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 { Item {
id: topEmpty id: topEmpty
Layout.fillHeight: true Layout.preferredHeight: 50
Layout.fillWidth: true
Layout.columnSpan: 2
} }
MpvObject { MpvObject {
id: videoPreview id: videoPreview
objectName: "mpv" objectName: "mpv"
Layout.columnSpan: 2
Layout.preferredWidth: 600 Layout.preferredWidth: 600
Layout.preferredHeight: Layout.preferredWidth / 16 * 9 Layout.preferredHeight: Layout.preferredWidth / 16 * 9
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
@ -233,6 +130,7 @@ Item {
id: videoBg id: videoBg
color: Kirigami.Theme.alternateBackgroundColor color: Kirigami.Theme.alternateBackgroundColor
Layout.columnSpan: 2
Layout.preferredWidth: videoPreview.Layout.preferredWidth Layout.preferredWidth: videoPreview.Layout.preferredWidth
Layout.preferredHeight: videoTitleField.height Layout.preferredHeight: videoTitleField.height
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
@ -261,6 +159,45 @@ Item {
onMoved: videoPreview.seek(value); 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 { Item {
@ -268,8 +205,7 @@ Item {
Layout.fillHeight: true Layout.fillHeight: true
} }
} /* } */
}
} }
Timer { Timer {
id: mpvLoadingTimer id: mpvLoadingTimer