2020-09-24 09:57:54 +10:00
|
|
|
// Copyright Mirage authors & contributors <https://github.com/mirukana/mirage>
|
2020-03-28 22:18:00 +11:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
|
|
|
import QtQuick 2.12
|
|
|
|
import "../Base"
|
|
|
|
|
|
|
|
HQtObject {
|
2020-03-29 03:31:42 +11:00
|
|
|
id: root
|
|
|
|
|
2020-03-28 22:18:00 +11:00
|
|
|
property Item container: parent
|
2020-06-25 22:32:08 +10:00
|
|
|
property bool active: container.count > 1
|
2020-03-28 22:18:00 +11:00
|
|
|
|
|
|
|
HShortcut {
|
2020-04-01 23:01:13 +11:00
|
|
|
active: root.active
|
2020-10-08 11:12:32 +11:00
|
|
|
sequences: window.settings.Keys.previous_tab
|
2020-03-28 22:18:00 +11:00
|
|
|
onActivated: container.setCurrentIndex(
|
|
|
|
utils.numberWrapAt(container.currentIndex - 1, container.count),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
HShortcut {
|
2020-04-01 23:01:13 +11:00
|
|
|
active: root.active
|
2020-10-08 11:12:32 +11:00
|
|
|
sequences: window.settings.Keys.next_tab
|
2020-03-28 22:18:00 +11:00
|
|
|
onActivated: container.setCurrentIndex(
|
|
|
|
utils.numberWrapAt(container.currentIndex + 1, container.count),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|