Re-add "go to guide" menu in timeline

BUG: 407528
parent 60128fff
Pipeline #3607 passed with stage
in 20 minutes and 10 seconds
/***************************************************************************
* Copyright (C) 2019 by Jean-Baptiste Mardelle *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
import QtQuick 2.6
import QtQuick.Controls 1.5
import QtQuick.Window 2.2
import QtQml.Models 2.2
Menu {
id: menuRoot
property alias menuModel: itemRepeater.model
signal guideSelected(int assetFrame)
Instantiator {
id: itemRepeater
onObjectAdded: menuRoot.insertItem( index, object )
onObjectRemoved: menuRoot.removeItem( object )
delegate: MenuItem {
text: model.comment
property int assetFrame: model.frame
onTriggered: {
menuRoot.guideSelected(assetFrame)
}
}
}
}
......@@ -519,6 +519,15 @@ Rectangle {
timeline.switchGuide(timeline.position);
}
}
GuidesMenu {
title: i18n('Go to guide...')
menuModel: guidesModel
enabled: guidesDelegateModel.count > 0
onGuideSelected: {
timeline.seekPosition = assetFrame
timeline.position = timeline.seekPosition
}
}
OLD.MenuItem {
id: editGuideMenu
text: i18n('Edit Guide')
......@@ -566,6 +575,15 @@ Rectangle {
timeline.switchGuide(timeline.position);
}
}
GuidesMenu {
title: i18n('Go to guide...')
menuModel: guidesModel
enabled: guidesDelegateModel.count > 0
onGuideSelected: {
timeline.seekPosition = assetFrame
timeline.position = timeline.seekPosition
}
}
OLD.MenuItem {
id: editGuideMenu2
text: i18n('Edit Guide')
......
......@@ -37,6 +37,7 @@
<file alias="AssetView.qml">assets/view/qml/AssetView.qml</file>
<file alias="transitionView.qml">transitions/view/qml/transitionView.qml</file>
<file alias="AssetMenu.qml">timeline2/view/qml/AssetMenu.qml</file>
<file alias="GuidesMenu.qml">timeline2/view/qml/GuidesMenu.qml</file>
<file alias="BuiltStack.qml">effects/effectstack/view/qml/BuiltStack.qml</file>
<file alias="EffectSlider.qml">effects/effectstack/view/qml/EffectSlider.qml</file>
<file alias="LiftGammaGain.qml">effects/effectstack/view/qml/LiftGammaGain.qml</file>
......
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