Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Start fixing timeline menus, remove clip now works through context menu

parent a7488d6f
......@@ -551,11 +551,11 @@ Rectangle {
Menu {
id: menu
function show() {
mergeItem.visible = timeline.mergeClipWithNext(trackIndex, index, true)
//mergeItem.visible = timeline.mergeClipWithNext(trackIndex, index, true)
popup()
}
MenuItem {
visible: !isBlank && !isTransition
visible: true // !isBlank && !isTransition
text: qsTr('Cut')
onTriggered: {
if (!trackRoot.isLocked) {
......@@ -567,7 +567,7 @@ Rectangle {
}
}
MenuItem {
visible: !isBlank && !isTransition
visible: true //!isBlank && !isTransition
text: qsTr('Copy')
onTriggered: timeline.copyClip(trackIndex, index)
}
......@@ -576,18 +576,19 @@ Rectangle {
}
MenuItem {
text: qsTr('Remove')
onTriggered: timeline.remove(trackIndex, index)
shortcut: StandardKey.Delete
onTriggered: timeline.removeClip(clipRoot.clipId)
}
MenuItem {
visible: !isBlank
visible: true //!isBlank
text: qsTr('Lift')
onTriggered: timeline.lift(trackIndex, index)
}
MenuSeparator {
visible: !isBlank && !isTransition
visible: true //!isBlank && !isTransition
}
MenuItem {
visible: !isBlank && !isTransition
visible: true //!isBlank && !isTransition
text: qsTr('Split At Playhead (S)')
onTriggered: timeline.splitClip(trackIndex, index)
}
......@@ -601,12 +602,12 @@ Rectangle {
text: qsTr('Rebuild Audio Waveform')
onTriggered: timeline.remakeAudioLevels(trackIndex, index)
}
onPopupVisibleChanged: {
/*onPopupVisibleChanged: {
if (visible && application.OS !== 'OS X' && __popupGeometry.height > 0) {
// Try to fix menu running off screen. This only works intermittently.
menu.__yOffset = Math.min(0, Screen.height - (__popupGeometry.y + __popupGeometry.height + 40))
menu.__xOffset = Math.min(0, Screen.width - (__popupGeometry.x + __popupGeometry.width))
}
}
}*/
}
}
......@@ -86,7 +86,7 @@ Rectangle {
parent.clicked()
nameEdit.visible = false
if (mouse.button == Qt.RightButton)
menu.popup()
headerMenu.popup()
}
}
ColumnLayout {
......
......@@ -83,6 +83,19 @@ Rectangle {
onTriggered: timeline.addAudioTrack();
}
}
Menu {
id: headerMenu
MenuItem {
text: qsTr('Add Track')
shortcut: 'Ctrl+U'
onTriggered: timeline.addTrack(currentTrack);
}
MenuItem {
text: qsTr('Delete Track')
//shortcut: 'Ctrl+U'
onTriggered: timeline.deleteTrack(currentTrack);
}
}
Row {
Column {
......@@ -165,7 +178,7 @@ Rectangle {
}
onClicked: {
if (mouse.button & Qt.RightButton) {
menu.show()
menu.popup()
} else {
console.log("Position changed: ",timeline.position)
root.seekPos = (scrollView.flickableItem.contentX + mouse.x) / timeline.scaleFactor
......
......@@ -201,6 +201,11 @@ void TimelineWidget::insertClip(int tid, int position, QString data_str)
m_model->requestClipInsertion(prod, tid, position, id);
}
void TimelineWidget::removeClip(int cid)
{
qDebug()<<"DELTE CLIP: "<<cid;
m_model->requestClipDeletion(cid);
}
QString TimelineWidget::timecode(int frames)
{
......@@ -270,3 +275,13 @@ bool TimelineWidget::showWaveforms() const
{
return KdenliveSettings::audiothumbnails();
}
void TimelineWidget::addTrack(int tid)
{
qDebug()<<"Adding track: "<<tid;
}
void TimelineWidget::deleteTrack(int tid)
{
qDebug()<<"Deleting track: "<<tid;
}
......@@ -126,6 +126,7 @@ public:
@param xml is the data describing the dropped clip
*/
Q_INVOKABLE void insertClip(int tid, int position, QString xml);
Q_INVOKABLE void removeClip(int cid);
/* @brief Returns the current tractor's producer, useful fo control seeking, playing, etc
*/
Mlt::Producer *producer();
......@@ -141,7 +142,12 @@ public:
/* @brief Do we want to display audio thumbnails
*/
Q_INVOKABLE bool showWaveforms() const;
/* @brief Insert a timeline track
*/
Q_INVOKABLE void addTrack(int tid);
/* @brief Remove a timeline track
*/
Q_INVOKABLE void deleteTrack(int tid);
protected:
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
......
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