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