Warning, /frameworks/kirigami/tests/NavigationTabBarTest.qml is written in an unsupported language. File is not indexed.
0001 /* SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
0002 * SPDX-License-Identifier: LGPL-2.0-or-later
0003 */
0004
0005 import QtQuick
0006 import QtQuick.Controls as QQC2
0007
0008 import org.kde.kirigami as Kirigami
0009
0010 QQC2.ApplicationWindow {
0011 width: 640
0012 height: 480
0013 visible: true
0014
0015 QQC2.SwipeView {
0016 id: swipeView
0017
0018 anchors.fill: parent
0019 currentIndex: navTabBar.currentIndex
0020
0021 QQC2.Page {
0022 contentItem: QQC2.Label {
0023 text: "page1"
0024 horizontalAlignment: Text.AlignHCenter
0025 }
0026 }
0027 QQC2.Page {
0028 contentItem: QQC2.Label {
0029 text: "page2"
0030 horizontalAlignment: Text.AlignHCenter
0031 }
0032 }
0033 QQC2.Page {
0034 contentItem: QQC2.Label {
0035 text: "page3"
0036 horizontalAlignment: Text.AlignHCenter
0037 }
0038 }
0039 QQC2.Page {
0040 contentItem: QQC2.Label {
0041 text: "page4"
0042 horizontalAlignment: Text.AlignHCenter
0043 }
0044 }
0045 onCurrentIndexChanged: navTabBar.currentIndex = swipeView.currentIndex
0046 }
0047
0048 footer: Kirigami.NavigationTabBar {
0049 id: navTabBar
0050
0051 currentIndex: swipeView.currentIndex
0052
0053 Kirigami.NavigationTabButton {
0054 visible: true
0055 width: navTabBar.buttonWidth
0056 icon.name: "document-save"
0057 text: `test ${tabIndex + 1}`
0058 QQC2.ButtonGroup.group: navTabBar.tabGroup
0059 }
0060 Kirigami.NavigationTabButton {
0061 visible: false
0062 width: navTabBar.buttonWidth
0063 icon.name: "document-send"
0064 text: `test ${tabIndex + 1}`
0065 QQC2.ButtonGroup.group: navTabBar.tabGroup
0066 }
0067 actions: [
0068 Kirigami.Action {
0069 visible: true
0070 icon.name: "edit-copy"
0071 icon.height: 32
0072 icon.width: 32
0073 text: "test 3"
0074 checked: true
0075 },
0076 Kirigami.Action {
0077 visible: true
0078 icon.name: "edit-cut"
0079 text: "test 4"
0080 checkable: true
0081 },
0082 Kirigami.Action {
0083 visible: false
0084 icon.name: "edit-paste"
0085 text: "test 5"
0086 },
0087 Kirigami.Action {
0088 visible: true
0089 icon.source: "../logo.png"
0090 text: "test 6"
0091 checkable: true
0092 }
0093 ]
0094 }
0095 }