Commit 853bbd53 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix timelinekeyboard focus on start and grab not correctly ended

parent 9b1a25ec
Pipeline #7145 passed with stage
in 20 minutes and 46 seconds
......@@ -105,7 +105,6 @@
#include <QStyleFactory>
#include <QTemporaryFile>
#include <QUndoGroup>
#include <KConfigGroup>
#include <QDesktopWidget>
#include <QDialogButtonBox>
......@@ -2010,6 +2009,7 @@ void MainWindow::connectDocument()
m_buttonSelectTool->setChecked(true);
connect(m_projectMonitorDock, &QDockWidget::visibilityChanged, m_projectMonitor, &Monitor::slotRefreshMonitor, Qt::UniqueConnection);
connect(m_clipMonitorDock, &QDockWidget::visibilityChanged, m_clipMonitor, &Monitor::slotRefreshMonitor, Qt::UniqueConnection);
getMainTimeline()->focusTimeline();
}
void MainWindow::slotZoneMoved(int start, int end)
......
......@@ -1130,7 +1130,7 @@ void Monitor::checkOverlay(int pos)
pos = m_timePos->getValue();
}
QPoint zone = m_glMonitor->getControllerProxy()->zone();
std::shared_ptr<MarkerListModel> model;
std::shared_ptr<MarkerListModel> model(nullptr);
if (m_id == Kdenlive::ClipMonitor && m_controller) {
model = m_controller->getMarkerModel();
} else if (m_id == Kdenlive::ProjectMonitor && pCore->currentDoc()) {
......
......@@ -84,6 +84,8 @@ Rectangle {
onIsGrabbedChanged: {
if (clipRoot.isGrabbed) {
grabItem()
} else {
mouseArea.focus = false
}
}
......@@ -272,6 +274,7 @@ Rectangle {
}
Keys.onEscapePressed: {
timeline.grabCurrent()
//focus = false
}
onPositionChanged: {
var mapped = parentTrack.mapFromItem(clipRoot, mouse.x, mouse.y).x
......
......@@ -57,7 +57,7 @@ Rectangle {
playhead.fillColor = activePalette.windowText
ruler.repaintRuler()
}
function moveSelectedTrack(offset) {
var cTrack = Logic.getTrackIndexFromId(timeline.activeTrack)
var newTrack = cTrack + offset
......@@ -211,6 +211,12 @@ Rectangle {
}
return tentativeClip
}
Keys.onDownPressed: {
root.moveSelectedTrack(1)
}
Keys.onUpPressed: {
root.moveSelectedTrack(-1)
}
property int headerWidth: timeline.headerWidth()
property int activeTool: 0
......@@ -848,12 +854,6 @@ Rectangle {
property real clickY
width: root.width - headerWidth
height: root.height
Keys.onDownPressed: {
root.moveSelectedTrack(1)
}
Keys.onUpPressed: {
root.moveSelectedTrack(-1)
}
// This provides continuous scrubbing and scimming at the left/right edges.
hoverEnabled: true
acceptedButtons: Qt.RightButton | Qt.LeftButton | Qt.MidButton
......
......@@ -224,3 +224,11 @@ int TimelineWidget::zoomForScale(double value) const
}
return ix;
}
void TimelineWidget::focusTimeline()
{
setFocus();
if (rootObject()) {
rootObject()->setFocus(true);
}
}
......@@ -52,6 +52,8 @@ public:
QPoint getTracksCount() const;
/* @brief calculate zoom level for a scale */
int zoomForScale(double value) const;
/* @brief Give keyboard focus to timeline qml */
void focusTimeline();
bool loading;
protected:
......
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