From c6295225fb44c9702f6a1161a315b83a75a7976b Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 13 Dec 2019 17:59:58 -0400 Subject: [PATCH] Make tab keybinds work on room pane views --- src/qml/Base/HSwipeView.qml | 2 ++ src/qml/Shortcuts.qml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qml/Base/HSwipeView.qml b/src/qml/Base/HSwipeView.qml index 62d872d6..e9bfd84f 100644 --- a/src/qml/Base/HSwipeView.qml +++ b/src/qml/Base/HSwipeView.qml @@ -3,6 +3,7 @@ import QtQuick.Controls 2.12 SwipeView { Component.onCompleted: if (! changed) { + if (becomeKeyboardTabsTarget) shortcuts.tabsTarget = this setCurrentIndex(window.getState(this, "currentIndex", defaultIndex)) saveEnabled = true } @@ -17,6 +18,7 @@ SwipeView { // Prevent onCurrentIndexChanged from running before Component.onCompleted property bool saveEnabled: false + property bool becomeKeyboardTabsTarget: true property int defaultIndex: 0 property bool changed: currentIndex !== defaultIndex diff --git a/src/qml/Shortcuts.qml b/src/qml/Shortcuts.qml index d462cb26..8c99ee4e 100644 --- a/src/qml/Shortcuts.qml +++ b/src/qml/Shortcuts.qml @@ -9,8 +9,8 @@ Item { // Flickable or ListView that should be affected by scroll shortcuts property Item flickTarget - // TabBar that should be affected by tab navigation shortcuts - property TabBar tabsTarget + // A QQC Container that should be affected by tab navigation shortcuts + property Container tabsTarget // DebugConsole that should be affected by console shortcuts property DebugConsole debugConsole