From ee232c5c60740921f7f3a72a97e46b2523882441 Mon Sep 17 00:00:00 2001 From: Jedi18 Date: Tue, 23 Feb 2021 00:46:40 +0530 Subject: [PATCH] fix timeline focus --- resources/qml/TimelineView.qml | 1 + src/timeline/TimelineViewManager.cpp | 6 ++++++ src/timeline/TimelineViewManager.h | 1 + 3 files changed, 8 insertions(+) diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml index 8c84c145..02032393 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml @@ -79,6 +79,7 @@ Page { sequence: "Ctrl+L" onActivated: { var quickSwitch = quickSwitcherComponent.createObject(timelineRoot); + TimelineManager.focusTimeline() quickSwitch.open(); } } diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp index 49072ef4..7d74496d 100644 --- a/src/timeline/TimelineViewManager.cpp +++ b/src/timeline/TimelineViewManager.cpp @@ -587,4 +587,10 @@ TimelineViewManager::completerFor(QString completerName, QString roomId) return proxy; } return nullptr; +} + +void +TimelineViewManager::focusTimeline() +{ + getWidget()->setFocus(); } \ No newline at end of file diff --git a/src/timeline/TimelineViewManager.h b/src/timeline/TimelineViewManager.h index dfc2e386..f1c360ef 100644 --- a/src/timeline/TimelineViewManager.h +++ b/src/timeline/TimelineViewManager.h @@ -101,6 +101,7 @@ public slots: void setHistoryView(const QString &room_id); void highlightRoom(const QString &room_id); + void focusTimeline(); TimelineModel *getHistoryView(const QString &room_id) { auto room = models.find(room_id);